Flutter Engine
The Flutter Engine
SkXmp.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 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 SkXmp_DEFINED
9#define SkXmp_DEFINED
10
13
14class SkData;
15struct SkGainmapInfo;
16
17#include <cstddef>
18#include <memory>
19
20/*
21 * An interface to extract information from XMP metadata.
22 */
24public:
25 SkXmp() = default;
26 virtual ~SkXmp() = default;
27 // Make noncopyable
28 SkXmp(const SkXmp&) = delete;
29 SkXmp& operator= (const SkXmp&) = delete;
30
31 // Create from XMP data.
32 static std::unique_ptr<SkXmp> Make(sk_sp<SkData> xmpData);
33 // Create from standard XMP + extended XMP data, see XMP Specification Part 3: Storage in files,
34 // Section 1.1.3.1: Extended XMP in JPEG
35 static std::unique_ptr<SkXmp> Make(sk_sp<SkData> xmpStandard, sk_sp<SkData> xmpExtended);
36
37 // Extract HDRGM gainmap parameters.
38 // TODO(b/338342146): Remove this once all callers are removed.
39 bool getGainmapInfoHDRGM(SkGainmapInfo* info) const { return getGainmapInfoAdobe(info); }
40
41 // Extract gainmap parameters from http://ns.adobe.com/hdr-gain-map/1.0/.
42 virtual bool getGainmapInfoAdobe(SkGainmapInfo* info) const = 0;
43
44 // If the image specifies http://ns.apple.com/pixeldatainfo/1.0/ AuxiliaryImageType of
45 // urn:com:apple:photo:2020:aux:hdrgainmap, and includes a http://ns.apple.com/HDRGainMap/1.0/
46 // HDRGainMapVersion, then populate |info| with gainmap parameters that will approximate the
47 // math specified at [0] and return true.
48 // [0] https://developer.apple.com/documentation/appkit/images_and_pdf/
49 // applying_apple_hdr_effect_to_your_photos
50 virtual bool getGainmapInfoApple(float exifHdrHeadroom, SkGainmapInfo* info) const = 0;
51
52 // If this includes GContainer metadata and the GContainer contains an item with semantic
53 // GainMap and Mime of image/jpeg, then return true, and populate |offset| and |size| with
54 // that item's offset (from the end of the primary JPEG image's EndOfImage), and the size of
55 // the gainmap.
56 virtual bool getContainerGainmapLocation(size_t* offset, size_t* size) const = 0;
57
58 // Return the GUID of an Extended XMP if present, or null otherwise.
59 virtual const char* getExtendedXmpGuid() const = 0;
60};
61
62#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
#define SK_API
Definition: SkAPI.h:35
Definition: SkData.h:25
Definition: SkXmp.h:23
virtual const char * getExtendedXmpGuid() const =0
virtual ~SkXmp()=default
virtual bool getGainmapInfoApple(float exifHdrHeadroom, SkGainmapInfo *info) const =0
bool getGainmapInfoHDRGM(SkGainmapInfo *info) const
Definition: SkXmp.h:39
SkXmp()=default
virtual bool getContainerGainmapLocation(size_t *offset, size_t *size) const =0
virtual bool getGainmapInfoAdobe(SkGainmapInfo *info) const =0
SkXmp(const SkXmp &)=delete
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
SeparatedVector2 offset