MCPcopy Create free account
hub / github.com/Tencent/tgfx / ExtractICCProfile

Function ExtractICCProfile

src/core/codecs/jpeg/JpegCodec.cpp:113–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool ExtractICCProfile(jpeg_decompress_struct* cinfo, std::vector<uint8_t>& iccProfileData) {
114 jpeg_saved_marker_ptr marker = cinfo->marker_list;
115 while (marker) {
116 if (marker->marker == JPEG_APP0 + 2 && marker->data_length > 14 &&
117 std::memcmp(marker->data, "ICC_PROFILE", 12) == 0) {
118 iccProfileData.insert(iccProfileData.end(), marker->data + 14,
119 marker->data + marker->data_length);
120 }
121 marker = marker->next;
122 }
123 return !iccProfileData.empty();
124}
125
126bool ParseICCProfile(const std::vector<uint8_t>& iccProfileData, gfx::skcms_ICCProfile* profile) {
127 return skcms_Parse(iccProfileData.data(), iccProfileData.size(), profile);

Callers 1

readScaledPixelsMethod · 0.85

Calls 3

insertMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected