/src/libheif/libheif/image-items/avc.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * HEIF AVC codec. |
3 | | * Copyright (c) 2023 Brad Hards <bradh@frogmouth.net> |
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 | | #ifndef HEIF_AVC_H |
22 | | #define HEIF_AVC_H |
23 | | |
24 | | #include "box.h" |
25 | | #include "error.h" |
26 | | #include <cstdint> |
27 | | #include <vector> |
28 | | #include <string> |
29 | | #include <memory> |
30 | | #include "image_item.h" |
31 | | |
32 | | |
33 | | class ImageItem_AVC : public ImageItem |
34 | | { |
35 | | public: |
36 | 6 | ImageItem_AVC(HeifContext* ctx, heif_item_id id) : ImageItem(ctx, id) {} |
37 | | |
38 | 0 | ImageItem_AVC(HeifContext* ctx) : ImageItem(ctx) {} |
39 | | |
40 | 0 | uint32_t get_infe_type() const override { return fourcc("avc1"); } |
41 | | |
42 | 0 | const char* get_auxC_alpha_channel_type() const override { return "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha"; } |
43 | | |
44 | 0 | heif_compression_format get_compression_format() const override { return heif_compression_AVC; } |
45 | | |
46 | | Error on_load_file() override; |
47 | | |
48 | 0 | heif_brand2 get_compatible_brand() const override { return heif_brand2_avci; } |
49 | | |
50 | | protected: |
51 | | Result<std::shared_ptr<Decoder>> get_decoder() const override; |
52 | | |
53 | | public: |
54 | | Result<Encoder::CodedImageData> encode(const std::shared_ptr<HeifPixelImage>& image, |
55 | | struct heif_encoder* encoder, |
56 | | const struct heif_encoding_options& options, |
57 | | enum heif_image_input_class input_class) override; |
58 | | |
59 | | std::shared_ptr<class Decoder_AVC> m_decoder; |
60 | | }; |
61 | | |
62 | | #endif |