Package io.github.humbleui.skija
Class ColorInfo
- java.lang.Object
-
- io.github.humbleui.skija.ColorInfo
-
public class ColorInfo extends java.lang.ObjectDescribes pixel and encoding. ImageInfo can be created from ColorInfo by providing dimensions.
It encodes how pixel bits describe alpha, transparency; color components red, blue, and green; and ColorSpace, the range and linearity of colors.
-
-
Field Summary
Fields Modifier and Type Field Description @NotNull ColorAlphaType_alphaType@Nullable ColorSpace_colorSpace@NotNull ColorType_colorTypestatic ColorInfoDEFAULTCreates an ColorInfo withColorType.UNKNOWN,ColorAlphaType.UNKNOWN, and no ColorSpace.
-
Constructor Summary
Constructors Constructor Description ColorInfo(@NotNull ColorType colorType, @NotNull ColorAlphaType alphaType, @Nullable ColorSpace colorSpace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)@NotNull ColorAlphaTypegetAlphaType()intgetBytesPerPixel()Returns number of bytes per pixel required by ColorType.@Nullable ColorSpacegetColorSpace()@NotNull ColorTypegetColorType()intgetShiftPerPixel()Returns bit shift converting row bytes to row pixels.inthashCode()booleanisGammaCloseToSRGB()booleanisOpaque()java.lang.StringtoString()ColorInfowithAlphaType(@NotNull ColorAlphaType _alphaType)ColorInfowithColorSpace(@Nullable ColorSpace _colorSpace)ColorInfowithColorType(@NotNull ColorType _colorType)
-
-
-
Field Detail
-
_colorType
@NotNull public final @NotNull ColorType _colorType
-
_alphaType
@NotNull public final @NotNull ColorAlphaType _alphaType
-
_colorSpace
@Nullable public final @Nullable ColorSpace _colorSpace
-
DEFAULT
public static final ColorInfo DEFAULT
Creates an ColorInfo withColorType.UNKNOWN,ColorAlphaType.UNKNOWN, and no ColorSpace.
-
-
Constructor Detail
-
ColorInfo
public ColorInfo(@NotNull @NotNull ColorType colorType, @NotNull @NotNull ColorAlphaType alphaType, @Nullable @Nullable ColorSpace colorSpace)
-
-
Method Detail
-
isOpaque
public boolean isOpaque()
-
getBytesPerPixel
public int getBytesPerPixel()
Returns number of bytes per pixel required by ColorType. Returns zero if getColorType() isColorType.UNKNOWN.- Returns:
- bytes in pixel
- See Also:
- https://fiddle.skia.org/c/@ImageInfo_bytesPerPixel
-
getShiftPerPixel
public int getShiftPerPixel()
Returns bit shift converting row bytes to row pixels. Returns zero forColorType.UNKNOWN.- Returns:
- one of: 0, 1, 2, 3, 4; left shift to convert pixels to bytes
- See Also:
- https://fiddle.skia.org/c/@ImageInfo_shiftPerPixel
-
isGammaCloseToSRGB
public boolean isGammaCloseToSRGB()
-
getColorType
@NotNull public @NotNull ColorType getColorType()
-
getAlphaType
@NotNull public @NotNull ColorAlphaType getAlphaType()
-
getColorSpace
@Nullable public @Nullable ColorSpace getColorSpace()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
withColorType
public ColorInfo withColorType(@NotNull @NotNull ColorType _colorType)
- Returns:
this.
-
withAlphaType
public ColorInfo withAlphaType(@NotNull @NotNull ColorAlphaType _alphaType)
- Returns:
this.
-
withColorSpace
public ColorInfo withColorSpace(@Nullable @Nullable ColorSpace _colorSpace)
- Returns:
this.
-
-