Flutter Engine
The Flutter Engine
Classes | Typedefs | Functions
SkJpegMetadataEncoder Namespace Reference

Classes

struct  Segment
 

Typedefs

using SegmentList = std::vector< Segment >
 

Functions

void AppendICC (SegmentList &segmentList, const SkJpegEncoder::Options &options, const SkColorSpace *colorSpace)
 
void AppendXMPStandard (SegmentList &segmentList, const SkData *xmpMetadata)
 

Typedef Documentation

◆ SegmentList

using SkJpegMetadataEncoder::SegmentList = typedef std::vector<Segment>

Definition at line 43 of file SkJpegEncoderImpl.h.

Function Documentation

◆ AppendICC()

void SkJpegMetadataEncoder::AppendICC ( SegmentList segmentList,
const SkJpegEncoder::Options options,
const SkColorSpace colorSpace 
)

Definition at line 437 of file SkJpegEncoderImpl.cpp.

439 {
440 sk_sp<SkData> icc =
441 icc_from_color_space(colorSpace, options.fICCProfile, options.fICCProfileDescription);
442 if (!icc) {
443 return;
444 }
445
446 // TODO(ccameron): This limits ICC profile size to a single segment's parameters (less than
447 // 64k). Split larger profiles into more segments.
449 s.write(kICCSig, sizeof(kICCSig));
450 s.write8(1); // This is the first marker.
451 s.write8(1); // Out of one total markers.
452 s.write(icc->data(), icc->size());
453 segmentList.emplace_back(kICCMarker, s.detachAsData());
454}
const char * options
static sk_sp< SkData > icc_from_color_space(const SkColorSpace *cs, const skcms_ICCProfile *profile, const char *profile_description)
static constexpr uint8_t kICCSig[]
static constexpr uint32_t kICCMarker
const void * data() const
Definition: SkData.h:37
size_t size() const
Definition: SkData.h:30
struct MyStruct s

◆ AppendXMPStandard()

void SkJpegMetadataEncoder::AppendXMPStandard ( SegmentList segmentList,
const SkData xmpMetadata 
)

Definition at line 456 of file SkJpegEncoderImpl.cpp.

456 {
457 if (!xmpMetadata) {
458 return;
459 }
460
461 // TODO(ccameron): Split this into a standard and extended XMP segment if needed.
463 s.write(kXMPStandardSig, sizeof(kXMPStandardSig));
464 s.write(xmpMetadata->data(), xmpMetadata->size());
465 segmentList.emplace_back(kXMPMarker, s.detachAsData());
466}
static constexpr uint32_t kXMPMarker
static constexpr uint8_t kXMPStandardSig[]