skia2/third_party/skcms/skcms_internal.h
skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com aae58023a8 Roll skia/third_party/skcms 0977edc92270..9d19e2abf000 (4 commits)
https://skia.googlesource.com/skcms.git/+log/0977edc92270..9d19e2abf000

2018-07-02 mtklein@chromium.org stop using designated initializers
2018-07-02 mtklein@chromium.org explicitly cast 16-bit constants to uint16_t
2018-07-02 mtklein@chromium.org fix typo in c++ header check
2018-07-02 mtklein@chromium.org make skcms buildable as c++


The AutoRoll server is located here: https://skcms-skia-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=ethannicholas@google.com

Change-Id: I5c9b29c5d8fcc3d8e3bf64ecd1ab24cac86b5d01
Reviewed-on: https://skia-review.googlesource.com/138954
Commit-Queue: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Reviewed-by: skcms-skia-autoroll <skcms-skia-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
2018-07-02 20:52:52 +00:00

52 lines
1.6 KiB
C

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
// skcms_internal.h contains APIs shared by skcms' internals and its test tools.
// Please don't use this header from outside the skcms repo.
#include "skcms.h"
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// ~~~~ General Helper Macros ~~~~
#define ARRAY_COUNT(arr) (int)(sizeof((arr)) / sizeof(*(arr)))
// ~~~~ skcms_TransferFunction ~~~~
float skcms_TransferFunction_eval (const skcms_TransferFunction*, float);
bool skcms_TransferFunction_invert(const skcms_TransferFunction*, skcms_TransferFunction*);
// ~~~~ skcms_ICCProfile ~~~~
bool skcms_GetCHAD(const skcms_ICCProfile* profile, skcms_Matrix3x3* m);
// 252 of a random shuffle of all possible bytes.
// 252 is evenly divisible by 3 and 4. Only 192, 10, 241, and 43 are missing.
// Used for ICC profile equivalence testing.
extern const uint8_t skcms_252_random_bytes[252];
// ~~~~ Linear Algebra ~~~~
// It is _not_ safe to alias the pointers to invert in-place.
bool skcms_Matrix3x3_invert(const skcms_Matrix3x3*, skcms_Matrix3x3*);
skcms_Matrix3x3 skcms_Matrix3x3_concat(const skcms_Matrix3x3* A, const skcms_Matrix3x3* B);
// ~~~~ Portable Math ~~~~
static inline float floorf_(float x) {
float roundtrip = (float)((int)x);
return roundtrip > x ? roundtrip - 1 : roundtrip;
}
static inline float fabsf_(float x) { return x < 0 ? -x : x; }
float powf_(float, float);
#ifdef __cplusplus
}
#endif