Class Any2LsRGBRed

java.lang.Object
org.apache.xmlgraphics.image.rendered.AbstractRed
org.apache.xmlgraphics.image.rendered.Any2LsRGBRed
All Implemented Interfaces:
RenderedImage, CachableRed

public class Any2LsRGBRed 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 Details

    • srcIssRGB

      boolean srcIssRGB
    • GAMMA

      private static final double GAMMA
      Gamma for linear to sRGB convertion
      See Also:
    • LFACT

      private static final double LFACT
      See Also:
    • sRGBToLsRGBLut

      private static final int[] sRGBToLsRGBLut
      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 Details

    • Any2LsRGBRed

      public Any2LsRGBRed(CachableRed src)
      Construct a luminace image from src.
      Parameters:
      src - The image to convert to a luminance image
  • Method Details

    • sRGBToLsRGB

      public static final double sRGBToLsRGB(double value)
    • copyData

      public WritableRaster copyData(WritableRaster wr)
    • fixColorModel

      protected static 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 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.