Enum Class PixelFormat
- All Implemented Interfaces:
Serializable, Comparable<PixelFormat>, Constable
Pixel format describing channel layout, bit depth and ordering for buffers
passed to
ColorTransform.
像素格式 — 描述传给 ColorTransform 的缓冲区通道布局、位深与顺序。
Native values are lcms2 TYPE_* bit-packed encodings extracted
directly from lcms2.h (lcms2.16). They combine COLORSPACE | EXTRA |
CHANNELS | BYTES | DOSWAP | SWAPFIRST shift macros:
原生数值为 lcms2 TYPE_* 位打包编码,直接来自 lcms2.h
(lcms2.16)。组合方式为 COLORSPACE | EXTRA | CHANNELS | BYTES | DOSWAP |
SWAPFIRST 移位宏:
TYPE_RGB_8 = 0x00040019= (PT_RGB<<16) | (3<<3) | 1TYPE_RGBA_8 = 0x00040099= (PT_RGB<<16) | (1<<7) | (3<<3) | 1TYPE_BGR_8 = 0x00040419= TYPE_RGB_8 | (1<<10)TYPE_BGRA_8 = 0x00044499= TYPE_RGBA_8 | (1<<10) | (1<<14)TYPE_GRAY_8 = 0x00030009= (PT_GRAY<<16) | (1<<3) | 1TYPE_Lab_8 = 0x000A0019= (PT_Lab<<16) | (3<<3) | 1TYPE_CMYK_8 = 0x00060021= (PT_CMYK<<16) | (4<<3) | 1
Lab 8-bit encoding: lcms2 packs 8-bit Lab as
L = L*×255/100, a = a*+128, b = b*+128 (V2 ICC
encoding). See cmspack.c Pack8bitLab.
Lab 8 位编码:lcms2 将 8 位 Lab 打包为 L = L*×255/100、
a = a*+128、b = b*+128(V2 ICC 编码)。详见 cmspack.c
的 Pack8bitLab。
- Since:
- JDK 25, opencode-base-image-codec V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription8-bit BGR, 3 bytes/pixel: B G R.8-bit BGRA, 4 bytes/pixel: B G R A.8-bit CMYK, 4 bytes/pixel: C M Y K.8-bit grayscale, 1 byte/pixel: Y.8-bit Lab, 3 bytes/pixel using V2 ICC encoding (see class doc). 8 位 Lab,3 字节/像素,V2 ICC 编码(详见类文档)。8-bit RGB, 3 bytes/pixel: R G B.8-bit RGBA, 4 bytes/pixel: R G B A. -
Method Summary
Modifier and TypeMethodDescriptionintBytes per pixel for this format.intlcms2TYPE_*value passed tocmsCreateTransform.static PixelFormatReturns the enum constant of this class with the specified name.static PixelFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RGB_8
8-bit RGB, 3 bytes/pixel: R G B. -
RGBA_8
8-bit RGBA, 4 bytes/pixel: R G B A. -
BGR_8
8-bit BGR, 3 bytes/pixel: B G R. -
BGRA_8
8-bit BGRA, 4 bytes/pixel: B G R A. -
GRAY_8
8-bit grayscale, 1 byte/pixel: Y. -
LAB_8
8-bit Lab, 3 bytes/pixel using V2 ICC encoding (see class doc). 8 位 Lab,3 字节/像素,V2 ICC 编码(详见类文档)。 -
CMYK_8
8-bit CMYK, 4 bytes/pixel: C M Y K.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
nativeValue
public int nativeValue()lcms2TYPE_*value passed tocmsCreateTransform. 传给cmsCreateTransform的 lcms2TYPE_*数值。- Returns:
- native bit-packed format value | 原生位打包格式数值
-
bytesPerPixel
public int bytesPerPixel()Bytes per pixel for this format. 该格式每像素字节数。- Returns:
- positive integer, 1..4 | 正整数,1..4
-