Package omeis.providers.re
Class RGBBuffer
- java.lang.Object
-
- omeis.providers.re.RGBBuffer
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RGBAIntBuffer,RGBIntBuffer
public class RGBBuffer extends java.lang.Object implements java.io.SerializableHolds the data of an RGB image. The image data is stored in three byte arrays, one for each color band.- Since:
- OME2.2
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBlueBand()Returns the data buffer for the blue band.bytegetBlueValue(int index)Retrieves the Blue value for a particular pixel index.byte[]getGreenBand()Returns the data buffer for the green band.bytegetGreenValue(int index)Retrieves the Green value for a particular pixel index.byte[]getRedBand()Returns the data buffer for the red band.bytegetRedValue(int index)Retrieves the Red value for a particular pixel index.intgetSizeX1()Returns the number of pixels on the X1-axis.intgetSizeX2()Returns the number of pixels on the X2-axis.voidsetBlueValue(int index, int value)Sets the Blue value for a particular pixel index.voidsetGreenValue(int index, int value)Sets the Green value for a particular pixel index.voidsetRedValue(int index, int value)Sets the Red value for a particular pixel index.voidzero()Zeros out (sets every pixel offset to zero) each band.
-
-
-
Field Detail
-
R_BAND
public static final int R_BAND
Index of the red band in the image's data buffer.- See Also:
- Constant Field Values
-
G_BAND
public static final int G_BAND
Index of the green band in the image's data buffer.- See Also:
- Constant Field Values
-
B_BAND
public static final int B_BAND
Index of the blue band in the image's data buffer.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RGBBuffer
protected RGBBuffer()
Simple constructor to avoid memory allocations.
-
RGBBuffer
public RGBBuffer(int sizeX1, int sizeX2)Creates a new 3-band buffer.- Parameters:
sizeX1- The number of pixels on the X1-axis. This is the X-axis in the case of an XY-plane or XZ-plane. Otherwise it is the Z-axis ZY-plane.sizeX2- The number of pixels on the X2-axis. This is the Y-axis in the case of an XY-plane or ZY-plane. Otherwise it is the Z-axis XZ-plane.- See Also:
bands
-
-
Method Detail
-
getRedBand
public byte[] getRedBand()
Returns the data buffer for the red band.- Returns:
- See above.
-
getGreenBand
public byte[] getGreenBand()
Returns the data buffer for the green band.- Returns:
- See above.
-
getBlueBand
public byte[] getBlueBand()
Returns the data buffer for the blue band.- Returns:
- See above.
-
getSizeX1
public int getSizeX1()
Returns the number of pixels on the X1-axis. This is the X-axis in the case of an XY-plane or XZ-plane. Otherwise it is the Z-axis ZY-plane.- Returns:
- The number of pixels on the X1-axis.
-
getSizeX2
public int getSizeX2()
Returns the number of pixels on the X2-axis. This is the Y-axis in the case of an XY-plane or ZY-plane. Otherwise it is the Z-axis XZ-plane.- Returns:
- The number of pixels on the X2-axis.
-
setRedValue
public void setRedValue(int index, int value)Sets the Red value for a particular pixel index.- Parameters:
index- The index in the band array.value- The pixel value to set.
-
setGreenValue
public void setGreenValue(int index, int value)Sets the Green value for a particular pixel index.- Parameters:
index- The index in the band array.value- The pixel value to set.
-
setBlueValue
public void setBlueValue(int index, int value)Sets the Blue value for a particular pixel index.- Parameters:
index- The index in the band array.value- The pixel value to set.
-
getRedValue
public byte getRedValue(int index)
Retrieves the Red value for a particular pixel index.- Parameters:
index- The index in the band array.- Returns:
- The pixel value at the index.
-
getGreenValue
public byte getGreenValue(int index)
Retrieves the Green value for a particular pixel index.- Parameters:
index- The index in the band array.- Returns:
- The pixel value at the index.
-
getBlueValue
public byte getBlueValue(int index)
Retrieves the Blue value for a particular pixel index.- Parameters:
index- The index in the band array.- Returns:
- The pixel value at the index.
-
zero
public void zero()
Zeros out (sets every pixel offset to zero) each band.
-
-