org.shapelogic.imageutil
Interface SLImage

All Superinterfaces:
PixelHandler
All Known Implementing Classes:
IJImage, SLBufferedImage

public interface SLImage
extends PixelHandler

Very thin abstraction around ImageJ.
You should be able to open based on different things.
What type of images should you have and how should the be accessible?
I think that maybe having a small subset of what is in an ImageJ ImageProcessor should be enough for most things in ShapeLogic.

Author:
Sami Badawi

Method Summary
 int get(int index)
           
 int get(int x, int y)
          This is a faster version of getPixel() that does not do bounds checking.
 java.awt.Rectangle getActiveRectangle()
           
 int getHeight()
          Returns the height of this image in pixels.
 int getLineStride()
           
 int getNChannels()
          Returns the number of color channels in the image.
 int getPixelCount()
           
 java.lang.Object getPixels()
          Returns a reference to this image's pixel array.
 java.awt.Rectangle getRoi()
           
 int getWidth()
          Returns the width of this image in pixels.
 boolean isEmpty()
           
 boolean isGray()
           
 boolean isGray16()
           
 boolean isGray8()
           
 boolean isInvertedLut()
          Returns true if this image uses an inverting LUT that displays zero as white and 255 as black.
 boolean isRgb()
           
 void putPixel(int x, int y, int value)
          Stores the specified value at (x,y).
 void set(int index, int value)
           
 void set(int x, int y, int value)
          This is a faster version of putPixel() that does not clip out of range values and does not do bounds checking.
 void setPixels(java.lang.Object pixels)
          Sets a new pixel array for the image.
 void setRoi(int x, int y, int rwidth, int rheight)
           
 void setRoi(java.awt.Rectangle roi)
           
 

Method Detail

getWidth

int getWidth()
Returns the width of this image in pixels.


getHeight

int getHeight()
Returns the height of this image in pixels.


setRoi

void setRoi(java.awt.Rectangle roi)

setRoi

void setRoi(int x,
            int y,
            int rwidth,
            int rheight)

getRoi

java.awt.Rectangle getRoi()

getPixelCount

int getPixelCount()

get

int get(int x,
        int y)
This is a faster version of getPixel() that does not do bounds checking.


get

int get(int index)

set

void set(int x,
         int y,
         int value)
This is a faster version of putPixel() that does not clip out of range values and does not do bounds checking.


set

void set(int index,
         int value)

putPixel

void putPixel(int x,
              int y,
              int value)
Stores the specified value at (x,y). Does nothing if (x,y) is outside the image boundary. For 8-bit and 16-bit images, out of range values are clipped. For RGB images, the argb values are packed in 'value'. For float images, 'value' is expected to be a float converted to an int using Float.floatToIntBits().

Specified by:
putPixel in interface PixelHandler

getPixels

java.lang.Object getPixels()
Returns a reference to this image's pixel array. The array type (byte[], short[], float[] or int[]) varies depending on the image type.


setPixels

void setPixels(java.lang.Object pixels)
Sets a new pixel array for the image. The length of the array must be equal to width*height. Use setSnapshotPixels(null) to clear the snapshot buffer.


isInvertedLut

boolean isInvertedLut()
Returns true if this image uses an inverting LUT that displays zero as white and 255 as black.


getNChannels

int getNChannels()
Returns the number of color channels in the image. The color channels can be accessed by toFloat(channelNumber, fp) and written by setPixels(channelNumber, fp).

Returns:
1 for grayscale images, 3 for RGB images

isEmpty

boolean isEmpty()

isGray

boolean isGray()

isGray8

boolean isGray8()

isGray16

boolean isGray16()

isRgb

boolean isRgb()

getActiveRectangle

java.awt.Rectangle getActiveRectangle()

getLineStride

int getLineStride()


Copyright © 2008. All Rights Reserved.