org.apache.xmlgraphics.image.rendered

## Class FormatRed

- java.lang.Object
- - org.apache.xmlgraphics.image.rendered.AbstractRed
  - - org.apache.xmlgraphics.image.rendered.FormatRed

- All Implemented Interfaces:
    java.awt.image.RenderedImage, CachableRed

      public class FormatRed
      extends AbstractRed

  This allows you to specify the ColorModel, Alpha premult and/or SampleModel to be used for output. If the input image lacks Alpha and alpha is included in output then it is filled with alpha=1. In all other cases bands are simply copied.
  Version:
    $Id$ Originally authored by Thomas DeWeese.

- - ### Field Summary

    - ### 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 and Description
    `FormatRed(CachableRed cr, java.awt.image.ColorModel cm)`
    `FormatRed(CachableRed cr, java.awt.image.SampleModel sm)` Construct an instance of CachableRed around a BufferedImage.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CachableRed` | `construct(CachableRed src, java.awt.image.ColorModel cm)`
    `java.awt.image.WritableRaster` | `copyData(java.awt.image.WritableRaster wr)`
    `java.lang.Object` | `getProperty(java.lang.String name)`
    `java.lang.String[]` | `getPropertyNames()`
    `CachableRed` | `getSource()` fetch the source image for this node.
    `static java.awt.image.ColorModel` | `makeColorModel(CachableRed cr, java.awt.image.SampleModel sm)`
    `static java.awt.image.SampleModel` | `makeSampleModel(CachableRed cr, java.awt.image.ColorModel cm)`

    - ### 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, getSampleModel, getSources, getTile, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, init, init, makeTile, updateTileGridInfo`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FormatRed

          public FormatRed(CachableRed cr,
                           java.awt.image.SampleModel sm)

      Construct an instance of CachableRed around a BufferedImage.

    - #### FormatRed

          public FormatRed(CachableRed cr,
                           java.awt.image.ColorModel cm)

  - ### Method Detail

    - #### construct

          public static CachableRed construct(CachableRed src,
                                              java.awt.image.ColorModel cm)

    - #### getSource

          public CachableRed getSource()

      fetch the source image for this node.

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String name)

      Specified by:
        `getProperty` in interface `java.awt.image.RenderedImage`
      Overrides:
        `getProperty` in class `AbstractRed`

    - #### getPropertyNames

          public java.lang.String[] getPropertyNames()

      Specified by:
        `getPropertyNames` in interface `java.awt.image.RenderedImage`
      Overrides:
        `getPropertyNames` in class `AbstractRed`

    - #### copyData

          public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster wr)

    - #### makeSampleModel

          public static java.awt.image.SampleModel makeSampleModel(CachableRed cr,
                                                                   java.awt.image.ColorModel cm)

    - #### makeColorModel

          public static java.awt.image.ColorModel makeColorModel(CachableRed cr,
                                                                 java.awt.image.SampleModel sm)

Copyright 1999-2025 The Apache Software Foundation. All Rights Reserved.