Class Raster

java.lang.Object
icyllis.arc3d.sketch.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

      protected final @Nullable BufferedImage mBufImg
    • mPixmap

      protected Pixmap mPixmap
    • mPixelRef

      protected PixelRef mPixelRef
  • Constructor Details

  • Method Details

    • createRaster

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

      public int getFormat()
    • getInfo

      public @NonNull ImageInfo getInfo()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getColorType

      public int getColorType()
    • getAlphaType

      public int getAlphaType()
    • getColorSpace

      public @Nullable ColorSpace getColorSpace()
    • getPixmap

      public Pixmap getPixmap()
      Peek the current pixmap.
    • getPixelRef

      @RawPtr public @RawPtr PixelRef getPixelRef()
    • close

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