libopenraw
neffile.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - neffile.h
4  *
5  * Copyright (C) 2006-2017 Hubert Figuiere
6  * Copyright (C) 2008 Novell, Inc.
7  *
8  * This library is free software: you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3 of
11  * the License, or (at your option) any later version.
12  *
13  * This library 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 GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see
20  * <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef OR_INTERNALS_NEFFILE_H_
24 #define OR_INTERNALS_NEFFILE_H_
25 
26 #include <stdint.h>
27 
28 #include <array>
29 
30 #include <libopenraw/consts.h>
31 
32 #include "rawfile.hpp"
33 #include "tiffepfile.hpp"
34 #include "ifdfile.hpp"
35 #include "io/stream.hpp"
36 
37 
38 namespace OpenRaw {
39 
40 class RawData;
41 
42 namespace Internals {
43 
44 class RawContainer;
45 struct HuffmanNode;
46 
47 class NefFile
48  : public TiffEpFile
49 {
50 public:
51  static RawFile *factory(const IO::Stream::Ptr & _f);
52  NefFile(const IO::Stream::Ptr & _f);
53  virtual ~NefFile();
54 
55  NefFile(const NefFile&) = delete;
56  NefFile & operator=(const NefFile &) = delete;
57 
61  static bool isCompressed(RawContainer & container, uint32_t offset);
62 
64  public:
66  : curve(0x8000, 0) {
67  }
68  uint16_t vpred[2][2];
69  std::vector<uint16_t> curve;
70  const HuffmanNode* huffman;
71  };
72 
73 private:
74 
75  static const IfdFile::camera_ids_t s_def[];
76  bool _getCompressionCurve(RawData&, NEFCompressionInfo&);
77  ::or_error _decompressNikonQuantized(RawData&);
78  virtual ::or_error _decompressIfNeeded(RawData&, uint32_t) override;
79 };
80 
81 }
82 }
83 
84 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:30
static bool isCompressed(RawContainer &container, uint32_t offset)
Definition: neffile.cpp:418