RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rawspeed::NikonDecompressor Class Referencefinal

#include "decompressors/NikonDecompressor.h"

Inheritance diagram for rawspeed::NikonDecompressor:
[legend]
Collaboration diagram for rawspeed::NikonDecompressor:
[legend]

Public Member Functions

 NikonDecompressor (RawImage raw, ByteStream metadata, uint32_t bitsPS)
void decompress (Array1DRef< const uint8_t > input, bool uncorrectedRawValues)

Private Member Functions

template<typename Huffman>
void decompress (BitStreamerMSB &bits, int start_y, int end_y)

Static Private Member Functions

static std::vector< uint16_tcreateCurve (ByteStream &metadata, uint32_t bitsPS, uint32_t v0, uint32_t v1, uint32_t *split)
template<typename Huffman>
static Huffman createPrefixCodeDecoder (uint32_t huffSelect)
template<>
PrefixCodeDecoder createPrefixCodeDecoder (uint32_t huffSelect)
template<>
PrefixCodeDecoder createPrefixCodeDecoder (uint32_t huffSelect)

Private Attributes

RawImage mRaw
uint32_t bitsPS
uint32_t huffSelect = 0
uint32_t split = 0
std::array< std::array< int, 2 >, 2 > pUp
std::vector< uint16_tcurve
uint32_t random

Static Private Attributes

static const std::array< std::array< std::array< uint8_t, 16 >, 2 >, 6 > nikon_tree

Detailed Description

Definition at line 38 of file NikonDecompressor.h.

Constructor & Destructor Documentation

◆ NikonDecompressor()

rawspeed::NikonDecompressor::NikonDecompressor ( RawImage raw,
ByteStream metadata,
uint32_t bitsPS )

Definition at line 473 of file NikonDecompressor.cpp.

References bitsPS, createCurve(), curve, rawspeed::EXTRA, huffSelect, metadata, mRaw, pUp, split, ThrowRDE, rawspeed::UINT16, and rawspeed::writeLog().

Referenced by createPrefixCodeDecoder().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ createCurve()

std::vector< uint16_t > rawspeed::NikonDecompressor::createCurve ( ByteStream & metadata,
uint32_t bitsPS,
uint32_t v0,
uint32_t v1,
uint32_t * split )
staticprivate

Definition at line 381 of file NikonDecompressor.cpp.

References assert(), bitsPS, curve, rawspeed::implicit_cast(), metadata, split, and ThrowRDE.

Referenced by NikonDecompressor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPrefixCodeDecoder() [1/3]

template<>
PrefixCodeDecoder rawspeed::NikonDecompressor::createPrefixCodeDecoder ( uint32_t huffSelect)
staticprivate

Definition at line 448 of file NikonDecompressor.cpp.

◆ createPrefixCodeDecoder() [2/3]

template<typename Huffman>
Huffman rawspeed::NikonDecompressor::createPrefixCodeDecoder ( uint32_t huffSelect)
staticprivate

Definition at line 448 of file NikonDecompressor.cpp.

References huffSelect, and nikon_tree.

Referenced by decompress().

Here is the caller graph for this function:

◆ createPrefixCodeDecoder() [3/3]

template<>
PrefixCodeDecoder rawspeed::NikonDecompressor::createPrefixCodeDecoder ( uint32_t huffSelect)
staticprivate

References NikonDecompressor().

Here is the call graph for this function:

◆ decompress() [1/2]

void rawspeed::NikonDecompressor::decompress ( Array1DRef< const uint8_t > input,
bool uncorrectedRawValues )

Definition at line 543 of file NikonDecompressor.cpp.

References curve, decompress(), huffSelect, invariant, mRaw, rawspeed::BitStreamer< Tag >::peekBits(), random, and split.

Referenced by rawspeed::NefDecoder::decodeRawInternal(), decompress(), and LLVMFuzzerTestOneInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decompress() [2/2]

template<typename Huffman>
void rawspeed::NikonDecompressor::decompress ( BitStreamerMSB & bits,
int start_y,
int end_y )
private

Definition at line 519 of file NikonDecompressor.cpp.

References rawspeed::clampBits(), createPrefixCodeDecoder(), huffSelect, invariant, mRaw, pUp, random, and rawspeed::Array2DRef< T >::width().

Here is the call graph for this function:

Member Data Documentation

◆ bitsPS

uint32_t rawspeed::NikonDecompressor::bitsPS
private

Definition at line 40 of file NikonDecompressor.h.

Referenced by NikonDecompressor(), and createCurve().

◆ curve

std::vector<uint16_t> rawspeed::NikonDecompressor::curve
private

Definition at line 47 of file NikonDecompressor.h.

Referenced by NikonDecompressor(), createCurve(), and decompress().

◆ huffSelect

uint32_t rawspeed::NikonDecompressor::huffSelect = 0
private

◆ mRaw

RawImage rawspeed::NikonDecompressor::mRaw
private

Definition at line 39 of file NikonDecompressor.h.

Referenced by NikonDecompressor(), decompress(), and decompress().

◆ nikon_tree

const std::array< std::array< std::array< uint8_t, 16 >, 2 >, 6 > rawspeed::NikonDecompressor::nikon_tree
staticprivate
Initial value:
= {{
{{
{0, 1, 5, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0},
{5, 4, 3, 6, 2, 7, 1, 0, 8, 9, 11, 10, 12}}},
{{
{0, 1, 5, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0},
{0x39, 0x5a, 0x38, 0x27, 0x16, 5, 4, 3, 2, 1, 0, 11, 12, 12}}},
{{
{0, 1, 4, 2, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, 11, 12}}},
{{
{0, 1, 4, 3, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0},
{5, 6, 4, 7, 8, 3, 9, 2, 1, 0, 10, 11, 12, 13, 14}}},
{{
{0, 1, 5, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0},
{8, 0x5c, 0x4b, 0x3a, 0x29, 7, 6, 5, 4, 3, 2, 1, 0, 13, 14}}},
{{
{0, 1, 4, 2, 2, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0},
{7, 6, 8, 5, 9, 4, 10, 3, 11, 12, 2, 0, 1, 13, 14}}},
}}

Definition at line 57 of file NikonDecompressor.h.

Referenced by createPrefixCodeDecoder().

◆ pUp

std::array<std::array<int, 2>, 2> rawspeed::NikonDecompressor::pUp
private

Definition at line 45 of file NikonDecompressor.h.

Referenced by NikonDecompressor(), and decompress().

◆ random

uint32_t rawspeed::NikonDecompressor::random
private

Definition at line 49 of file NikonDecompressor.h.

Referenced by decompress(), and decompress().

◆ split

uint32_t rawspeed::NikonDecompressor::split = 0
private

Definition at line 43 of file NikonDecompressor.h.

Referenced by NikonDecompressor(), createCurve(), and decompress().


The documentation for this class was generated from the following files: