Class PixelUtils

java.lang.Object
icyllis.arc3d.core.PixelUtils

public class PixelUtils extends Object
Utilities to access and convert pixels, heap and native.
  • Field Details

    • NATIVE_BIG_ENDIAN

      public static final boolean NATIVE_BIG_ENDIAN
    • kColorSpaceXformFlagUnpremul

      public static final int kColorSpaceXformFlagUnpremul
      See Also:
    • kColorSpaceXformFlagLinearize

      public static final int kColorSpaceXformFlagLinearize
      See Also:
    • kColorSpaceXformFlagGamutTransform

      public static final int kColorSpaceXformFlagGamutTransform
      See Also:
    • kColorSpaceXformFlagEncode

      public static final int kColorSpaceXformFlagEncode
      See Also:
    • kColorSpaceXformFlagPremul

      public static final int kColorSpaceXformFlagPremul
      See Also:
  • Constructor Details

    • PixelUtils

      public PixelUtils()
  • Method Details

    • copyImage

      public static void copyImage(long srcAddr, long srcRowBytes, long dstAddr, long dstRowBytes, long trimRowBytes, int rowCount)
      Copy memory row by row.
    • copyImage

      public static void copyImage(long srcAddr, long srcRowBytes, long dstAddr, long dstRowBytes, long trimRowBytes, int rowCount, boolean flipY)
      Copy memory row by row, allowing vertical flip.
    • copyImage

      public static void copyImage(Object srcBase, long srcAddr, long srcRowBytes, Object dstBase, long dstAddr, long dstRowBytes, long trimRowBytes, int rowCount)
      Copy memory row by row, allowing heap to off-heap copy.
    • copyImage

      public static void copyImage(Object srcBase, long srcAddr, long srcRowBytes, Object dstBase, long dstAddr, long dstRowBytes, long trimRowBytes, int rowCount, boolean flipY)
      Copy memory row by row, allowing heap to off-heap copy and vertical flip.
    • packA8ToBW

      public static void packA8ToBW(Object srcBase, long srcAddr, int srcRowBytes, Object dstBase, long dstAddr, int dstRowBytes, int width, int height)
      Pack Alpha8 format to B/W format.
    • unpackBWToA8

      public static void unpackBWToA8(Object srcBase, long srcAddr, int srcRowBytes, Object dstBase, long dstAddr, int dstRowBytes, int width, int height)
      Unpack B/W format to Alpha8 format.
    • setPixel16

      public static void setPixel16(Object base, long addr, short value, int count)
    • setPixel32

      public static void setPixel32(Object base, long addr, int value, int count)
    • setPixel64

      public static void setPixel64(Object base, long addr, long value, int count)
    • load_BGR_565

      public static int load_BGR_565(Object base, long addr)
    • load_RGBA_1010102

      public static int load_RGBA_1010102(Object base, long addr)
    • load_BGRA_1010102

      public static int load_BGRA_1010102(Object base, long addr)
    • load_R_8

      public static int load_R_8(Object base, long addr)
    • load_RG_88

      public static int load_RG_88(Object base, long addr)
    • load_RGB_888

      public static int load_RGB_888(Object base, long addr)
    • load_RGBX_8888

      public static int load_RGBX_8888(Object base, long addr)
    • load_RGBA_8888

      public static int load_RGBA_8888(Object base, long addr)
    • load_BGRA_8888

      public static int load_BGRA_8888(Object base, long addr)
    • load_ABGR_8888

      public static int load_ABGR_8888(Object base, long addr)
    • load_ARGB_8888

      public static int load_ARGB_8888(Object base, long addr)
    • load_GRAY_8

      public static int load_GRAY_8(Object base, long addr)
    • load_GRAY_ALPHA_88

      public static int load_GRAY_ALPHA_88(Object base, long addr)
    • load_ALPHA_8

      public static int load_ALPHA_8(Object base, long addr)
    • load_R_16

      public static int load_R_16(Object base, long addr)
    • load_RG_1616

      public static int load_RG_1616(Object base, long addr)
    • load_RGBA_16161616

      public static int load_RGBA_16161616(Object base, long addr)
    • load_ALPHA_16

      public static int load_ALPHA_16(Object base, long addr)
    • load_R_F16

      public static int load_R_F16(Object base, long addr)
    • load_RG_F16

      public static int load_RG_F16(Object base, long addr)
    • load_RGBA_F16

      public static int load_RGBA_F16(Object base, long addr)
    • load_ALPHA_F16

      public static int load_ALPHA_F16(Object base, long addr)
    • load_RGBA_F32

      public static int load_RGBA_F32(Object base, long addr)
    • load

      @Nonnull @Contract(pure=true) public static PixelUtils.PixelLoad load(int ct)
      Load a pixel value in low precision.
    • store_BGR_565

      public static void store_BGR_565(Object base, long addr, int src)
    • store_R_8

      public static void store_R_8(Object base, long addr, int src)
    • store_RG_88

      public static void store_RG_88(Object base, long addr, int src)
    • store_RGB_888

      public static void store_RGB_888(Object base, long addr, int src)
    • store_RGBX_8888

      public static void store_RGBX_8888(Object base, long addr, int src)
    • store_RGBA_8888

      public static void store_RGBA_8888(Object base, long addr, int src)
    • store_BGRA_8888

      public static void store_BGRA_8888(Object base, long addr, int src)
    • store_ABGR_8888

      public static void store_ABGR_8888(Object base, long addr, int src)
    • store_ARGB_8888

      public static void store_ARGB_8888(Object base, long addr, int src)
    • store_GRAY_8

      public static void store_GRAY_8(Object base, long addr, int src)
    • store_GRAY_ALPHA_88

      public static void store_GRAY_ALPHA_88(Object base, long addr, int src)
    • store_ALPHA_8

      public static void store_ALPHA_8(Object base, long addr, int src)
    • store

      @Nonnull @Contract(pure=true) public static PixelUtils.PixelStore store(int ct)
      Store a pixel value in low precision.
    • load_BGR_565

      public static void load_BGR_565(Object base, long addr, float[] dst)
    • load_RGBA_1010102

      public static void load_RGBA_1010102(Object base, long addr, float[] dst)
    • load_BGRA_1010102

      public static void load_BGRA_1010102(Object base, long addr, float[] dst)
    • load_R_8

      public static void load_R_8(Object base, long addr, float[] dst)
    • load_RG_88

      public static void load_RG_88(Object base, long addr, float[] dst)
    • load_RGB_888

      public static void load_RGB_888(Object base, long addr, float[] dst)
    • load_RGBX_8888

      public static void load_RGBX_8888(Object base, long addr, float[] dst)
    • load_RGBA_8888

      public static void load_RGBA_8888(Object base, long addr, float[] dst)
    • load_BGRA_8888

      public static void load_BGRA_8888(Object base, long addr, float[] dst)
    • load_ABGR_8888

      public static void load_ABGR_8888(Object base, long addr, float[] dst)
    • load_ARGB_8888

      public static void load_ARGB_8888(Object base, long addr, float[] dst)
    • load_GRAY_8

      public static void load_GRAY_8(Object base, long addr, float[] dst)
    • load_GRAY_ALPHA_88

      public static void load_GRAY_ALPHA_88(Object base, long addr, float[] dst)
    • load_ALPHA_8

      public static void load_ALPHA_8(Object base, long addr, float[] dst)
    • load_R_16

      public static void load_R_16(Object base, long addr, float[] dst)
    • load_RG_1616

      public static void load_RG_1616(Object base, long addr, float[] dst)
    • load_RGBA_16161616

      public static void load_RGBA_16161616(Object base, long addr, float[] dst)
    • load_ALPHA_16

      public static void load_ALPHA_16(Object base, long addr, float[] dst)
    • load_R_F16

      public static void load_R_F16(Object base, long addr, float[] dst)
    • load_RG_F16

      public static void load_RG_F16(Object base, long addr, float[] dst)
    • load_RGBA_F16

      public static void load_RGBA_F16(Object base, long addr, float[] dst)
    • load_ALPHA_F16

      public static void load_ALPHA_F16(Object base, long addr, float[] dst)
    • load_RGBA_F32

      public static void load_RGBA_F32(Object base, long addr, float[] dst)
    • loadOp

      @Nonnull @Contract(pure=true) public static PixelUtils.PixelOp loadOp(int ct)
      Load a pixel value in high precision.
    • store_BGR_565

      public static void store_BGR_565(Object base, long addr, float[] src)
    • store_RGBA_1010102

      public static void store_RGBA_1010102(Object base, long addr, float[] src)
    • store_BGRA_1010102

      public static void store_BGRA_1010102(Object base, long addr, float[] src)
    • store_R_8

      public static void store_R_8(Object base, long addr, float[] src)
    • store_RG_88

      public static void store_RG_88(Object base, long addr, float[] src)
    • store_RGB_888

      public static void store_RGB_888(Object base, long addr, float[] src)
    • store_RGBX_8888

      public static void store_RGBX_8888(Object base, long addr, float[] src)
    • store_RGBA_8888

      public static void store_RGBA_8888(Object base, long addr, float[] src)
    • store_BGRA_8888

      public static void store_BGRA_8888(Object base, long addr, float[] src)
    • store_ABGR_8888

      public static void store_ABGR_8888(Object base, long addr, float[] src)
    • store_ARGB_8888

      public static void store_ARGB_8888(Object base, long addr, float[] src)
    • store_GRAY_8

      public static void store_GRAY_8(Object base, long addr, float[] src)
    • store_GRAY_ALPHA_88

      public static void store_GRAY_ALPHA_88(Object base, long addr, float[] src)
    • store_ALPHA_8

      public static void store_ALPHA_8(Object base, long addr, float[] src)
    • store_R_16

      public static void store_R_16(Object base, long addr, float[] src)
    • store_RG_1616

      public static void store_RG_1616(Object base, long addr, float[] src)
    • store_RGBA_16161616

      public static void store_RGBA_16161616(Object base, long addr, float[] src)
    • store_ALPHA_16

      public static void store_ALPHA_16(Object base, long addr, float[] src)
    • store_R_F16

      public static void store_R_F16(Object base, long addr, float[] src)
    • store_RG_F16

      public static void store_RG_F16(Object base, long addr, float[] src)
    • store_RGBA_F16

      public static void store_RGBA_F16(Object base, long addr, float[] src)
    • store_ALPHA_F16

      public static void store_ALPHA_F16(Object base, long addr, float[] src)
    • store_RGBA_F32

      public static void store_RGBA_F32(Object base, long addr, float[] src)
    • storeOp

      @Nonnull @Contract(pure=true) public static PixelUtils.PixelOp storeOp(int ct)
      Store a pixel value in high precision.
    • convertPixels

      public static boolean convertPixels(@Nonnull Pixmap src, @Nonnull Pixmap dst)
      Performs color type, alpha type, and color space conversion. Addresses (offsets) must be aligned to bytes-per-pixel, scaling is not allowed.
    • convertPixels

      public static boolean convertPixels(@Nonnull Pixmap src, @Nonnull Pixmap dst, boolean flipY)
      Performs color type, alpha type, color space, and origin conversion. Addresses (offsets) must be aligned to bytes-per-pixel (except for non-power-of-two), scaling is not allowed.
    • convertPixels

      public static boolean convertPixels(@Nonnull ImageInfo srcInfo, Object srcBase, long srcAddr, long srcRowBytes, @Nonnull ImageInfo dstInfo, Object dstBase, long dstAddr, long dstRowBytes)
      Performs color type, alpha type, and color space conversion. Addresses (offsets) must be aligned to bytes-per-pixel, scaling is not allowed.
    • convertPixels

      public static boolean convertPixels(@Nonnull ImageInfo srcInfo, Object srcBase, long srcAddr, long srcRowBytes, @Nonnull ImageInfo dstInfo, Object dstBase, long dstAddr, long dstRowBytes, boolean flipY)
      Performs color type, alpha type, color space, and origin conversion. Addresses (offsets) must be aligned to bytes-per-pixel (except for non-power-of-two), scaling is not allowed.