|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.image.ColorModel | +--com.sun.jimi.core.util.GrayscaleColorModel
ColorModel for grayscale images. Allows for pixels of a given bit depth to directly represent a grayscale value.
Possible future optimisation might include a generated internal lookup table to make the individual get methods more efficient.
This class is flexible in that it can be used for black and white images and any bit depth grayscale image from 1 to 8 bits in depth.
Examples of use:
Fields inherited from class java.awt.image.ColorModel |
pixel_bits,
transferType |
Constructor Summary | |
GrayscaleColorModel(boolean zeroIsWhite)
Constructs a GrayColorModel. |
|
GrayscaleColorModel(boolean zeroIsWhite,
int pixelSize)
|
Method Summary | |
int |
getAlpha(int pixel)
|
int |
getBlue(int pixel)
|
int |
getGreen(int pixel)
|
int |
getRed(int pixel)
|
int |
getRGB(int pixel)
Returns the color of the pixel in the default RGB color model. |
boolean |
getZeroIsWhite()
|
protected void |
init(boolean zeroIsWhite)
|
Methods inherited from class java.awt.image.ColorModel |
coerceData,
createCompatibleSampleModel,
createCompatibleWritableRaster,
equals,
finalize,
getAlpha,
getAlphaRaster,
getBlue,
getColorSpace,
getComponents,
getComponents,
getComponentSize,
getComponentSize,
getDataElement,
getDataElements,
getDataElements,
getGreen,
getNormalizedComponents,
getNumColorComponents,
getNumComponents,
getPixelSize,
getRed,
getRGB,
getRGBdefault,
getTransparency,
getUnnormalizedComponents,
hasAlpha,
isAlphaPremultiplied,
isCompatibleRaster,
isCompatibleSampleModel,
toString |
Methods inherited from class java.lang.Object |
clone,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public GrayscaleColorModel(boolean zeroIsWhite)
zeroIsWhite
- Flag if set means that a pixel of value of 0
return the color white. Else value pixel value 0 returns black.public GrayscaleColorModel(boolean zeroIsWhite, int pixelSize)
zeroIsWhite
- Flag if set means that a pixel of value of 0
return the color whitepixelSize
- range of values 1 to 8 bits only.Method Detail |
public boolean getZeroIsWhite()
protected void init(boolean zeroIsWhite)
zeroIsWhite
- Flag if set means that a pixel of value of 0
return the color white
transition between. If not set then colour transition reversed.public int getRed(int pixel)
pixel
- The pixel to lookup value for. For this colour model
the pixel can only range between 0 and (2 ^ pixelDepth) - 1)public int getGreen(int pixel)
pixel
- The pixel to lookup value for. For this colour model
the pixel can only range between 0 and 255.public int getBlue(int pixel)
pixel
- The pixel to lookup value for. For this colour model
the pixel can only range between 0 and 255.public int getAlpha(int pixel)
pixel
- The pixel to lookup value for. For this colour model
the pixel can only range between 0 and 255.public int getRGB(int pixel)
ColorModel.getRGBdefault()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |