/src/exiv2/src/cr2header_int.hpp
Line | Count | Source |
1 | | // SPDX-License-Identifier: GPL-2.0-or-later |
2 | | |
3 | | /*! |
4 | | @file cr2image_int.hpp |
5 | | @brief Internal classes to support CR2 image format |
6 | | @author Andreas Huggel (ahu) |
7 | | <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> |
8 | | @date 23-Apr-08, ahu: created |
9 | | */ |
10 | | #ifndef EXIV2_CR2HEADER_INT_HPP |
11 | | #define EXIV2_CR2HEADER_INT_HPP |
12 | | |
13 | | // ***************************************************************************** |
14 | | // included header files |
15 | | #include "types.hpp" |
16 | | |
17 | | #include "tifffwd_int.hpp" |
18 | | #include "tiffimage_int.hpp" |
19 | | |
20 | | #include <cstddef> |
21 | | #include <cstdint> |
22 | | |
23 | | // ***************************************************************************** |
24 | | // namespace extensions |
25 | | namespace Exiv2 { |
26 | | enum class IfdId : uint32_t; |
27 | | namespace Internal { |
28 | | // ***************************************************************************** |
29 | | // class definitions |
30 | | |
31 | | /// @brief Canon CR2 header structure. |
32 | | class Cr2Header : public TiffHeaderBase { |
33 | | public: |
34 | | //! @name Creators |
35 | | //@{ |
36 | | //! Default constructor |
37 | | explicit Cr2Header(ByteOrder byteOrder = littleEndian); |
38 | | //@} |
39 | | |
40 | | //! @name Manipulators |
41 | | //@{ |
42 | | bool read(const byte* pData, size_t size) override; |
43 | | //@} |
44 | | |
45 | | //! @name Accessors |
46 | | //@{ |
47 | | [[nodiscard]] DataBuf write() const override; |
48 | | [[nodiscard]] bool isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const override; |
49 | | //@} |
50 | | |
51 | | //! Return the address of offset2 from the start of the header |
52 | 0 | static uint32_t offset2addr() { |
53 | 0 | return 12; |
54 | 0 | } |
55 | | |
56 | | private: |
57 | | // DATA |
58 | | uint32_t offset2_{0x00000000}; //!< Bytes 12-15 from the header |
59 | | static constexpr byte cr2sig_[4] = {0x43, 0x52, 0x2, 0x0}; //!< Signature for CR2 type TIFF |
60 | | }; |
61 | | |
62 | | } // namespace Internal |
63 | | } // namespace Exiv2 |
64 | | |
65 | | #endif // EXIV2_CR2HEADER_INT_HPP |