omeis.providers.re
Class RGBBuffer

java.lang.Object
  extended by omeis.providers.re.RGBBuffer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RGBAIntBuffer, RGBIntBuffer

public class RGBBuffer
extends Object
implements Serializable

Holds the data of an RGB image. The image data is stored in three byte arrays, one for each color band.

Since:
OME2.2
Version:
2.2 (Internal version: $Revision: 1574 $ $Date: 2005/06/22 17:09:48 $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk,
Andrea Falconi      a.falconi@dundee.ac.uk
See Also:
Serialized Form

Field Summary
static int B_BAND
          Index of the blue band in the image's data buffer.
static int G_BAND
          Index of the green band in the image's data buffer.
static int R_BAND
          Index of the red band in the image's data buffer.
 
Constructor Summary
protected RGBBuffer()
          Simple constructor to avoid memory allocations.
  RGBBuffer(int sizeX1, int sizeX2)
          Creates a new 3-band buffer.
 
Method Summary
 byte[] getBlueBand()
          Returns the data buffer for the blue band.
 byte getBlueValue(int index)
          Retrieves the Blue value for a particular pixel index.
 byte[] getGreenBand()
          Returns the data buffer for the green band.
 byte getGreenValue(int index)
          Retrieves the Green value for a particular pixel index.
 byte[] getRedBand()
          Returns the data buffer for the red band.
 byte getRedValue(int index)
          Retrieves the Red value for a particular pixel index.
 int getSizeX1()
          Returns the number of pixels on the X1-axis.
 int getSizeX2()
          Returns the number of pixels on the X2-axis.
 void setBlueValue(int index, int value)
          Sets the Blue value for a particular pixel index.
 void setGreenValue(int index, int value)
          Sets the Green value for a particular pixel index.
 void setRedValue(int index, int value)
          Sets the Red value for a particular pixel index.
 void zero()
          Zeros out (sets every pixel offset to zero) each band.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.



OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.