Package icyllis.arc3d.core.j2d

# Class Raster

java.lang.Object
icyllis.arc3d.core.j2d.Raster

All Implemented Interfaces:
  `AutoCloseable`

public class Raster extends Object implements AutoCloseable
`Raster` is similar to Bitmap, they are all "raster" (pixel map), but this class wraps Java2D's `Raster`. Pixels are allocated on the Java heap, and can be used with Java2D's software renderer.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static @interface`
  `Raster.Format`
  Describes the usage of Raster.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `FORMAT_GRAY_16`
  Grayscale, one channel, 16-bit per channel.
  `static final int`
  `FORMAT_GRAY_8`
  Grayscale, one channel, 8-bit per channel.
  `static final int`
  `FORMAT_RGB_565`
  RGB, three channels; red is 5 bits, green is 6 bits, blue is 5 bits.
  `static final int`
  `FORMAT_RGB_888`
  RGB, three channels, 8-bit per channel.
  `static final int`
  `FORMAT_UNKNOWN`
  `protected final BufferedImage`
  `mBufImg`
  `protected Pixels`
  `mPixels`
  `protected Pixmap`
  `mPixmap`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Raster(BufferedImage bufImg, ImageInfo info, Object data, int baseOffset, int rowBytes)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `static Raster`
  `createRaster(int width, int height, int format)`
  `int`
  `getAlphaType()`
  `ColorSpace`
  `getColorSpace()`
  `int`
  `getColorType()`
  `int`
  `getFormat()`
  `int`
  `getHeight()`
  `ImageInfo`
  `getInfo()`
  `@RawPtr Pixels`
  `getPixels()`
  `Pixmap`
  `getPixmap()`
  Peek the current pixmap.
  `int`
  `getWidth()`

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

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

- ## Field Details

  - ### FORMAT_UNKNOWN

    public static final int FORMAT_UNKNOWN
    See Also:
      - Constant Field Values

  - ### FORMAT_GRAY_8

    public static final int FORMAT_GRAY_8
    Grayscale, one channel, 8-bit per channel.
    See Also:
      - Constant Field Values

  - ### FORMAT_GRAY_16

    public static final int FORMAT_GRAY_16
    Grayscale, one channel, 16-bit per channel.

    Represented as a short on Java heap (native order).

    See Also:
      - Constant Field Values

  - ### FORMAT_RGB_565

    public static final int FORMAT_RGB_565
    RGB, three channels; red is 5 bits, green is 6 bits, blue is 5 bits.

    Represented as a short on Java heap (native order).

    To GPU: RGB_565 (R5G6B5), R is in most-significant bits.

    See Also:
      - Constant Field Values

  - ### FORMAT_RGB_888

    public static final int FORMAT_RGB_888
    RGB, three channels, 8-bit per channel.

    Represented as three bytes on Java heap.

    To GPU: BGR_888 (B8G8R8), B is in the lowest address.

    See Also:
      - Constant Field Values

  - ### mBufImg

    @Nullable protected final BufferedImage mBufImg

  - ### mPixmap

    protected Pixmap mPixmap

  - ### mPixels

    protected Pixels mPixels

- ## Constructor Details

  - ### Raster

    public Raster(@Nullable BufferedImage bufImg, @Nonnull ImageInfo info, @Nullable Object data, int baseOffset, int rowBytes)

- ## Method Details

  - ### createRaster

    @Nonnull public static Raster createRaster(@Size(min=1L) int width, @Size(min=1L) int height, int format)

  - ### getFormat

    public int getFormat()

  - ### getInfo

    @Nonnull public ImageInfo getInfo()

  - ### getWidth

    public int getWidth()

  - ### getHeight

    public int getHeight()

  - ### getColorType

    public int getColorType()

  - ### getAlphaType

    public int getAlphaType()

  - ### getColorSpace

    @Nullable public ColorSpace getColorSpace()

  - ### getPixmap

    public Pixmap getPixmap()
    Peek the current pixmap.

  - ### getPixels

    @RawPtr public @RawPtr Pixels getPixels()

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`