|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.image.RGBImage
Stores an RGB image = < width, height, red-buffer, green-buffer, blue-buffer > An RGBImage stores a rectangular, color image in RGB format. The image's width and height are specified upon construction, and three byte arrays are created to store all the red, green, and blue components separately. The pixel data is stored in left-right, top-down scanline order. Each component value is from 0 to 255, stored in a byte.
Field Summary | |
byte[] |
b
r, g, and b store the red, green, and blue pixel components |
byte[] |
g
r, g, and b store the red, green, and blue pixel components |
int |
height
width, height store the dimensions of the image. |
int[] |
offset
offset[] indexes the left-most pixel of each scanline in r,g,b[] The index of pixel (x,y) is therefore offset[y]+x |
byte[] |
r
r, g, and b store the red, green, and blue pixel components |
int |
size
width, height store the dimensions of the image. |
int |
width
width, height store the dimensions of the image. |
Constructor Summary | |
RGBImage(int width,
int height)
Constructs a new RGBImage = |
Method Summary | |
void |
BfromScalarImage(ScalarImage image,
double B)
|
void |
BtoScalarImage(ScalarImage image)
|
private double |
clamp(double x,
double min,
double max)
|
void |
Clear()
Sets all the pixels values to zero |
void |
Copy(RGBImage image)
Copies the RGB values from the top-left corner of 'image' to 'this' Requires: 'image' is at least as large as 'this' |
void |
Copy(RGBImage image,
int xorigin,
int yorigin)
Copies the RGB values from the sub-window of 'image' starting at (xorigin, yorigin) to 'this'. |
void |
fromScalarImage(ScalarImage image,
double R,
double G,
double B)
Sets 'this' to a colorized representation of 'image' within the window starting at the top-left corner. |
void |
fromScalarImage(ScalarImage image,
int xorigin,
int yorigin,
double R,
double G,
double B)
Sets 'this' to a colorized representation of 'image' within the sub-window starting at (xorigin, yorigin). |
void |
fromScalarImageMagnitude(ScalarImage image,
Vec2Field f,
Vec2Transform ftoi,
Vec3Field func)
|
byte |
getB(int x,
int y)
Returns: the blue component of the pixel at (x, y) Requires: 0<=x |
byte |
getG(int x,
int y)
Returns: the green component of the pixel at (x, y) Requires: 0<=x |
byte |
getR(int x,
int y)
Returns: the red component of the pixel at (x, y) Requires: 0<=x |
void |
GfromScalarImage(ScalarImage image,
double G)
|
void |
GtoScalarImage(ScalarImage image)
|
void |
RfromScalarImage(ScalarImage image,
double R)
|
void |
RtoScalarImage(ScalarImage image)
|
void |
Set(int x,
int y,
byte R,
byte G,
byte B)
Sets the pixel at (x, y) to the color (R, G, B). |
void |
toBGRBytes(byte[] buf)
Copies the pixel data in 'this' to the byte-buffer 'buf' in BGR packed order. |
void |
toRGBBytes(byte[] buf)
Copies the pixel data in 'this' to the byte-buffer 'buf' in RGB packed order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final int width
public final int height
public final int size
public byte[] r
public byte[] g
public byte[] b
public final int[] offset
Constructor Detail |
public RGBImage(int width, int height)
Method Detail |
public void Clear()
public void Copy(RGBImage image, int xorigin, int yorigin)
public void Copy(RGBImage image)
public byte getR(int x, int y)
public byte getG(int x, int y)
public byte getB(int x, int y)
public void Set(int x, int y, byte R, byte G, byte B)
public void toRGBBytes(byte[] buf)
public void toBGRBytes(byte[] buf)
public void fromScalarImage(ScalarImage image, int xorigin, int yorigin, double R, double G, double B)
public void fromScalarImage(ScalarImage image, double R, double G, double B)
public void fromScalarImageMagnitude(ScalarImage image, Vec2Field f, Vec2Transform ftoi, Vec3Field func)
public void RfromScalarImage(ScalarImage image, double R)
public void RtoScalarImage(ScalarImage image)
public void GfromScalarImage(ScalarImage image, double G)
public void GtoScalarImage(ScalarImage image)
public void BfromScalarImage(ScalarImage image, double B)
public void BtoScalarImage(ScalarImage image)
private double clamp(double x, double min, double max)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |