Package icyllis.arc3d.core
Class PixelUtils
java.lang.Object
icyllis.arc3d.core.PixelUtils
Utilities to access and convert pixels, heap and native.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Load pixel value in low precision.static interface
Load or store pixel value in high precision.static interface
Store pixel value in low precision. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
convertPixels
(ImageInfo srcInfo, Object srcBase, long srcAddr, long srcRowBytes, ImageInfo dstInfo, Object dstBase, long dstAddr, long dstRowBytes) Performs color type, alpha type, and color space conversion.static boolean
convertPixels
(ImageInfo srcInfo, Object srcBase, long srcAddr, long srcRowBytes, ImageInfo dstInfo, Object dstBase, long dstAddr, long dstRowBytes, boolean flipY) Performs color type, alpha type, color space, and origin conversion.static boolean
convertPixels
(Pixmap src, Pixmap dst) Performs color type, alpha type, and color space conversion.static boolean
convertPixels
(Pixmap src, Pixmap dst, boolean flipY) Performs color type, alpha type, color space, and origin conversion.static void
copyImage
(long srcAddr, long srcRowBytes, long dstAddr, long dstRowBytes, long trimRowBytes, int rowCount) Copy memory row by row.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.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.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.static PixelUtils.PixelLoad
load
(int ct) Load a pixel value in low precision.static int
load_ABGR_8888
(Object base, long addr) static void
load_ABGR_8888
(Object base, long addr, float[] dst) static int
load_ALPHA_16
(Object base, long addr) static void
load_ALPHA_16
(Object base, long addr, float[] dst) static int
load_ALPHA_8
(Object base, long addr) static void
load_ALPHA_8
(Object base, long addr, float[] dst) static int
load_ALPHA_F16
(Object base, long addr) static void
load_ALPHA_F16
(Object base, long addr, float[] dst) static int
load_ARGB_8888
(Object base, long addr) static void
load_ARGB_8888
(Object base, long addr, float[] dst) static int
load_BGR_565
(Object base, long addr) static void
load_BGR_565
(Object base, long addr, float[] dst) static int
load_BGRA_1010102
(Object base, long addr) static void
load_BGRA_1010102
(Object base, long addr, float[] dst) static int
load_BGRA_8888
(Object base, long addr) static void
load_BGRA_8888
(Object base, long addr, float[] dst) static int
load_GRAY_8
(Object base, long addr) static void
load_GRAY_8
(Object base, long addr, float[] dst) static int
load_GRAY_ALPHA_88
(Object base, long addr) static void
load_GRAY_ALPHA_88
(Object base, long addr, float[] dst) static int
static void
static int
static void
static int
load_R_F16
(Object base, long addr) static void
load_R_F16
(Object base, long addr, float[] dst) static int
load_RG_1616
(Object base, long addr) static void
load_RG_1616
(Object base, long addr, float[] dst) static int
load_RG_88
(Object base, long addr) static void
load_RG_88
(Object base, long addr, float[] dst) static int
load_RG_F16
(Object base, long addr) static void
load_RG_F16
(Object base, long addr, float[] dst) static int
load_RGB_888
(Object base, long addr) static void
load_RGB_888
(Object base, long addr, float[] dst) static int
load_RGBA_1010102
(Object base, long addr) static void
load_RGBA_1010102
(Object base, long addr, float[] dst) static int
load_RGBA_16161616
(Object base, long addr) static void
load_RGBA_16161616
(Object base, long addr, float[] dst) static int
load_RGBA_8888
(Object base, long addr) static void
load_RGBA_8888
(Object base, long addr, float[] dst) static int
load_RGBA_F16
(Object base, long addr) static void
load_RGBA_F16
(Object base, long addr, float[] dst) static int
load_RGBA_F32
(Object base, long addr) static void
load_RGBA_F32
(Object base, long addr, float[] dst) static int
load_RGBX_8888
(Object base, long addr) static void
load_RGBX_8888
(Object base, long addr, float[] dst) static PixelUtils.PixelOp
loadOp
(int ct) Load a pixel value in high precision.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.static void
setPixel16
(Object base, long addr, short value, int count) static void
setPixel32
(Object base, long addr, int value, int count) static void
setPixel64
(Object base, long addr, long value, int count) static PixelUtils.PixelStore
store
(int ct) Store a pixel value in low precision.static void
store_ABGR_8888
(Object base, long addr, float[] src) static void
store_ABGR_8888
(Object base, long addr, int src) static void
store_ALPHA_16
(Object base, long addr, float[] src) static void
store_ALPHA_8
(Object base, long addr, float[] src) static void
store_ALPHA_8
(Object base, long addr, int src) static void
store_ALPHA_F16
(Object base, long addr, float[] src) static void
store_ARGB_8888
(Object base, long addr, float[] src) static void
store_ARGB_8888
(Object base, long addr, int src) static void
store_BGR_565
(Object base, long addr, float[] src) static void
store_BGR_565
(Object base, long addr, int src) static void
store_BGRA_1010102
(Object base, long addr, float[] src) static void
store_BGRA_8888
(Object base, long addr, float[] src) static void
store_BGRA_8888
(Object base, long addr, int src) static void
store_GRAY_8
(Object base, long addr, float[] src) static void
store_GRAY_8
(Object base, long addr, int src) static void
store_GRAY_ALPHA_88
(Object base, long addr, float[] src) static void
store_GRAY_ALPHA_88
(Object base, long addr, int src) static void
store_R_16
(Object base, long addr, float[] src) static void
static void
static void
store_R_F16
(Object base, long addr, float[] src) static void
store_RG_1616
(Object base, long addr, float[] src) static void
store_RG_88
(Object base, long addr, float[] src) static void
store_RG_88
(Object base, long addr, int src) static void
store_RG_F16
(Object base, long addr, float[] src) static void
store_RGB_888
(Object base, long addr, float[] src) static void
store_RGB_888
(Object base, long addr, int src) static void
store_RGBA_1010102
(Object base, long addr, float[] src) static void
store_RGBA_16161616
(Object base, long addr, float[] src) static void
store_RGBA_8888
(Object base, long addr, float[] src) static void
store_RGBA_8888
(Object base, long addr, int src) static void
store_RGBA_F16
(Object base, long addr, float[] src) static void
store_RGBA_F32
(Object base, long addr, float[] src) static void
store_RGBX_8888
(Object base, long addr, float[] src) static void
store_RGBX_8888
(Object base, long addr, int src) static PixelUtils.PixelOp
storeOp
(int ct) Store a pixel value in high precision.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.
-
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
-
setPixel32
-
setPixel64
-
load_BGR_565
-
load_RGBA_1010102
-
load_BGRA_1010102
-
load_R_8
-
load_RG_88
-
load_RGB_888
-
load_RGBX_8888
-
load_RGBA_8888
-
load_BGRA_8888
-
load_ABGR_8888
-
load_ARGB_8888
-
load_GRAY_8
-
load_GRAY_ALPHA_88
-
load_ALPHA_8
-
load_R_16
-
load_RG_1616
-
load_RGBA_16161616
-
load_ALPHA_16
-
load_R_F16
-
load_RG_F16
-
load_RGBA_F16
-
load_ALPHA_F16
-
load_RGBA_F32
-
load
Load a pixel value in low precision. -
store_BGR_565
-
store_R_8
-
store_RG_88
-
store_RGB_888
-
store_RGBX_8888
-
store_RGBA_8888
-
store_BGRA_8888
-
store_ABGR_8888
-
store_ARGB_8888
-
store_GRAY_8
-
store_GRAY_ALPHA_88
-
store_ALPHA_8
-
store
Store a pixel value in low precision. -
load_BGR_565
-
load_RGBA_1010102
-
load_BGRA_1010102
-
load_R_8
-
load_RG_88
-
load_RGB_888
-
load_RGBX_8888
-
load_RGBA_8888
-
load_BGRA_8888
-
load_ABGR_8888
-
load_ARGB_8888
-
load_GRAY_8
-
load_GRAY_ALPHA_88
-
load_ALPHA_8
-
load_R_16
-
load_RG_1616
-
load_RGBA_16161616
-
load_ALPHA_16
-
load_R_F16
-
load_RG_F16
-
load_RGBA_F16
-
load_ALPHA_F16
-
load_RGBA_F32
-
loadOp
Load a pixel value in high precision. -
store_BGR_565
-
store_RGBA_1010102
-
store_BGRA_1010102
-
store_R_8
-
store_RG_88
-
store_RGB_888
-
store_RGBX_8888
-
store_RGBA_8888
-
store_BGRA_8888
-
store_ABGR_8888
-
store_ARGB_8888
-
store_GRAY_8
-
store_GRAY_ALPHA_88
-
store_ALPHA_8
-
store_R_16
-
store_RG_1616
-
store_RGBA_16161616
-
store_ALPHA_16
-
store_R_F16
-
store_RG_F16
-
store_RGBA_F16
-
store_ALPHA_F16
-
store_RGBA_F32
-
storeOp
Store a pixel value in high precision. -
convertPixels
Performs color type, alpha type, and color space conversion. Addresses (offsets) must be aligned to bytes-per-pixel, scaling is not allowed. -
convertPixels
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.
-