Package io.github.humbleui.skija
Class ColorSpace
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.ColorSpace
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ColorSpace extends Managed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColorSpace._DisplayP3Holderstatic classColorSpace._FinalizerHolderstatic classColorSpace._SRGBHolderstatic classColorSpace._SRGBLinearHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Constructor Summary
Constructors Constructor Description ColorSpace(long ptr)ColorSpace(long ptr, boolean managed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static float[]_nConvert(long fromPtr, long toPtr, float r, float g, float b, float a)static long_nGetFinalizer()static boolean_nIsGammaCloseToSRGB(long ptr)static boolean_nIsGammaLinear(long ptr)static boolean_nIsSRGB(long ptr)static long_nMakeDisplayP3()static long_nMakeSRGB()static long_nMakeSRGBLinear()Color4fconvert(ColorSpace to, Color4f color)static ColorSpacegetDisplayP3()static ColorSpacegetSRGB()static ColorSpacegetSRGBLinear()booleanisGammaCloseToSRGB()booleanisGammaLinear()booleanisSRGB()Returns true if the color space is sRGB.-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
-
-
-
Method Detail
-
getSRGB
public static ColorSpace getSRGB()
-
getSRGBLinear
public static ColorSpace getSRGBLinear()
-
getDisplayP3
public static ColorSpace getDisplayP3()
-
convert
public Color4f convert(ColorSpace to, Color4f color)
-
isGammaCloseToSRGB
public boolean isGammaCloseToSRGB()
- Returns:
- true if the color space gamma is near enough to be approximated as sRGB
-
isGammaLinear
public boolean isGammaLinear()
- Returns:
- true if the color space gamma is linear
-
isSRGB
public boolean isSRGB()
Returns true if the color space is sRGB. Returns false otherwise.
This allows a little bit of tolerance, given that we might see small numerical error in some cases: converting ICC fixed point to float, converting white point to D50, rounding decisions on transfer function and matrix.
This does not consider a 2.2f exponential transfer function to be sRGB. While these functions are similar (and it is sometimes useful to consider them together), this function checks for logical equality.
-
_nGetFinalizer
public static long _nGetFinalizer()
-
_nMakeSRGB
public static long _nMakeSRGB()
-
_nMakeDisplayP3
public static long _nMakeDisplayP3()
-
_nMakeSRGBLinear
public static long _nMakeSRGBLinear()
-
_nConvert
public static float[] _nConvert(long fromPtr, long toPtr, float r, float g, float b, float a)
-
_nIsGammaCloseToSRGB
public static boolean _nIsGammaCloseToSRGB(long ptr)
-
_nIsGammaLinear
public static boolean _nIsGammaLinear(long ptr)
-
_nIsSRGB
public static boolean _nIsSRGB(long ptr)
-
-