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
"
24
#include "
bitstreams/BitStreamerMSB.h
"
25
#include "
codes/PrefixCodeDecoder.h
"
26
#include "
common/RawImage.h
"
27
#include "
decompressors/AbstractDecompressor.h
"
28
#include <array>
29
#include <cstdint>
30
#include <vector>
31
32
namespace
rawspeed
{
33
class
ByteStream
;
34
}
// namespace rawspeed
35
36
namespace
rawspeed
{
37
38
class
NikonDecompressor
final :
public
AbstractDecompressor
{
39
RawImage
mRaw
;
40
uint32_t
bitsPS
;
41
42
uint32_t
huffSelect
= 0;
43
uint32_t
split
= 0;
44
45
std::array<std::array<int, 2>, 2>
pUp
;
46
47
std::vector<uint16_t>
curve
;
48
49
uint32_t
random
;
50
51
public
:
52
NikonDecompressor
(
RawImage
raw,
ByteStream
metadata
,
uint32_t
bitsPS
);
53
54
void
decompress
(
Array1DRef<const uint8_t>
input,
bool
uncorrectedRawValues);
55
56
private
:
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
,
59
uint32_t
bitsPS
,
uint32_t
v0,
60
uint32_t
v1,
uint32_t
*
split
);
61
62
template
<
typename
Huffman>
63
void
decompress
(
BitStreamerMSB
& bits,
int
start_y,
int
end_y);
64
65
template
<
typename
Huffman>
66
static
Huffman
createPrefixCodeDecoder
(
uint32_t
huffSelect
);
67
};
68
69
template
<>
70
PrefixCodeDecoder<>
71
NikonDecompressor::createPrefixCodeDecoder<PrefixCodeDecoder<>
>(
72
uint32_t
huffSelect);
73
74
}
// namespace rawspeed
AbstractDecompressor.h
Array1DRef.h
BitStreamerMSB.h
PrefixCodeDecoder.h
RawImage.h
rawspeed::AbstractDecompressor
Definition
AbstractDecompressor.h:25
rawspeed::Array1DRef
Definition
Array1DRef.h:32
rawspeed::BitStreamerMSB
Definition
BitStreamerMSB.h:43
rawspeed::ByteStream
Definition
ByteStream.h:43
rawspeed::NikonDecompressor::pUp
std::array< std::array< int, 2 >, 2 > pUp
Definition
NikonDecompressor.h:45
rawspeed::NikonDecompressor::nikon_tree
static const std::array< std::array< std::array< uint8_t, 16 >, 2 >, 6 > nikon_tree
Definition
NikonDecompressor.h:57
rawspeed::NikonDecompressor::createPrefixCodeDecoder
static Huffman createPrefixCodeDecoder(uint32_t huffSelect)
Definition
NikonDecompressor.cpp:448
rawspeed::NikonDecompressor::curve
std::vector< uint16_t > curve
Definition
NikonDecompressor.h:47
rawspeed::NikonDecompressor::split
uint32_t split
Definition
NikonDecompressor.h:43
rawspeed::NikonDecompressor::createCurve
static std::vector< uint16_t > createCurve(ByteStream &metadata, uint32_t bitsPS, uint32_t v0, uint32_t v1, uint32_t *split)
Definition
NikonDecompressor.cpp:381
rawspeed::NikonDecompressor::huffSelect
uint32_t huffSelect
Definition
NikonDecompressor.h:42
rawspeed::NikonDecompressor::NikonDecompressor
NikonDecompressor(RawImage raw, ByteStream metadata, uint32_t bitsPS)
Definition
NikonDecompressor.cpp:473
rawspeed::NikonDecompressor::bitsPS
uint32_t bitsPS
Definition
NikonDecompressor.h:40
rawspeed::NikonDecompressor::mRaw
RawImage mRaw
Definition
NikonDecompressor.h:39
rawspeed::NikonDecompressor::decompress
void decompress(Array1DRef< const uint8_t > input, bool uncorrectedRawValues)
Definition
NikonDecompressor.cpp:543
rawspeed::NikonDecompressor::random
uint32_t random
Definition
NikonDecompressor.h:49
rawspeed::RawImage
Definition
RawImage.h:247
uint32_t
metadata
static const rawspeed::CameraMetaData metadata
Definition
main.cpp:54
rawspeed
Definition
CoalescingOutputIteratorBenchmark.cpp:35
rawspeed::PrefixCodeDecoder
PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > > PrefixCodeDecoder
Definition
PrefixCodeDecoder.h:37
librawspeed
decompressors
NikonDecompressor.h
Generated by
1.15.0