ome.io.nio
Class PixelData

java.lang.Object
  extended by ome.io.nio.PixelData
Direct Known Subclasses:
ReorderedPixelData

public class PixelData
extends Object

Represents a block of pixel data.

Since:
3.0
Version:
$Revision$
Author:
Chris Allan      chris@glencoesoftware.com
See Also:
PixelBuffer

Field Summary
static int BIT
          Identifies the type used to store pixel values.
static int BYTE
          Identifies the type used to store pixel values.
protected  int bytesPerPixel
          The number of bytes per pixel.
protected  ByteBuffer data
          The pixels data backing buffer.
static int DOUBLE
          Identifies the type used to store pixel values.
static int FLOAT
          Identifies the type used to store pixel values.
static int INT
          Identifies the type used to store pixel values.
protected  boolean isFloat
          If the data is floating point.
protected  boolean isSigned
          If the data is signed.
protected  int javaType
          The pixels type as it would be represented in Java.
static int LONG
          Identifies the type used to store pixel values.
protected  double maximum
          The maximum pixel value for the pixels type of the pixel data.
protected  double minimum
          The minimum pixel value for the pixels type of the pixel data.
protected  ome.model.enums.PixelsType pixelsType
          Type of the pixel data.
static int SHORT
          Identifies the type used to store pixel values.
 
Constructor Summary
PixelData(ome.model.enums.PixelsType pixelsType, ByteBuffer data)
          Default constructor.
 
Method Summary
 int bytesPerPixel()
          Returns the number of byte per pixel for the pixel data.
 ByteBuffer getData()
          Returns the backing buffer for the pixel data.
 double getMaximum()
          Returns the minimum pixel value this pixel data supports.
 double getMinimum()
          Returns the minimum pixel value this pixel data supports.
 ByteOrder getOrder()
          Returns the byte order of the backing buffer.
 double getPixelValue(int offset)
          Returns the pixel intensity value of the pixel at a given offset within the backing buffer.
 double getPixelValueDirect(int offset)
          Returns the pixel intensity value of the pixel at a given offset within the backing buffer.
 boolean in(String[] strings)
          Returns whether or not the pixel data type is is one of the elements in an array.
 boolean isFloat()
          Returns whether or not the data is floating point.
 boolean isSigned()
          Returns whether or not the data is signed.
 int javaType()
          Returns the Java type that has the same byte width of the pixel data.
 void setOrder(ByteOrder order)
          Set the byte order of the backing buffer.
 void setPixelValue(int offset, double value)
          Sets the pixel intensity value of the pixel at a given offset within the backing buffer.
 void setPixelValueDirect(int offset, double value)
          Sets the pixel intensity value of the pixel at a given offset within the backing buffer.
 int size()
          Returns the pixel count of this block of pixel data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE

public static final int BYTE
Identifies the type used to store pixel values.

See Also:
Constant Field Values

SHORT

public static final int SHORT
Identifies the type used to store pixel values.

See Also:
Constant Field Values

INT

public static final int INT
Identifies the type used to store pixel values.

See Also:
Constant Field Values

LONG

public static final int LONG
Identifies the type used to store pixel values.

See Also:
Constant Field Values

FLOAT

public static final int FLOAT
Identifies the type used to store pixel values.

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
Identifies the type used to store pixel values.

See Also:
Constant Field Values

BIT

public static final int BIT
Identifies the type used to store pixel values.

See Also:
Constant Field Values

pixelsType

protected ome.model.enums.PixelsType pixelsType
Type of the pixel data.


data

protected ByteBuffer data
The pixels data backing buffer.


isSigned

protected boolean isSigned
If the data is signed.


isFloat

protected boolean isFloat
If the data is floating point.


javaType

protected int javaType
The pixels type as it would be represented in Java.


bytesPerPixel

protected int bytesPerPixel
The number of bytes per pixel.


minimum

protected double minimum
The minimum pixel value for the pixels type of the pixel data.


maximum

protected double maximum
The maximum pixel value for the pixels type of the pixel data.

Constructor Detail

PixelData

public PixelData(ome.model.enums.PixelsType pixelsType,
                 ByteBuffer data)
Default constructor.

Parameters:
pixelsType - The pixels type.
data - The raw pixel data.
Method Detail

in

public boolean in(String[] strings)
Returns whether or not the pixel data type is is one of the elements in an array.

Parameters:
strings - The strings for which you want to check against.
Returns:
See above.

bytesPerPixel

public int bytesPerPixel()
Returns the number of byte per pixel for the pixel data.

Returns:
See above.

javaType

public int javaType()
Returns the Java type that has the same byte width of the pixel data.

Returns:
See above.

isSigned

public boolean isSigned()
Returns whether or not the data is signed.

Returns:
See above.

isFloat

public boolean isFloat()
Returns whether or not the data is floating point.

Returns:
See above.

getMinimum

public double getMinimum()
Returns the minimum pixel value this pixel data supports.

Returns:
See above.

getMaximum

public double getMaximum()
Returns the minimum pixel value this pixel data supports.

Returns:
See above.

setPixelValue

public void setPixelValue(int offset,
                          double value)
Sets the pixel intensity value of the pixel at a given offset within the backing buffer. This method takes into account bytes per pixel.

Parameters:
offset - The relative offset (taking into account the number of bytes per pixel) within the backing buffer.
value - Pixel value to set.

setPixelValueDirect

public void setPixelValueDirect(int offset,
                                double value)
Sets the pixel intensity value of the pixel at a given offset within the backing buffer. This method does not take into account bytes per pixel.

Parameters:
offset - The absolute offset within the backing buffer.
value - Pixel value to set.

getPixelValue

public double getPixelValue(int offset)
Returns the pixel intensity value of the pixel at a given offset within the backing buffer. This method takes into account bytes per pixel.

Parameters:
offset - The relative offset (taking into account the number of bytes per pixel) within the backing buffer.
Returns:
The intensity value.

getPixelValueDirect

public double getPixelValueDirect(int offset)
Returns the pixel intensity value of the pixel at a given offset within the backing buffer. This method does not take into account bytes per pixel.

Parameters:
offset - The absolute offset within the backing buffer.
Returns:
The intensity value.

getData

public ByteBuffer getData()
Returns the backing buffer for the pixel data.

Returns:
See above.

getOrder

public ByteOrder getOrder()
Returns the byte order of the backing buffer.

Returns:
See above.

setOrder

public void setOrder(ByteOrder order)
Set the byte order of the backing buffer.

Parameters:
order - The byte order.

size

public int size()
Returns the pixel count of this block of pixel data.

Returns:
See above.


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

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