#include "include/encode/SkICC.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkData.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkFloatingPoint.h"
#include "modules/skcms/skcms.h"
#include "src/base/SkAutoMalloc.h"
#include "src/base/SkEndian.h"
#include "src/core/SkMD5.h"
#include "src/core/SkStreamPriv.h"
#include "src/encode/SkICCPriv.h"
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <utility>
#include <vector>
namespace {
constexpr size_t kNumChannels = …;
constexpr float kD50_x = …;
constexpr float kD50_y = …;
constexpr float kD50_z = …;
SkFixed float_round_to_fixed(float x) { … }
uint16_t float_to_uInt16Number(float x, uint16_t one) { … }
constexpr uint16_t kOne16CurveType = …;
constexpr uint16_t kOne16XYZ = …;
struct ICCHeader { … };
sk_sp<SkData> write_xyz_tag(float x, float y, float z) { … }
sk_sp<SkData> write_matrix(const skcms_Matrix3x4* matrix) { … }
bool nearly_equal(float x, float y) { … }
bool nearly_equal(const skcms_TransferFunction& u,
const skcms_TransferFunction& v) { … }
bool nearly_equal(const skcms_Matrix3x3& u, const skcms_Matrix3x3& v) { … }
constexpr uint32_t kCICPPrimariesSRGB = …;
constexpr uint32_t kCICPPrimariesP3 = …;
constexpr uint32_t kCICPPrimariesRec2020 = …;
uint32_t get_cicp_primaries(const skcms_Matrix3x3& toXYZD50) { … }
constexpr uint32_t kCICPTrfnSRGB = …;
constexpr uint32_t kCICPTrfn2Dot2 = …;
constexpr uint32_t kCICPTrfnLinear = …;
constexpr uint32_t kCICPTrfnPQ = …;
constexpr uint32_t kCICPTrfnHLG = …;
uint32_t get_cicp_trfn(const skcms_TransferFunction& fn) { … }
std::string get_desc_string(const skcms_TransferFunction& fn,
const skcms_Matrix3x3& toXYZD50) { … }
sk_sp<SkData> write_text_tag(const char* text) { … }
sk_sp<SkData> write_cicp_tag(const skcms_CICP& cicp) { … }
constexpr float kToneMapInputMax = …;
constexpr float kToneMapOutputMax = …;
float tone_map_gain(float x) { … }
float tone_map_inverse(float y) { … }
float hdr_trfn_eval(const skcms_TransferFunction& fn, float x) { … }
sk_sp<SkData> write_trc_tag(const skcms_Curve& trc) { … }
sk_sp<SkData> write_clut(const uint8_t* grid_points, const uint8_t* grid_16) { … }
sk_sp<SkData> write_mAB_or_mBA_tag(uint32_t type,
const skcms_Curve* b_curves,
const skcms_Curve* a_curves,
const uint8_t* grid_points,
const uint8_t* grid_16,
const skcms_Curve* m_curves,
const skcms_Matrix3x4* matrix) { … }
}
sk_sp<SkData> SkWriteICCProfile(const skcms_ICCProfile* profile, const char* desc) { … }
sk_sp<SkData> SkWriteICCProfile(const skcms_TransferFunction& fn, const skcms_Matrix3x3& toXYZD50) { … }