Flutter Engine
The Flutter Engine
third_party
skia
include
android
SkHeifDecoder.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
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
#ifndef SkHeifDecoder_DEFINED
8
#define SkHeifDecoder_DEFINED
9
10
#include "
include/codec/SkCodec.h
"
11
#include "
include/core/SkRefCnt.h
"
12
13
class
SkData
;
14
class
SkStream
;
15
16
#include <memory>
17
18
// This codec depends on heif libraries that are only part of the Android framework.
19
// It will not work on other platforms currently.
20
//
21
// For historical reasons, this codec also decodes AVIF images.
22
// There is a newer, dedicated SkAvifDecoder which could be used instead.
23
namespace
SkHeifDecoder
{
24
25
/** Returns true if this data claims to be a HEIF (or AVIF) image. */
26
SK_API
bool
IsHeif
(
const
void
*,
size_t
);
27
28
/**
29
* Attempts to decode the given bytes as a HEIF (or AVIF).
30
*
31
* If the bytes are not a HEIF (or AVIF), returns nullptr.
32
*
33
* DecodeContext is treated as a SkCodec::SelectionPolicy*
34
*/
35
SK_API
std::unique_ptr<SkCodec>
Decode
(std::unique_ptr<SkStream>,
36
SkCodec::Result
*,
37
SkCodecs::DecodeContext
=
nullptr
);
38
SK_API
std::unique_ptr<SkCodec>
Decode
(
sk_sp<SkData>
,
39
SkCodec::Result
*,
40
SkCodecs::DecodeContext
=
nullptr
);
41
42
// Do not register this codec using "avif" as the key (even though it can handle that type).
43
// Doing so would cause internal codec sniffing to choose the wrong sampler.
44
inline
SkCodecs::Decoder
Decoder
() {
45
return
{
"heif"
,
IsHeif
,
Decode
};
46
}
47
48
}
// namespace SkHeifDecoder
49
50
#endif
// SkHeifDecoder_DEFINED
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkCodec.h
SkRefCnt.h
SkCodec::Result
Result
Definition:
SkCodec.h:76
SkData
Definition:
SkData.h:25
SkStream
Definition:
SkStream.h:29
sk_sp< SkData >
SkCodecs::DecodeContext
void * DecodeContext
Definition:
SkCodec.h:1047
SkHeifDecoder
Definition:
SkHeifDecoder.h:23
SkHeifDecoder::IsHeif
SK_API bool IsHeif(const void *, size_t)
Definition:
SkHeifCodec.cpp:540
SkHeifDecoder::Decode
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
Definition:
SkHeifCodec.cpp:544
SkHeifDecoder::Decoder
SkCodecs::Decoder Decoder()
Definition:
SkHeifDecoder.h:44
SkCodecs::Decoder
Definition:
SkCodec.h:1053
Generated on Sun Jun 23 2024 21:56:02 for Flutter Engine by
1.9.4