RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
DngOpcodes.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2009-2014 Klaus Post
5 Copyright (C) 2017 Axel Waggershauser
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#pragma once
23
24#include "adt/Optional.h"
25#include <cstdint>
26#include <memory>
27#include <utility>
28#include <vector>
29
30namespace rawspeed {
31
32class ByteStream;
33class RawImage;
34class iRectangle2D;
35
36class DngOpcodes final {
37public:
38 DngOpcodes(const RawImage& ri, ByteStream bs);
40 void applyOpCodes(const RawImage& ri) const;
41
42private:
43 class DngOpcode;
44
45 std::vector<std::unique_ptr<DngOpcode>> opcodes;
46
48 class DummyROIOpcode;
50 class FixBadPixelsList;
51 class LookupOpcode;
52 class PixelOpcode;
53 class PolynomialMap;
54 class ROIOpcode;
55 class TableMap;
56 class TrimBounds;
57 template <typename S> class DeltaRowOrCol;
58 template <typename S> class OffsetPerRowOrCol;
59 template <typename S> class ScalePerRowOrCol;
60
61 template <class Opcode>
62 static std::unique_ptr<DngOpcode>
63 constructor(const RawImage& ri, ByteStream& bs,
64 iRectangle2D& integrated_subimg);
65
66 using constructor_t = std::unique_ptr<DngOpcode> (*)(
67 const RawImage& ri, ByteStream& bs, iRectangle2D& integrated_subimg);
69 Map(uint32_t code);
70};
71
72} // namespace rawspeed
DngOpcodes(const RawImage &ri, ByteStream bs)
std::vector< std::unique_ptr< DngOpcode > > opcodes
Definition DngOpcodes.h:45
static std::unique_ptr< DngOpcode > constructor(const RawImage &ri, ByteStream &bs, iRectangle2D &integrated_subimg)
static Optional< std::pair< const char *, DngOpcodes::constructor_t > > Map(uint32_t code)
std::unique_ptr< DngOpcode >(*)( const RawImage &ri, ByteStream &bs, iRectangle2D &integrated_subimg) constructor_t
Definition DngOpcodes.h:66
void applyOpCodes(const RawImage &ri) const