/src/libheif/libheif/omaf_boxes.h
Line | Count | Source |
1 | | /* |
2 | | * libheif OMAF (ISO/IEC 23090-2) |
3 | | * |
4 | | * Copyright (c) 2026 Brad Hards <bradh@frogmouth.net> |
5 | | * |
6 | | * This file is part of libheif. |
7 | | * |
8 | | * libheif is free software: you can redistribute it and/or modify |
9 | | * it under the terms of the GNU Lesser General Public License as |
10 | | * published by the Free Software Foundation, either version 3 of |
11 | | * the License, or (at your option) any later version. |
12 | | * |
13 | | * libheif is distributed in the hope that it will be useful, |
14 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | * GNU Lesser General Public License for more details. |
17 | | * |
18 | | * You should have received a copy of the GNU Lesser General Public License |
19 | | * along with libheif. If not, see <http://www.gnu.org/licenses/>. |
20 | | */ |
21 | | |
22 | | #ifndef LIBHEIF_OMAF_BOXES_H |
23 | | #define LIBHEIF_OMAF_BOXES_H |
24 | | |
25 | | #include "libheif/heif.h" |
26 | | #include "box.h" |
27 | | |
28 | | #include <memory> |
29 | | #include <string> |
30 | | |
31 | | // Projection format for OMAF |
32 | | // See ISO/IEC 23090-2:2023 Section 7.9.3 |
33 | | class Box_prfr : public FullBox |
34 | | { |
35 | | public: |
36 | | Box_prfr() |
37 | 1 | { |
38 | 1 | set_short_type(fourcc("prfr")); |
39 | 1 | } |
40 | | |
41 | 0 | heif_omaf_image_projection get_omaf_image_projection() const { return m_projection; } |
42 | | |
43 | | Error set_image_projection(heif_omaf_image_projection projection); |
44 | | |
45 | | std::string dump(Indent&) const override; |
46 | | |
47 | 0 | const char* debug_box_name() const override { return "Projection Format"; } |
48 | | |
49 | 0 | [[nodiscard]] parse_error_fatality get_parse_error_fatality() const override { return parse_error_fatality::optional; } |
50 | | |
51 | | Error write(StreamWriter& writer) const override; |
52 | | |
53 | | protected: |
54 | | Error parse(BitstreamRange& range, const heif_security_limits*) override; |
55 | | |
56 | | private: |
57 | | heif_omaf_image_projection m_projection = heif_omaf_image_projection_equirectangular; |
58 | | }; |
59 | | |
60 | | #endif |