skia2/third_party/skcms/skcms_internal.h
skia-autoroll d95243b55f Roll skia/third_party/skcms 2914b63d6886..68d3f3a95f1b (1 commits)
https://skia.googlesource.com/skcms.git/+log/2914b63d6886..68d3f3a95f1b

git log 2914b63d6886..68d3f3a95f1b --date=short --no-merges --format='%ad %ae %s'
2019-11-20 brianosman@google.com Add more diagnostic output to ICC profile dumps

Created with:
  gclient setdep -r skia/third_party/skcms@68d3f3a95f1b

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skcms-skia-autoroll
Please CC robertphillips@google.com,mtklein@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

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

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel

Bug: None
Change-Id: Id6161785af72c9b37680a1f264cecbb9ff4ef2ac
TBR=robertphillips@google.com,mtklein@google.com
TBR=robertphillips@google.com,mtklein@google.com
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255475
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-20 20:59:02 +00:00

57 lines
1.7 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)))
typedef struct skcms_ICCTag {
uint32_t signature;
uint32_t type;
uint32_t size;
const uint8_t* buf;
} skcms_ICCTag;
void skcms_GetTagByIndex (const skcms_ICCProfile*, uint32_t idx, skcms_ICCTag*);
bool skcms_GetTagBySignature(const skcms_ICCProfile*, uint32_t sig, skcms_ICCTag*);
float skcms_MaxRoundtripError(const skcms_Curve* curve, const skcms_TransferFunction* inv_tf);
// 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];
// ~~~~ 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);
// ~~~~ Does this pixel format need a palette pointer to be usable? ~~~~
static inline bool needs_palette(skcms_PixelFormat fmt) {
return (fmt >> 1) == (skcms_PixelFormat_RGBA_8888_Palette8 >> 1);
}
#ifdef __cplusplus
}
#endif