public class TexturePixel
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
float |
alpha
The pixel data.
|
float |
blue
The pixel data.
|
float |
green
The pixel data.
|
float |
intensity
The pixel data.
|
float |
red
The pixel data.
|
Constructor and Description |
---|
TexturePixel() |
Modifier and Type | Method and Description |
---|---|
void |
add(ColorRGBA pixel)
This method adds the calues of the given pixel to the current pixel.
|
void |
add(TexturePixel pixel)
This method adds the calues of the given pixel to the current pixel.
|
void |
clamp(float min,
float max)
This method clamps the pixel values to the given borders.
|
void |
clear()
This method clears the pixel values.
|
java.lang.Object |
clone() |
void |
divide(float value)
This method divides the values of the given pixel by the given value.
|
void |
fromARGB(float a,
float r,
float g,
float b)
Copies the values from the given values.
|
void |
fromARGB16(short a,
short r,
short g,
short b)
Copies the values from the given values.
|
void |
fromARGB8(byte a,
byte r,
byte g,
byte b)
Copies the values from the given values.
|
void |
fromARGB8(int argb8)
Copies the values from the given integer that stores the ARGB8 data.
|
void |
fromColor(ColorRGBA colorRGBA)
Copies the values from the given color.
|
void |
fromIntensity(byte intensity)
Copies the intensity from the given value.
|
void |
fromIntensity(short intensity)
Copies the intensity from the given value.
|
void |
fromPixel(TexturePixel pixel)
Copies the values from the given pixel.
|
short |
getA16() |
byte |
getA8() |
short |
getB16() |
byte |
getB8() |
short |
getG16() |
byte |
getG8() |
byte |
getInt() |
short |
getR16() |
byte |
getR8() |
void |
merge(TexturePixel pixel)
Merges two pixels (adds the values of each color).
|
void |
mix(TexturePixel pixel)
Mixes two pixels.
|
void |
mult(float value)
This method multiplies the values of the given pixel by the given value.
|
void |
negate()
This method negates the colors.
|
void |
setAlpha(byte alpha)
This method sets the alpha value (converts it to float number from range
[0, 1]).
|
void |
setAlpha(short alpha)
This method sets the alpha value (converts it to float number from range
[0, 1]).
|
int |
toARGB8()
Stores the pixel values in the integer.
|
void |
toRGBA(float[] result)
Stores RGBA values in the given array.
|
void |
toRGBA8(byte[] result)
Stores the data in the given table.
|
java.lang.String |
toString() |
public float intensity
public float red
public float green
public float blue
public float alpha
public void fromPixel(TexturePixel pixel)
pixel
- the pixel that we read frompublic void fromColor(ColorRGBA colorRGBA)
colorRGBA
- the color that we read frompublic void fromARGB(float a, float r, float g, float b)
a
- the alpha valuer
- the red valueg
- the green valueb
- the blue valuepublic void fromARGB8(byte a, byte r, byte g, byte b)
a
- the alpha valuer
- the red valueg
- the green valueb
- the blue valuepublic void fromARGB16(short a, short r, short g, short b)
a
- the alpha valuer
- the red valueg
- the green valueb
- the blue valuepublic void fromIntensity(byte intensity)
intensity
- the intensity valuepublic void fromIntensity(short intensity)
intensity
- the intensity valuepublic void setAlpha(byte alpha)
alpha
- the alpha valuepublic void setAlpha(short alpha)
alpha
- the alpha valuepublic void fromARGB8(int argb8)
argb8
- the data stored in an integerpublic void toRGBA(float[] result)
result
- the array to store valuespublic void toRGBA8(byte[] result)
result
- the result tablepublic int toARGB8()
public byte getInt()
public byte getA8()
public byte getR8()
public byte getG8()
public byte getB8()
public short getA16()
public short getR16()
public short getG16()
public short getB16()
public void merge(TexturePixel pixel)
pixel
- the pixel we merge withpublic void mix(TexturePixel pixel)
pixel
- the pixel we mix withpublic void negate()
public void clear()
public void add(TexturePixel pixel)
pixel
- the pixel we addpublic void add(ColorRGBA pixel)
pixel
- the pixel we addpublic void mult(float value)
value
- multiplication factorpublic void divide(float value)
value
- division factorpublic void clamp(float min, float max)
min
- the minimum valuemax
- the maximum valuepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object