Flutter Engine
The Flutter Engine
CodecUtils.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 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 CodecUtils_DEFINED
8#define CodecUtils_DEFINED
10
11#if defined(SK_CODEC_DECODES_AVIF)
13#endif
14
15#if defined(SK_CODEC_DECODES_BMP)
17#endif
18
19#if defined(SK_CODEC_DECODES_GIF)
21#endif
22
23#if defined(SK_HAS_HEIF_LIBRARY)
25#endif
26
27#if defined(SK_CODEC_DECODES_ICO)
29#endif
30
31#if defined(SK_CODEC_DECODES_JPEG)
33#endif
34
35#if defined(SK_CODEC_DECODES_JPEGXL)
37#endif
38
39#if defined(SK_CODEC_DECODES_PNG)
41#endif
42
43#if defined(SK_CODEC_DECODES_RAW)
45#endif
46
47#if defined(SK_CODEC_DECODES_WBMP)
49#endif
50
51#if defined(SK_CODEC_DECODES_WEBP)
53#endif
54
55namespace CodecUtils {
56// Register all codecs which were compiled in. Our modular codecs set a define to signal if they
57// were compiled in or not. It is safe to call this more than once, as the SkCodecs::Register
58// function is idempotent. This function *cannot* go in src/ (e.g. as part of Skia proper) because
59// then Skia itself would need to depend on codecs, which we want to avoid.
60inline void RegisterAllAvailable() {
61#if defined(SK_CODEC_DECODES_AVIF)
63#endif
64#if defined(SK_CODEC_DECODES_BMP)
66#endif
67#if defined(SK_CODEC_DECODES_GIF)
69#endif
70#if defined(SK_HAS_HEIF_LIBRARY)
72#endif
73#if defined(SK_CODEC_DECODES_ICO)
75#endif
76#if defined(SK_CODEC_DECODES_JPEG)
78#endif
79#if defined(SK_CODEC_DECODES_JPEGXL)
81#endif
82#if defined(SK_CODEC_DECODES_PNG)
84#endif
85#if defined(SK_CODEC_DECODES_RAW)
87#endif
88#if defined(SK_CODEC_DECODES_WBMP)
90#endif
91#if defined(SK_CODEC_DECODES_WEBP)
93#endif
94}
95
96} // namespace CodecUtils
97
98#endif
void RegisterAllAvailable()
Definition: CodecUtils.h:60
constexpr SkCodecs::Decoder Decoder()
Definition: SkAvifDecoder.h:38
constexpr SkCodecs::Decoder Decoder()
Definition: SkBmpDecoder.h:38
void SK_API Register(Decoder d)
Definition: SkCodec.cpp:135
constexpr SkCodecs::Decoder Decoder()
Definition: SkGifDecoder.h:38
SkCodecs::Decoder Decoder()
Definition: SkHeifDecoder.h:44
constexpr SkCodecs::Decoder Decoder()
Definition: SkIcoDecoder.h:38
constexpr SkCodecs::Decoder Decoder()
Definition: SkJpegDecoder.h:38
constexpr SkCodecs::Decoder Decoder()
constexpr SkCodecs::Decoder Decoder()
Definition: SkPngDecoder.h:38
constexpr SkCodecs::Decoder Decoder()
Definition: SkRawDecoder.h:44
constexpr SkCodecs::Decoder Decoder()
Definition: SkWbmpDecoder.h:38
constexpr SkCodecs::Decoder Decoder()
Definition: SkWebpDecoder.h:38