Coverage Report

Created: 2025-10-10 06:16

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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 "tiffimage_int.hpp"
16
17
#include <array>
18
19
// *****************************************************************************
20
// namespace extensions
21
namespace Exiv2::Internal {
22
// *****************************************************************************
23
// class definitions
24
25
/// @brief Canon CR2 header structure.
26
class Cr2Header : public TiffHeaderBase {
27
 public:
28
  //! @name Creators
29
  //@{
30
  //! Default constructor
31
  explicit Cr2Header(ByteOrder byteOrder = littleEndian);
32
  //@}
33
34
  //! @name Manipulators
35
  //@{
36
  bool read(const byte* pData, size_t size) override;
37
  //@}
38
39
  //! @name Accessors
40
  //@{
41
  [[nodiscard]] DataBuf write() const override;
42
  [[nodiscard]] bool isImageTag(uint16_t tag, IfdId group, const PrimaryGroups& pPrimaryGroups) const override;
43
  //@}
44
45
  //! Return the address of offset2 from the start of the header
46
0
  static uint32_t offset2addr() {
47
0
    return 12;
48
0
  }
49
50
 private:
51
  // DATA
52
  uint32_t offset2_{0x00000000};                                          //!< Bytes 12-15 from the header
53
  static constexpr std::array<byte, 4> cr2sig_ = {0x43, 0x52, 0x2, 0x0};  //!< Signature for CR2 type TIFF
54
};
55
56
}  // namespace Exiv2::Internal
57
58
#endif  // EXIV2_CR2HEADER_INT_HPP