1
/*
2
    RawSpeed - RAW file decoder.
3

4
    Copyright (C) 2009-2014 Klaus Post
5

6
    This library is free software; you can redistribute it and/or
7
    modify it under the terms of the GNU Lesser General Public
8
    License as published by the Free Software Foundation; either
9
    version 2 of the License, or (at your option) any later version.
10

11
    This library is distributed in the hope that it will be useful,
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
    Lesser General Public License for more details.
15

16
    You should have received a copy of the GNU Lesser General Public
17
    License along with this library; if not, write to the Free Software
18
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20

21
#pragma once
22

23
#include "common/RawImage.h"              // for RawImage
24
#include "decoders/AbstractTiffDecoder.h" // for AbstractTiffDecoder
25
#include "tiff/TiffIFD.h"                 // for TiffIFD (ptr only), TiffRo...
26
#include <cstdint>                        // for uint32_t
27
#include <vector>                         // for vector
28

29
namespace rawspeed {
30

31
class CameraMetaData;
32

33
class Buffer;
34

35
struct DngTilingDescription;
36

37
class DngDecoder final : public AbstractTiffDecoder
38
{
39
public:
40
  static bool isAppropriateDecoder(const TiffRootIFD* rootIFD,
41
                                   const Buffer* file);
42
  DngDecoder(TiffRootIFDOwner&& rootIFD, const Buffer* file);
43

44
  RawImage decodeRawInternal() override;
45
  void decodeMetaDataInternal(const CameraMetaData* meta) override;
46
  void checkSupportInternal(const CameraMetaData* meta) override;
47

48
protected:
49 1
  int getDecoderVersion() const override { return 0; }
50
  bool mFixLjpeg;
51
  static void dropUnsuportedChunks(std::vector<const TiffIFD*>* data);
52
  void parseCFA(const TiffIFD* raw);
53
  DngTilingDescription getTilingDescription(const TiffIFD* raw);
54
  void decodeData(const TiffIFD* raw, uint32_t sample_format);
55
  void handleMetadata(const TiffIFD* raw);
56
  bool decodeMaskedAreas(const TiffIFD* raw);
57
  bool decodeBlackLevels(const TiffIFD* raw);
58
  void setBlack(const TiffIFD* raw);
59

60
private:
61
  int bps = -1;
62
  int compression = -1;
63
};
64

65
} // namespace rawspeed

Read our documentation on viewing source code .

Loading