1 /* 2 * Copyright 2016 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef SkICC_DEFINED 9 #define SkICC_DEFINED 10 11 #include "include/core/SkRefCnt.h" 12 #include "include/private/base/SkAPI.h" 13 14 #include <cstdint> 15 16 class SkData; 17 struct skcms_ICCProfile; 18 struct skcms_Matrix3x3; 19 struct skcms_TransferFunction; 20 struct skcms_CICP; 21 22 SK_API sk_sp<SkData> SkWriteICCProfile(const skcms_TransferFunction&, 23 const skcms_Matrix3x3& toXYZD50); 24 25 SK_API sk_sp<SkData> SkWriteICCProfileWithCicp(const skcms_TransferFunction&, const skcms_Matrix3x3& toXYZD50, 26 const skcms_CICP& cicp); 27 28 SK_API sk_sp<SkData> SkWriteICCProfile(const skcms_ICCProfile*, const char* description); 29 30 // Utility function for populating the grid_16 member of skcms_A2B and skcms_B2A 31 // structures. This converts a point in XYZD50 to its representation in grid_16_lab. 32 // It will write 6 bytes. The behavior of this function matches how skcms will decode 33 // values, but might not match the specification, see https://crbug.com/skia/13807. 34 SK_API void SkICCFloatXYZD50ToGrid16Lab(const float* float_xyz, uint8_t* grid16_lab); 35 36 // Utility function for popluating the table_16 member of skcms_Curve structure. 37 // This converts a float to its representation in table_16. It will write 2 bytes. 38 SK_API void SkICCFloatToTable16(const float f, uint8_t* table_16); 39 40 #endif//SkICC_DEFINED 41