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.
  • Field Details

    • FORMAT_UNKNOWN

      public static final int FORMAT_UNKNOWN
      See Also:
    • FORMAT_GRAY_8

      public static final int FORMAT_GRAY_8
      Grayscale, one channel, 8-bit per channel.
      See Also:
    • 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:
    • 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:
    • 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:
    • mBufImg

      @Nullable protected final BufferedImage mBufImg
    • mPixmap

      protected Pixmap mPixmap
    • mPixels

      protected Pixels mPixels
  • Constructor Details

  • 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