Package io.github.humbleui.skija
Enum ColorType
- java.lang.Object
-
- java.lang.Enum<ColorType>
-
- io.github.humbleui.skija.ColorType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description A16_FLOATPixel with a half float for alphaA16_UNORMPixel with a little endian uint16_t for alphaALPHA_8Pixel with alpha in 8-bit byteARGB_4444Pixel with 4 bits for alpha, red, green, blue; in 16-bit wordBGR_101010XPixel with 10 bits each for blue, green, red; in 32-bit wordBGRA_101010210 bits for blue, green, red; 2 bits for alpha; in 32-bit wordBGRA_8888Pixel with 8 bits for blue, green, red, alpha; in 32-bit wordGRAY_8Pixel with grayscale level in 8-bit byteR16G16_FLOATPixel with a half float for red and greenR16G16_UNORMPixel with a little endian uint16_t for red and greenR16G16B16A16_UNORMPixel with a little endian uint16_t for red, green, blue, and alphaR8G8_UNORMPixel with a uint8_t for red and greenRGB_101010XPixel with 10 bits each for red, green, blue; in 32-bit wordRGB_565Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit wordRGB_888XPixel with 8 bits each for red, green, blue; in 32-bit wordRGBA_101010210 bits for red, green, blue; 2 bits for alpha; in 32-bit wordRGBA_8888Pixel with 8 bits for red, green, blue, alpha; in 32-bit wordRGBA_F16Pixel with half floats for red, green, blue, alpha; in 64-bit wordRGBA_F16NORMPixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit wordRGBA_F32Pixel using C float for red, green, blue, alpha; in 128-bit wordUNKNOWNUninitialized
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean_nIsAlwaysOpaque(int value)longcomputeOffset(int x, int y, long rowBytes)floatgetA(byte color)floatgetA(int color)floatgetA(short color)floatgetB(byte color)floatgetB(int color)floatgetB(short color)intgetBytesPerPixel()Returns the number of bytes required to store a pixel, including unused padding.floatgetG(byte color)floatgetG(int color)floatgetG(short color)floatgetR(byte color)floatgetR(int color)floatgetR(short color)intgetShiftPerPixel()booleanisAlwaysOpaque()Returns true if ColorType always decodes alpha to 1.0, making the pixel fully opaque.@Nullable ColorAlphaTypevalidateAlphaType(ColorAlphaType alphaType)Returns a valid ColorAlphaType for colorType.static ColorTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ColorType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final ColorType UNKNOWN
Uninitialized
-
ALPHA_8
public static final ColorType ALPHA_8
Pixel with alpha in 8-bit byte
-
RGB_565
public static final ColorType RGB_565
Pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
-
ARGB_4444
public static final ColorType ARGB_4444
Pixel with 4 bits for alpha, red, green, blue; in 16-bit word
-
RGBA_8888
public static final ColorType RGBA_8888
Pixel with 8 bits for red, green, blue, alpha; in 32-bit word
-
RGB_888X
public static final ColorType RGB_888X
Pixel with 8 bits each for red, green, blue; in 32-bit word
-
BGRA_8888
public static final ColorType BGRA_8888
Pixel with 8 bits for blue, green, red, alpha; in 32-bit word
-
RGBA_1010102
public static final ColorType RGBA_1010102
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
-
BGRA_1010102
public static final ColorType BGRA_1010102
10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
-
RGB_101010X
public static final ColorType RGB_101010X
Pixel with 10 bits each for red, green, blue; in 32-bit word
-
BGR_101010X
public static final ColorType BGR_101010X
Pixel with 10 bits each for blue, green, red; in 32-bit word
-
GRAY_8
public static final ColorType GRAY_8
Pixel with grayscale level in 8-bit byte
-
RGBA_F16NORM
public static final ColorType RGBA_F16NORM
Pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
-
RGBA_F16
public static final ColorType RGBA_F16
Pixel with half floats for red, green, blue, alpha; in 64-bit word
-
RGBA_F32
public static final ColorType RGBA_F32
Pixel using C float for red, green, blue, alpha; in 128-bit word
-
R8G8_UNORM
public static final ColorType R8G8_UNORM
Pixel with a uint8_t for red and green
-
A16_FLOAT
public static final ColorType A16_FLOAT
Pixel with a half float for alpha
-
R16G16_FLOAT
public static final ColorType R16G16_FLOAT
Pixel with a half float for red and green
-
A16_UNORM
public static final ColorType A16_UNORM
Pixel with a little endian uint16_t for alpha
-
R16G16_UNORM
public static final ColorType R16G16_UNORM
Pixel with a little endian uint16_t for red and green
-
R16G16B16A16_UNORM
public static final ColorType R16G16B16A16_UNORM
Pixel with a little endian uint16_t for red, green, blue, and alpha
-
-
Method Detail
-
values
public static ColorType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ColorType c : ColorType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ColorType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getBytesPerPixel
public int getBytesPerPixel()
Returns the number of bytes required to store a pixel, including unused padding. Returns zero forUNKNOWN.- Returns:
- bytes per pixel
-
getShiftPerPixel
public int getShiftPerPixel()
-
isAlwaysOpaque
public boolean isAlwaysOpaque()
Returns true if ColorType always decodes alpha to 1.0, making the pixel fully opaque. If true, ColorType does not reserve bits to encode alpha.- Returns:
- true if alpha is always set to 1.0
-
validateAlphaType
@Nullable public @Nullable ColorAlphaType validateAlphaType(ColorAlphaType alphaType)
Returns a valid ColorAlphaType for colorType. If there is more than one valid canonical ColorAlphaType, set to alphaType, if valid.
Returns null only if alphaType is
ColorAlphaType.UNKNOWN, color type is notUNKNOWN, and ColorType is not always opaque.- Returns:
- ColorAlphaType if can be associated with colorType
-
computeOffset
public long computeOffset(int x, int y, long rowBytes)
-
getR
public float getR(byte color)
-
getR
public float getR(short color)
-
getR
public float getR(int color)
-
getG
public float getG(byte color)
-
getG
public float getG(short color)
-
getG
public float getG(int color)
-
getB
public float getB(byte color)
-
getB
public float getB(short color)
-
getB
public float getB(int color)
-
getA
public float getA(byte color)
-
getA
public float getA(short color)
-
getA
public float getA(int color)
-
_nIsAlwaysOpaque
@Internal public static boolean _nIsAlwaysOpaque(int value)
-
-