Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.image

Class DirectColorModel

java.lang.Object
|
+--java.awt.image.ColorModel
   |
   +--java.awt.image.PackedColorModel
      |
      +--java.awt.image.DirectColorModel


public class DirectColorModel

extends PackedColorModel

Authors:

Constructor Summary

DirectColorModel(int pixelBits, int rmask, int gmask, int bmask)

For the color model created with this constructor the pixels will have fully opaque alpha components with a value of 255.
DirectColorModel(int pixelBits, int rmask, int gmask, int bmask, int amask)

For the color model created with this constructor the pixels will have fully opaque alpha components with a value of 255.
DirectColorModel(java.awt.color.ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType)

Method Summary

java.awt.image.ColorModelcoerceData(java.awt.image.WritableRaster raster, boolean isAlphaPremultiplied)

java.awt.image.WritableRastercreateCompatibleWritableRaster(int w, int h)

intgetAlpha(int pixel)

Get the alpha component of the given pixel.
intgetAlpha(java.lang.Object inData)

intgetAlphaMask()

intgetBlue(int pixel)

Get the blue component of the given pixel.
intgetBlue(java.lang.Object inData)

intgetBlueMask()

int[]getComponents(int pixel, int[] components, int offset)

Fills an array with the unnormalized component samples from a pixel value.
int[]getComponents(java.lang.Object pixel, int[] components, int offset)

intgetDataElement(int[] components, int offset)

java.lang.ObjectgetDataElements(int rgb, java.lang.Object pixel)

Converts a normalized pixel int value in the sRGB color space to an array containing a single pixel of the color space of the color model.
java.lang.ObjectgetDataElements(int[] components, int offset, java.lang.Object obj)

intgetGreen(int pixel)

Get the green component of the given pixel.
intgetGreen(java.lang.Object inData)

intgetGreenMask()

intgetRGB(int pixel)

Get the RGB color value of the given pixel using the default RGB color model.
intgetRGB(java.lang.Object inData)

intgetRed(int pixel)

Get the red component of the given pixel.
intgetRed(java.lang.Object inData)

intgetRedMask()

booleanisCompatibleRaster(java.awt.image.Raster raster)

java.lang.StringtoString()

Constructor Details

DirectColorModel

public DirectColorModel(int pixelBits, int rmask, int gmask, int bmask)

For the color model created with this constructor the pixels will have fully opaque alpha components with a value of 255. Each mask should describe a fully contiguous set of bits in the most likely order of alpha, red, green, blue from the most significant byte to the least significant byte.

Parameters:


DirectColorModel

public DirectColorModel(int pixelBits, int rmask, int gmask, int bmask, int amask)

For the color model created with this constructor the pixels will have fully opaque alpha components with a value of 255. Each mask should describe a fully contiguous set of bits in the most likely order of red, green, blue from the most significant byte to the least significant byte.

Parameters:


DirectColorModel

public DirectColorModel(java.awt.color.ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType)

Parameters:


Method Details

coerceData

public ColorModel coerceData(java.awt.image.WritableRaster raster, boolean isAlphaPremultiplied)

Parameters:


createCompatibleWritableRaster

public final WritableRaster createCompatibleWritableRaster(int w, int h)

Parameters:


getAlpha

public final int getAlpha(int pixel)

Get the alpha component of the given pixel.

Parameters:


getAlpha

public int getAlpha(java.lang.Object inData)

Parameters:


getAlphaMask

public final int getAlphaMask()


getBlue

public final int getBlue(int pixel)

Get the blue component of the given pixel.

Parameters:


getBlue

public int getBlue(java.lang.Object inData)

Parameters:


getBlueMask

public final int getBlueMask()


getComponents

public final int[] getComponents(int pixel, int[] components, int offset)

Fills an array with the unnormalized component samples from a pixel value. I.e. decompose the pixel, but not perform any color conversion.

Parameters:


getComponents

public final int[] getComponents(java.lang.Object pixel, int[] components, int offset)

Parameters:


getDataElement

public int getDataElement(int[] components, int offset)

Parameters:


getDataElements

public Object getDataElements(int[] components, int offset, java.lang.Object obj)

Parameters:


getDataElements

public Object getDataElements(int rgb, java.lang.Object pixel)

Converts a normalized pixel int value in the sRGB color space to an array containing a single pixel of the color space of the color model.

This method performs the inverse function of getRGB(Object inData).

Parameters:

Returns:

See Also:


getGreen

public final int getGreen(int pixel)

Get the green component of the given pixel.

Parameters:


getGreen

public int getGreen(java.lang.Object inData)

Parameters:


getGreenMask

public final int getGreenMask()


getRGB

public final int getRGB(int pixel)

Get the RGB color value of the given pixel using the default RGB color model.

Parameters:


getRGB

public int getRGB(java.lang.Object inData)

Parameters:


getRed

public final int getRed(int pixel)

Get the red component of the given pixel.

Parameters:


getRed

public int getRed(java.lang.Object inData)

Parameters:


getRedMask

public final int getRedMask()


isCompatibleRaster

public boolean isCompatibleRaster(java.awt.image.Raster raster)

Parameters:


toString

public String toString()