/src/libheif/libheif/codecs/jpeg_boxes.h
Line | Count | Source |
1 | | /* |
2 | | * HEIF 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 | | #ifndef LIBHEIF_JPEG_BOXES_H |
22 | | #define LIBHEIF_JPEG_BOXES_H |
23 | | |
24 | | #include "box.h" |
25 | | #include <string> |
26 | | #include <vector> |
27 | | #include "image-items/image_item.h" |
28 | | #include <memory> |
29 | | #include "sequences/seq_boxes.h" |
30 | | |
31 | | |
32 | | class Box_jpgC : public Box |
33 | | { |
34 | | public: |
35 | | Box_jpgC() |
36 | 100 | { |
37 | 100 | set_short_type(fourcc("jpgC")); |
38 | 100 | } |
39 | | |
40 | 0 | const std::vector<uint8_t>& get_data() const { return m_data; } |
41 | | |
42 | 0 | void set_data(const std::vector<uint8_t>& data) { m_data = data; } |
43 | | |
44 | | std::string dump(Indent&) const override; |
45 | | |
46 | | Error write(StreamWriter& writer) const override; |
47 | | |
48 | | protected: |
49 | | Error parse(BitstreamRange& range, const heif_security_limits* limits) override; |
50 | | |
51 | | private: |
52 | | std::vector<uint8_t> m_data; |
53 | | }; |
54 | | |
55 | | |
56 | | class Box_mjpg : public Box_VisualSampleEntry |
57 | | { |
58 | | public: |
59 | | Box_mjpg() |
60 | 13 | { |
61 | 13 | set_short_type(fourcc("mjpg")); |
62 | 13 | } |
63 | | }; |
64 | | |
65 | | |
66 | | #endif // LIBHEIF_JPEG_BOXES_H |