RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
Common.h File Reference
#include "adt/Array1DRef.h"
#include "adt/Optional.h"
#include "codes/AbstractPrefixCode.h"
#include "codes/HuffmanCode.h"
#include "codes/PrefixCode.h"
#include "common/RawspeedException.h"
#include "io/Buffer.h"
#include "io/ByteStream.h"
#include <cassert>
#include <cstdint>
#include <type_traits>
#include <vector>
Include dependency graph for Common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename CodeTag>
auto getCodeValues (rawspeed::ByteStream &bs, unsigned numEntries)
template<typename CodeTag>
auto getCodeSymbols (rawspeed::ByteStream &bs, unsigned numSymbols)
template<typename CodeTag>
rawspeed::HuffmanCode< CodeTag > createHuffmanCode (rawspeed::ByteStream &bs)
template<typename CodeTag>
rawspeed::PrefixCode< CodeTag > createPrefixCode (rawspeed::ByteStream &bs)
template<typename T, typename CodeTag>
requires std::is_constructible_v<T, rawspeed::HuffmanCode<CodeTag>>
createHuffmanPrefixCodeDecoderImpl (rawspeed::ByteStream &bs)
template<typename T, typename CodeTag>
requires (!std::is_constructible_v<T, rawspeed::HuffmanCode<CodeTag>>)
createHuffmanPrefixCodeDecoderImpl (rawspeed::ByteStream &bs)
template<typename T, typename CodeTag>
requires (!std::is_constructible_v<T, rawspeed::PrefixCode<CodeTag>>)
createSimplePrefixCodeDecoderImpl (rawspeed::ByteStream &bs)
template<typename T, typename CodeTag>
requires std::is_constructible_v<T, rawspeed::PrefixCode<CodeTag>>
createSimplePrefixCodeDecoderImpl (rawspeed::ByteStream &bs)
template<typename T>
static T createPrefixCodeDecoder (rawspeed::ByteStream &bs)

Function Documentation

◆ createHuffmanCode()

template<typename CodeTag>
rawspeed::HuffmanCode< CodeTag > createHuffmanCode ( rawspeed::ByteStream & bs)
inline

Definition at line 76 of file Common.h.

References rawspeed::ByteStream::getBuffer(), getCodeValues(), rawspeed::ByteStream::getStream(), rawspeed::implicit_cast(), rawspeed::HuffmanCode< CodeTag >::setCodeValues(), and rawspeed::HuffmanCode< CodeTag >::setNCodesPerLength().

Referenced by createHuffmanPrefixCodeDecoderImpl().

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

◆ createHuffmanPrefixCodeDecoderImpl() [1/2]

template<typename T, typename CodeTag>
requires (!std::is_constructible_v<T, rawspeed::HuffmanCode<CodeTag>>)
T createHuffmanPrefixCodeDecoderImpl ( rawspeed::ByteStream & bs)
inline

Definition at line 126 of file Common.h.

References createHuffmanCode().

Here is the call graph for this function:

◆ createHuffmanPrefixCodeDecoderImpl() [2/2]

template<typename T, typename CodeTag>
requires std::is_constructible_v<T, rawspeed::HuffmanCode<CodeTag>>
T createHuffmanPrefixCodeDecoderImpl ( rawspeed::ByteStream & bs)
inline

Definition at line 119 of file Common.h.

References createHuffmanCode().

Referenced by createPrefixCodeDecoder().

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

◆ createPrefixCode()

template<typename CodeTag>
rawspeed::PrefixCode< CodeTag > createPrefixCode ( rawspeed::ByteStream & bs)
inline

Definition at line 100 of file Common.h.

References getCodeSymbols(), getCodeValues(), rawspeed::ByteStream::getStream(), and rawspeed::ByteStream::getU32().

Referenced by createSimplePrefixCodeDecoderImpl().

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

◆ createPrefixCodeDecoder()

template<typename T>
T createPrefixCodeDecoder ( rawspeed::ByteStream & bs)
static

Definition at line 147 of file Common.h.

References createHuffmanPrefixCodeDecoderImpl(), createSimplePrefixCodeDecoderImpl(), and rawspeed::ByteStream::getByte().

Referenced by rawspeed::anonymous_namespace{PrefixCodeEncoder.cpp}::checkDecoder(), anonymous_namespace{Dual.cpp}::checkFlavour(), anonymous_namespace{Solo.cpp}::checkFlavour(), LLVMFuzzerTestOneInput(), and rawspeed::anonymous_namespace{NikonDecompressor.cpp}::NikonLASDecompressor::setup().

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

◆ createSimplePrefixCodeDecoderImpl() [1/2]

template<typename T, typename CodeTag>
requires std::is_constructible_v<T, rawspeed::PrefixCode<CodeTag>>
T createSimplePrefixCodeDecoderImpl ( rawspeed::ByteStream & bs)
inline

Definition at line 141 of file Common.h.

References createPrefixCode().

Here is the call graph for this function:

◆ createSimplePrefixCodeDecoderImpl() [2/2]

template<typename T, typename CodeTag>
requires (!std::is_constructible_v<T, rawspeed::PrefixCode<CodeTag>>)
T createSimplePrefixCodeDecoderImpl ( rawspeed::ByteStream & bs)
inline

Definition at line 134 of file Common.h.

References ThrowRSE.

Referenced by createPrefixCodeDecoder().

Here is the caller graph for this function:

◆ getCodeSymbols()

template<typename CodeTag>
auto getCodeSymbols ( rawspeed::ByteStream & bs,
unsigned numSymbols )

Definition at line 54 of file Common.h.

References assert(), rawspeed::ByteStream::get(), and ThrowRSE.

Referenced by createPrefixCode().

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

◆ getCodeValues()

template<typename CodeTag>
auto getCodeValues ( rawspeed::ByteStream & bs,
unsigned numEntries )

Definition at line 37 of file Common.h.

References assert(), rawspeed::ByteStream::get(), and ThrowRSE.

Referenced by createHuffmanCode(), and createPrefixCode().

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