RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
NikonDecompressor.h
Go to the documentation of this file.
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 "adt/Array1DRef.h"
26#include "common/RawImage.h"
28#include <array>
29#include <cstdint>
30#include <vector>
31
32namespace rawspeed {
33class ByteStream;
34} // namespace rawspeed
35
36namespace rawspeed {
37
41
44
45 std::array<std::array<int, 2>, 2> pUp;
46
47 std::vector<uint16_t> curve;
48
50
51public:
53
54 void decompress(Array1DRef<const uint8_t> input, bool uncorrectedRawValues);
55
56private:
57 static const std::array<std::array<std::array<uint8_t, 16>, 2>, 6> nikon_tree;
58 static std::vector<uint16_t> createCurve(ByteStream& metadata,
61
62 template <typename Huffman>
63 void decompress(BitStreamerMSB& bits, int start_y, int end_y);
64
65 template <typename Huffman>
67};
68
69template <>
72 uint32_t huffSelect);
73
74} // namespace rawspeed
std::array< std::array< int, 2 >, 2 > pUp
static const std::array< std::array< std::array< uint8_t, 16 >, 2 >, 6 > nikon_tree
static Huffman createPrefixCodeDecoder(uint32_t huffSelect)
std::vector< uint16_t > curve
static std::vector< uint16_t > createCurve(ByteStream &metadata, uint32_t bitsPS, uint32_t v0, uint32_t v1, uint32_t *split)
NikonDecompressor(RawImage raw, ByteStream metadata, uint32_t bitsPS)
void decompress(Array1DRef< const uint8_t > input, bool uncorrectedRawValues)
static const rawspeed::CameraMetaData metadata
Definition main.cpp:54
PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > > PrefixCodeDecoder