Flutter Engine
The Flutter Engine
third_party
skia
include
private
SkJpegMetadataDecoder.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013 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 SkJpegMetadataDecoder_DEFINED
9
#define SkJpegMetadataDecoder_DEFINED
10
11
#include "
include/core/SkData.h
"
12
#include "
include/core/SkRefCnt.h
"
13
#include "
include/core/SkTypes.h
"
14
15
#include <memory>
16
#include <vector>
17
18
struct
SkGainmapInfo
;
19
20
/**
21
* An interface that can be used to extract metadata from an encoded JPEG file.
22
*/
23
class
SK_API
SkJpegMetadataDecoder
{
24
public
:
25
SkJpegMetadataDecoder
() {}
26
virtual
~SkJpegMetadataDecoder
() {}
27
28
SkJpegMetadataDecoder
(
const
SkJpegMetadataDecoder
&) =
delete
;
29
SkJpegMetadataDecoder
&
operator=
(
const
SkJpegMetadataDecoder
&) =
delete
;
30
31
/**
32
* A segment from a JPEG file. This is usually populated from a jpeg_marker_struct.
33
*/
34
struct
SK_API
Segment
{
35
Segment
(uint8_t
marker
,
sk_sp<SkData>
data
) : fMarker(
marker
), fData(
std
::move(
data
)) {}
36
37
// The segment's marker.
38
uint8_t fMarker = 0;
39
40
// The segment's parameters (not including the marker and parameter length).
41
sk_sp<SkData>
fData
;
42
};
43
44
/**
45
* Create metadata for the specified segments from a JPEG file's header (defined as all segments
46
* before the first StartOfScan). This may return nullptr.
47
*/
48
static
std::unique_ptr<SkJpegMetadataDecoder>
Make
(std::vector<Segment> headerSegments);
49
50
/**
51
* Return the Exif data attached to the image (if any) and nullptr otherwise. If |copyData| is
52
* false, then the returned SkData may directly reference the data provided when this object was
53
* created.
54
*/
55
virtual
sk_sp<SkData>
getExifMetadata
(
bool
copyData)
const
= 0;
56
57
/**
58
* Return the ICC profile of the image if any, and nullptr otherwise. If |copyData| is false,
59
* then the returned SkData may directly reference the data provided when this object was
60
* created.
61
*/
62
virtual
sk_sp<SkData>
getICCProfileData
(
bool
copyData)
const
= 0;
63
64
/**
65
* Return the ISO 21496-1 metadata, if any, and nullptr otherwise. If |copyData| is false,
66
* then the returned SkData may directly reference the data provided when this object was
67
* created.
68
*/
69
virtual
sk_sp<SkData>
getISOGainmapMetadata
(
bool
copyData)
const
= 0;
70
71
/**
72
* Return true if there is a possibility that this image contains a gainmap image.
73
*/
74
virtual
bool
mightHaveGainmapImage
()
const
= 0;
75
76
/**
77
* Given a JPEG encoded image |baseImageData|, return in |outGainmapImageData| the JPEG encoded
78
* gainmap image and return in |outGainmapInfo| its gainmap rendering parameters. Return true if
79
* both output variables were successfully populated, otherwise return false.
80
*/
81
virtual
bool
findGainmapImage
(
sk_sp<SkData>
baseImageData,
82
sk_sp<SkData>
& outGainmapImagedata,
83
SkGainmapInfo
& outGainmapInfo) = 0;
84
};
85
86
#endif
marker
static const char marker[]
Definition:
PathOpsExtendedTest.cpp:67
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkData.h
SkRefCnt.h
SkTypes.h
SkJpegMetadataDecoder
Definition:
SkJpegMetadataDecoder.h:23
SkJpegMetadataDecoder::getISOGainmapMetadata
virtual sk_sp< SkData > getISOGainmapMetadata(bool copyData) const =0
SkJpegMetadataDecoder::SkJpegMetadataDecoder
SkJpegMetadataDecoder()
Definition:
SkJpegMetadataDecoder.h:25
SkJpegMetadataDecoder::mightHaveGainmapImage
virtual bool mightHaveGainmapImage() const =0
SkJpegMetadataDecoder::getExifMetadata
virtual sk_sp< SkData > getExifMetadata(bool copyData) const =0
SkJpegMetadataDecoder::operator=
SkJpegMetadataDecoder & operator=(const SkJpegMetadataDecoder &)=delete
SkJpegMetadataDecoder::findGainmapImage
virtual bool findGainmapImage(sk_sp< SkData > baseImageData, sk_sp< SkData > &outGainmapImagedata, SkGainmapInfo &outGainmapInfo)=0
SkJpegMetadataDecoder::~SkJpegMetadataDecoder
virtual ~SkJpegMetadataDecoder()
Definition:
SkJpegMetadataDecoder.h:26
SkJpegMetadataDecoder::getICCProfileData
virtual sk_sp< SkData > getICCProfileData(bool copyData) const =0
SkJpegMetadataDecoder::SkJpegMetadataDecoder
SkJpegMetadataDecoder(const SkJpegMetadataDecoder &)=delete
sk_sp< SkData >
SkMultiPictureDocument::Make
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Definition:
SkMultiPictureDocument.cpp:150
std
Definition:
ref_ptr.h:256
SkGainmapInfo
Definition:
SkGainmapInfo.h:43
SkJpegMetadataDecoder::Segment
Definition:
SkJpegMetadataDecoder.h:34
SkJpegMetadataDecoder::Segment::Segment
Segment(uint8_t marker, sk_sp< SkData > data)
Definition:
SkJpegMetadataDecoder.h:35
SkJpegMetadataDecoder::Segment::fData
sk_sp< SkData > fData
Definition:
SkJpegMetadataDecoder.h:41
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:03 for Flutter Engine by
1.9.4