Class Any2sRGBRed
- java.lang.Object
-
- org.apache.xmlgraphics.image.rendered.AbstractRed
-
- org.apache.xmlgraphics.image.rendered.Any2sRGBRed
-
- All Implemented Interfaces:
java.awt.image.RenderedImage
,CachableRed
public class Any2sRGBRed extends AbstractRed
This function will tranform an image from any colorspace into a luminance image. The alpha channel if any will be copied to the new image.- Version:
- $Id$ Originally authored by Thomas DeWeese.
-
-
Field Summary
Fields Modifier and Type Field Description private static double
GAMMA
Exponent for linear to sRGB convertionprivate static int[]
linearToSRGBLut
Lookup tables for RGB lookups.(package private) boolean
srcIsLsRGB
-
Fields inherited from class org.apache.xmlgraphics.image.rendered.AbstractRed
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
-
-
Constructor Summary
Constructors Constructor Description Any2sRGBRed(CachableRed src)
Construct a luminace image from src.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.awt.image.WritableRaster
applyLut_INT(java.awt.image.WritableRaster wr, int[] lut)
java.awt.image.WritableRaster
copyData(java.awt.image.WritableRaster wr)
protected static java.awt.image.ColorModel
fixColorModel(CachableRed src)
This function 'fixes' the source's color model.protected static java.awt.image.SampleModel
fixSampleModel(CachableRed src)
This function 'fixes' the source's sample model.static boolean
is_INT_PACK_COMP(java.awt.image.SampleModel sm)
-
Methods inherited from class org.apache.xmlgraphics.image.rendered.AbstractRed
copyBand, copyToRaster, getBounds, getColorModel, getData, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo
-
-
-
-
Field Detail
-
srcIsLsRGB
boolean srcIsLsRGB
-
GAMMA
private static final double GAMMA
Exponent for linear to sRGB convertion- See Also:
- Constant Field Values
-
linearToSRGBLut
private static final int[] linearToSRGBLut
Lookup tables for RGB lookups. The linearToSRGBLut is used when noise values are considered to be on a linearScale. The linearToLinear table is used when the values are considered to be on the sRGB scale to begin with.
-
-
Constructor Detail
-
Any2sRGBRed
public Any2sRGBRed(CachableRed src)
Construct a luminace image from src.- Parameters:
src
- The image to convert to a luminance image
-
-
Method Detail
-
is_INT_PACK_COMP
public static boolean is_INT_PACK_COMP(java.awt.image.SampleModel sm)
-
applyLut_INT
public static java.awt.image.WritableRaster applyLut_INT(java.awt.image.WritableRaster wr, int[] lut)
-
copyData
public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)
-
fixColorModel
protected static java.awt.image.ColorModel fixColorModel(CachableRed src)
This function 'fixes' the source's color model. Right now it just selects if it should have one or two bands based on if the source had an alpha channel.
-
fixSampleModel
protected static java.awt.image.SampleModel fixSampleModel(CachableRed src)
This function 'fixes' the source's sample model. Right now it just selects if it should have 3 or 4 bands based on if the source had an alpha channel.
-
-