Flutter Engine
The Flutter Engine
|
#include "src/skcms_public.h"
#include "src/skcms_internals.h"
#include "src/skcms_Transform.h"
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | TF_PQish |
struct | TF_HLGish |
struct | header_Layout |
struct | tag_Layout |
struct | sf32_Layout |
struct | XYZ_Layout |
struct | para_Layout |
struct | curv_Layout |
struct | mft_CommonLayout |
struct | mft1_Layout |
struct | mft2_Layout |
struct | mAB_or_mBA_Layout |
struct | CLUT_Layout |
struct | CICP_Layout |
struct | skcms_Vector3 |
struct | OpAndArg |
Enumerations | |
enum | { skcms_Signature_acsp = 0x61637370 , skcms_Signature_rTRC = 0x72545243 , skcms_Signature_gTRC = 0x67545243 , skcms_Signature_bTRC = 0x62545243 , skcms_Signature_kTRC = 0x6B545243 , skcms_Signature_rXYZ = 0x7258595A , skcms_Signature_gXYZ = 0x6758595A , skcms_Signature_bXYZ = 0x6258595A , skcms_Signature_A2B0 = 0x41324230 , skcms_Signature_B2A0 = 0x42324130 , skcms_Signature_CHAD = 0x63686164 , skcms_Signature_WTPT = 0x77747074 , skcms_Signature_CICP = 0x63696370 , skcms_Signature_curv = 0x63757276 , skcms_Signature_mft1 = 0x6D667431 , skcms_Signature_mft2 = 0x6D667432 , skcms_Signature_mAB = 0x6D414220 , skcms_Signature_mBA = 0x6D424120 , skcms_Signature_para = 0x70617261 , skcms_Signature_sf32 = 0x73663332 } |
enum class | CpuType { Baseline , HSW , SKX } |
Functions | |
void | skcms_DisableRuntimeCPUDetection () |
static float | log2f_ (float x) |
static float | logf_ (float x) |
static float | exp2f_ (float x) |
float | powf_ (float x, float y) |
static float | expf_ (float x) |
static float | fmaxf_ (float x, float y) |
static float | fminf_ (float x, float y) |
static bool | isfinitef_ (float x) |
static float | minus_1_ulp (float x) |
static float | TFKind_marker (skcms_TFType kind) |
static skcms_TFType | classify (const skcms_TransferFunction &tf, TF_PQish *pq=nullptr, TF_HLGish *hlg=nullptr) |
skcms_TFType | skcms_TransferFunction_getType (const skcms_TransferFunction *tf) |
bool | skcms_TransferFunction_isSRGBish (const skcms_TransferFunction *tf) |
bool | skcms_TransferFunction_isPQish (const skcms_TransferFunction *tf) |
bool | skcms_TransferFunction_isHLGish (const skcms_TransferFunction *tf) |
bool | skcms_TransferFunction_makePQish (skcms_TransferFunction *tf, float A, float B, float C, float D, float E, float F) |
bool | skcms_TransferFunction_makeScaledHLGish (skcms_TransferFunction *tf, float K, float R, float G, float a, float b, float c) |
float | skcms_TransferFunction_eval (const skcms_TransferFunction *tf, float x) |
static float | eval_curve (const skcms_Curve *curve, float x) |
float | skcms_MaxRoundtripError (const skcms_Curve *curve, const skcms_TransferFunction *inv_tf) |
bool | skcms_AreApproximateInverses (const skcms_Curve *curve, const skcms_TransferFunction *inv_tf) |
static uint16_t | read_big_u16 (const uint8_t *ptr) |
static uint32_t | read_big_u32 (const uint8_t *ptr) |
static int32_t | read_big_i32 (const uint8_t *ptr) |
static float | read_big_fixed (const uint8_t *ptr) |
static const tag_Layout * | get_tag_table (const skcms_ICCProfile *profile) |
bool | skcms_GetCHAD (const skcms_ICCProfile *profile, skcms_Matrix3x3 *m) |
static bool | read_tag_xyz (const skcms_ICCTag *tag, float *x, float *y, float *z) |
bool | skcms_GetWTPT (const skcms_ICCProfile *profile, float xyz[3]) |
static bool | read_to_XYZD50 (const skcms_ICCTag *rXYZ, const skcms_ICCTag *gXYZ, const skcms_ICCTag *bXYZ, skcms_Matrix3x3 *toXYZ) |
static bool | read_curve_para (const uint8_t *buf, uint32_t size, skcms_Curve *curve, uint32_t *curve_size) |
static bool | read_curve_curv (const uint8_t *buf, uint32_t size, skcms_Curve *curve, uint32_t *curve_size) |
static bool | read_curve (const uint8_t *buf, uint32_t size, skcms_Curve *curve, uint32_t *curve_size) |
static bool | read_mft_common (const mft_CommonLayout *mftTag, skcms_A2B *a2b) |
static bool | read_mft_common (const mft_CommonLayout *mftTag, skcms_B2A *b2a) |
template<typename A2B_or_B2A > | |
static bool | init_tables (const uint8_t *table_base, uint64_t max_tables_len, uint32_t byte_width, uint32_t input_table_entries, uint32_t output_table_entries, A2B_or_B2A *out) |
template<typename A2B_or_B2A > | |
static bool | read_tag_mft1 (const skcms_ICCTag *tag, A2B_or_B2A *out) |
template<typename A2B_or_B2A > | |
static bool | read_tag_mft2 (const skcms_ICCTag *tag, A2B_or_B2A *out) |
static bool | read_curves (const uint8_t *buf, uint32_t size, uint32_t curve_offset, uint32_t num_curves, skcms_Curve *curves) |
static bool | read_tag_mab (const skcms_ICCTag *tag, skcms_A2B *a2b, bool pcs_is_xyz) |
static bool | read_tag_mba (const skcms_ICCTag *tag, skcms_B2A *b2a, bool pcs_is_xyz) |
static int | fit_linear (const skcms_Curve *curve, int N, float tol, float *c, float *d, float *f=nullptr) |
static void | canonicalize_identity (skcms_Curve *curve) |
static bool | read_a2b (const skcms_ICCTag *tag, skcms_A2B *a2b, bool pcs_is_xyz) |
static bool | read_b2a (const skcms_ICCTag *tag, skcms_B2A *b2a, bool pcs_is_xyz) |
static bool | read_cicp (const skcms_ICCTag *tag, skcms_CICP *cicp) |
void | skcms_GetTagByIndex (const skcms_ICCProfile *profile, uint32_t idx, skcms_ICCTag *tag) |
bool | skcms_GetTagBySignature (const skcms_ICCProfile *profile, uint32_t sig, skcms_ICCTag *tag) |
static bool | usable_as_src (const skcms_ICCProfile *profile) |
bool | skcms_ParseWithA2BPriority (const void *buf, size_t len, const int priority[], const int priorities, skcms_ICCProfile *profile) |
const skcms_ICCProfile * | skcms_sRGB_profile () |
const skcms_ICCProfile * | skcms_XYZD50_profile () |
const skcms_TransferFunction * | skcms_sRGB_TransferFunction () |
const skcms_TransferFunction * | skcms_sRGB_Inverse_TransferFunction () |
const skcms_TransferFunction * | skcms_Identity_TransferFunction () |
bool | skcms_ApproximatelyEqualProfiles (const skcms_ICCProfile *A, const skcms_ICCProfile *B) |
bool | skcms_TRCs_AreApproximateInverse (const skcms_ICCProfile *profile, const skcms_TransferFunction *inv_tf) |
static bool | is_zero_to_one (float x) |
static skcms_Vector3 | mv_mul (const skcms_Matrix3x3 *m, const skcms_Vector3 *v) |
bool | skcms_AdaptToXYZD50 (float wx, float wy, skcms_Matrix3x3 *toXYZD50) |
bool | skcms_PrimariesToXYZD50 (float rx, float ry, float gx, float gy, float bx, float by, float wx, float wy, skcms_Matrix3x3 *toXYZD50) |
bool | skcms_Matrix3x3_invert (const skcms_Matrix3x3 *src, skcms_Matrix3x3 *dst) |
skcms_Matrix3x3 | skcms_Matrix3x3_concat (const skcms_Matrix3x3 *A, const skcms_Matrix3x3 *B) |
bool | skcms_TransferFunction_invert (const skcms_TransferFunction *src, skcms_TransferFunction *dst) |
static float | rg_nonlinear (float x, const skcms_Curve *curve, const skcms_TransferFunction *tf, float dfdP[3]) |
static bool | gauss_newton_step (const skcms_Curve *curve, skcms_TransferFunction *tf, float x0, float dx, int N) |
static float | max_roundtrip_error_checked (const skcms_Curve *curve, const skcms_TransferFunction *tf_inv) |
static bool | fit_nonlinear (const skcms_Curve *curve, int L, int N, skcms_TransferFunction *tf) |
bool | skcms_ApproximateCurve (const skcms_Curve *curve, skcms_TransferFunction *approx, float *max_error) |
static CpuType | cpu_type () |
static bool | tf_is_gamma (const skcms_TransferFunction &tf) |
static OpAndArg | select_curve_op (const skcms_Curve *curve, int channel) |
static int | select_curve_ops (const skcms_Curve *curves, int numChannels, OpAndArg *ops) |
static size_t | bytes_per_pixel (skcms_PixelFormat fmt) |
static bool | prep_for_destination (const skcms_ICCProfile *profile, skcms_Matrix3x3 *fromXYZD50, skcms_TransferFunction *invR, skcms_TransferFunction *invG, skcms_TransferFunction *invB) |
bool | skcms_Transform (const void *src, skcms_PixelFormat srcFmt, skcms_AlphaFormat srcAlpha, const skcms_ICCProfile *srcProfile, void *dst, skcms_PixelFormat dstFmt, skcms_AlphaFormat dstAlpha, const skcms_ICCProfile *dstProfile, size_t nz) |
static void | assert_usable_as_destination (const skcms_ICCProfile *profile) |
bool | skcms_MakeUsableAsDestination (skcms_ICCProfile *profile) |
bool | skcms_MakeUsableAsDestinationWithSingleCurve (skcms_ICCProfile *profile) |
Variables | |
static bool | sAllowRuntimeCPUDetection = true |
const uint8_t | skcms_252_random_bytes [] |
anonymous enum |
Definition at line 290 of file skcms.cc.
|
strong |
|
static |
Definition at line 2811 of file skcms.cc.
|
static |
Definition at line 2449 of file skcms.cc.
|
static |
Definition at line 1122 of file skcms.cc.
|
static |
Definition at line 135 of file skcms.cc.
|
static |
Definition at line 2302 of file skcms.cc.
|
static |
Definition at line 247 of file skcms.cc.
|
static |
Definition at line 65 of file skcms.cc.
|
static |
|
static |
Definition at line 1069 of file skcms.cc.
|
static |
Definition at line 2140 of file skcms.cc.
|
static |
|
static |
|
static |
Definition at line 2043 of file skcms.cc.
|
static |
|
static |
Definition at line 674 of file skcms.cc.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2124 of file skcms.cc.
|
static |
|
static |
float powf_ | ( | float | x, |
float | y | ||
) |
|
static |
Definition at line 2476 of file skcms.cc.
|
static |
Definition at line 1138 of file skcms.cc.
|
static |
Definition at line 1163 of file skcms.cc.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 578 of file skcms.cc.
|
static |
Definition at line 535 of file skcms.cc.
|
static |
Definition at line 459 of file skcms.cc.
|
static |
Definition at line 770 of file skcms.cc.
|
static |
Definition at line 619 of file skcms.cc.
|
static |
Definition at line 648 of file skcms.cc.
|
static |
Definition at line 818 of file skcms.cc.
|
static |
Definition at line 945 of file skcms.cc.
|
static |
Definition at line 729 of file skcms.cc.
|
static |
Definition at line 747 of file skcms.cc.
|
static |
|
static |
Definition at line 444 of file skcms.cc.
|
static |
|
static |
Definition at line 2372 of file skcms.cc.
|
static |
Definition at line 2405 of file skcms.cc.
bool skcms_AdaptToXYZD50 | ( | float | wx, |
float | wy, | ||
skcms_Matrix3x3 * | toXYZD50 | ||
) |
Definition at line 1706 of file skcms.cc.
bool skcms_ApproximateCurve | ( | const skcms_Curve * | curve, |
skcms_TransferFunction * | approx, | ||
float * | max_error | ||
) |
Definition at line 2199 of file skcms.cc.
bool skcms_ApproximatelyEqualProfiles | ( | const skcms_ICCProfile * | A, |
const skcms_ICCProfile * | B | ||
) |
Definition at line 1621 of file skcms.cc.
bool skcms_AreApproximateInverses | ( | const skcms_Curve * | curve, |
const skcms_TransferFunction * | inv_tf | ||
) |
void skcms_DisableRuntimeCPUDetection | ( | void | ) |
bool skcms_GetCHAD | ( | const skcms_ICCProfile * | profile, |
skcms_Matrix3x3 * | m | ||
) |
Definition at line 396 of file skcms.cc.
void skcms_GetTagByIndex | ( | const skcms_ICCProfile * | profile, |
uint32_t | idx, | ||
skcms_ICCTag * | tag | ||
) |
Definition at line 1211 of file skcms.cc.
bool skcms_GetTagBySignature | ( | const skcms_ICCProfile * | profile, |
uint32_t | sig, | ||
skcms_ICCTag * | tag | ||
) |
bool skcms_GetWTPT | ( | const skcms_ICCProfile * | profile, |
float | xyz[3] | ||
) |
const skcms_TransferFunction * skcms_Identity_TransferFunction | ( | void | ) |
bool skcms_MakeUsableAsDestination | ( | skcms_ICCProfile * | profile | ) |
Definition at line 2821 of file skcms.cc.
bool skcms_MakeUsableAsDestinationWithSingleCurve | ( | skcms_ICCProfile * | profile | ) |
Definition at line 2854 of file skcms.cc.
skcms_Matrix3x3 skcms_Matrix3x3_concat | ( | const skcms_Matrix3x3 * | A, |
const skcms_Matrix3x3 * | B | ||
) |
bool skcms_Matrix3x3_invert | ( | const skcms_Matrix3x3 * | src, |
skcms_Matrix3x3 * | dst | ||
) |
Definition at line 1792 of file skcms.cc.
float skcms_MaxRoundtripError | ( | const skcms_Curve * | curve, |
const skcms_TransferFunction * | inv_tf | ||
) |
bool skcms_ParseWithA2BPriority | ( | const void * | buf, |
size_t | len, | ||
const int | priority[], | ||
const int | priorities, | ||
skcms_ICCProfile * | profile | ||
) |
Definition at line 1241 of file skcms.cc.
bool skcms_PrimariesToXYZD50 | ( | float | rx, |
float | ry, | ||
float | gx, | ||
float | gy, | ||
float | bx, | ||
float | by, | ||
float | wx, | ||
float | wy, | ||
skcms_Matrix3x3 * | toXYZD50 | ||
) |
Definition at line 1747 of file skcms.cc.
const skcms_TransferFunction * skcms_sRGB_Inverse_TransferFunction | ( | void | ) |
const skcms_ICCProfile * skcms_sRGB_profile | ( | void | ) |
Definition at line 1393 of file skcms.cc.
const skcms_TransferFunction * skcms_sRGB_TransferFunction | ( | void | ) |
float skcms_TransferFunction_eval | ( | const skcms_TransferFunction * | tf, |
float | x | ||
) |
Definition at line 212 of file skcms.cc.
skcms_TFType skcms_TransferFunction_getType | ( | const skcms_TransferFunction * | tf | ) |
bool skcms_TransferFunction_invert | ( | const skcms_TransferFunction * | src, |
skcms_TransferFunction * | dst | ||
) |
Definition at line 1863 of file skcms.cc.
bool skcms_TransferFunction_isHLGish | ( | const skcms_TransferFunction * | tf | ) |
bool skcms_TransferFunction_isPQish | ( | const skcms_TransferFunction * | tf | ) |
bool skcms_TransferFunction_isSRGBish | ( | const skcms_TransferFunction * | tf | ) |
bool skcms_TransferFunction_makePQish | ( | skcms_TransferFunction * | tf, |
float | A, | ||
float | B, | ||
float | C, | ||
float | D, | ||
float | E, | ||
float | F | ||
) |
Definition at line 196 of file skcms.cc.
bool skcms_TransferFunction_makeScaledHLGish | ( | skcms_TransferFunction * | tf, |
float | K, | ||
float | R, | ||
float | G, | ||
float | a, | ||
float | b, | ||
float | c | ||
) |
Definition at line 204 of file skcms.cc.
bool skcms_Transform | ( | const void * | src, |
skcms_PixelFormat | srcFmt, | ||
skcms_AlphaFormat | srcAlpha, | ||
const skcms_ICCProfile * | srcProfile, | ||
void * | dst, | ||
skcms_PixelFormat | dstFmt, | ||
skcms_AlphaFormat | dstAlpha, | ||
const skcms_ICCProfile * | dstProfile, | ||
size_t | nz | ||
) |
Definition at line 2495 of file skcms.cc.
bool skcms_TRCs_AreApproximateInverse | ( | const skcms_ICCProfile * | profile, |
const skcms_TransferFunction * | inv_tf | ||
) |
Definition at line 1679 of file skcms.cc.
const skcms_ICCProfile * skcms_XYZD50_profile | ( | void | ) |
Definition at line 1490 of file skcms.cc.
|
static |
|
static |
|
static |
const uint8_t skcms_252_random_bytes[] |