/src/libheif/libheif/plugins/decoder_uncompressed.cc
Line | Count | Source |
1 | | /* |
2 | | * JPEG codec. |
3 | | * Copyright (c) 2023 Dirk Farin <dirk.farin@gmail.com> |
4 | | * |
5 | | * This file is part of libheif. |
6 | | * |
7 | | * libheif is free software: you can redistribute it and/or modify |
8 | | * it under the terms of the GNU Lesser General Public License as |
9 | | * published by the Free Software Foundation, either version 3 of |
10 | | * the License, or (at your option) any later version. |
11 | | * |
12 | | * libheif is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | * GNU Lesser General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU Lesser General Public License |
18 | | * along with libheif. If not, see <http://www.gnu.org/licenses/>. |
19 | | */ |
20 | | |
21 | | #include "libheif/heif.h" |
22 | | #include "libheif/heif_plugin.h" |
23 | | #include "decoder_uncompressed.h" |
24 | | |
25 | | struct uncompressed_decoder |
26 | | { |
27 | | }; |
28 | | |
29 | | static const int UNCOMPRESSED_PLUGIN_PRIORITY = 100; |
30 | | |
31 | | |
32 | | static const char* uncompressed_plugin_name() |
33 | 0 | { |
34 | 0 | return "builtin"; |
35 | 0 | } |
36 | | |
37 | | |
38 | | static int uncompressed_does_support_format(enum heif_compression_format format) |
39 | 0 | { |
40 | 0 | if (format == heif_compression_uncompressed) { |
41 | 0 | return UNCOMPRESSED_PLUGIN_PRIORITY; |
42 | 0 | } |
43 | 0 | else { |
44 | 0 | return 0; |
45 | 0 | } |
46 | 0 | } |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | static const heif_decoder_plugin decoder_uncompressed |
52 | | { |
53 | | 3, |
54 | | uncompressed_plugin_name, |
55 | | nullptr, |
56 | | nullptr, |
57 | | uncompressed_does_support_format, |
58 | | nullptr, |
59 | | nullptr, |
60 | | nullptr, |
61 | | nullptr, |
62 | | nullptr, |
63 | | "uncompressed" |
64 | | }; |
65 | | |
66 | | |
67 | | const heif_decoder_plugin* get_decoder_plugin_uncompressed() |
68 | 2 | { |
69 | 2 | return &decoder_uncompressed; |
70 | 2 | } |