Home | History | Annotate | Download | only in core

Lines Matching refs:coeffs

98 static inline bool is_valid_transfer_fn(const SkColorSpaceTransferFn& coeffs) {
99 if (SkScalarIsNaN(coeffs.fA) || SkScalarIsNaN(coeffs.fB) ||
100 SkScalarIsNaN(coeffs.fC) || SkScalarIsNaN(coeffs.fD) ||
101 SkScalarIsNaN(coeffs.fE) || SkScalarIsNaN(coeffs.fF) ||
102 SkScalarIsNaN(coeffs.fG))
107 if (!is_zero_to_one(coeffs.fD)) {
111 if (coeffs.fD == 0.0f) {
113 if (0.0f == coeffs.fA || 0.0f == coeffs.fG) {
120 if (coeffs.fD >= 1.0f) {
122 if (0.0f == coeffs.fC) {
129 if ((0.0f == coeffs.fA || 0.0f == coeffs.fG) && 0.0f == coeffs.fC) {
135 if (coeffs.fC < 0.0f) {
140 if (coeffs.fA < 0.0f || coeffs.fG < 0.0f) {
148 static inline bool is_almost_srgb(const SkColorSpaceTransferFn& coeffs) {
149 return transfer_fn_almost_equal(gSRGB_TransferFn.fA, coeffs.fA) &&
150 transfer_fn_almost_equal(gSRGB_TransferFn.fB, coeffs.fB) &&
151 transfer_fn_almost_equal(gSRGB_TransferFn.fC, coeffs.fC) &&
152 transfer_fn_almost_equal(gSRGB_TransferFn.fD, coeffs.fD) &&
153 transfer_fn_almost_equal(gSRGB_TransferFn.fE, coeffs.fE) &&
154 transfer_fn_almost_equal(gSRGB_TransferFn.fF, coeffs.fF) &&
155 transfer_fn_almost_equal(gSRGB_TransferFn.fG, coeffs.fG);
158 static inline bool is_almost_2dot2(const SkColorSpaceTransferFn& coeffs) {
159 return transfer_fn_almost_equal(1.0f, coeffs.fA) &&
160 transfer_fn_almost_equal(0.0f, coeffs.fB) &&
161 transfer_fn_almost_equal(0.0f, coeffs.fE) &&
162 transfer_fn_almost_equal(2.2f, coeffs.fG) &&
163 coeffs.fD <= 0.0f;
166 static inline bool is_almost_linear(const SkColorSpaceTransferFn& coeffs) {
169 transfer_fn_almost_equal(1.0f, coeffs.fA) &&
170 transfer_fn_almost_equal(0.0f, coeffs.fB) &&
171 transfer_fn_almost_equal(0.0f, coeffs.fE) &&
172 transfer_fn_almost_equal(1.0f, coeffs.fG) &&
173 coeffs.fD <= 0.0f;
177 transfer_fn_almost_equal(1.0f, coeffs.fC) &&
178 transfer_fn_almost_equal(0.0f, coeffs.fF) &&
179 coeffs.fD >= 1.0f;
184 static inline bool is_just_gamma(const SkColorSpaceTransferFn& coeffs) {
185 return transfer_fn_almost_equal(coeffs.fA, 1.0f)
186 && transfer_fn_almost_equal(coeffs.fB, 0.0f)
187 && transfer_fn_almost_equal(coeffs.fC, 0.0f)
188 && transfer_fn_almost_equal(coeffs.fD, 0.0f)
189 && transfer_fn_almost_equal(coeffs.fE, 0.0f)
190 && transfer_fn_almost_equal(coeffs.fF, 0.0f);
194 static inline void value_to_parametric(SkColorSpaceTransferFn* coeffs, float exponent) {
195 coeffs->fA = 1.0f;
196 coeffs->fB = 0.0f;
197 coeffs->fC = 0.0f;
198 coeffs->fD = 0.0f;
199 coeffs->fE = 0.0f;
200 coeffs->fF = 0.0f;
201 coeffs->fG = exponent;
204 static inline bool named_to_parametric(SkColorSpaceTransferFn* coeffs,
208 *coeffs = gSRGB_TransferFn;
211 *coeffs = g2Dot2_TransferFn;
214 *coeffs = gLinear_TransferFn;