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

#include "common/RawImage.h"

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

Public Member Functions

 RawImageDataU16 ()
 RawImageDataU16 (const iPoint2D &dim_, uint32_t cpp_=1)
void scaleBlackWhite () override
void calculateBlackAreas () override
void setWithLookUp (uint16_t value, std::byte *dst, uint32_t *random) override
uint32_t RAWSPEED_READONLY getCpp () const
uint32_t RAWSPEED_READONLY getBpp () const
void setCpp (uint32_t val)
void createData ()
void poisonPadding ()
void unpoisonPadding ()
rawspeed::RawImageType getDataType () const
Array2DRef< uint16_tgetU16DataAsUncroppedArray2DRef () noexcept
CroppedArray2DRef< uint16_tgetU16DataAsCroppedArray2DRef () noexcept
Array2DRef< floatgetF32DataAsUncroppedArray2DRef () noexcept
CroppedArray2DRef< floatgetF32DataAsCroppedArray2DRef () noexcept
Array2DRef< std::byte > getByteDataAsUncroppedArray2DRef () noexcept
void subFrame (iRectangle2D cropped)
void clearArea (iRectangle2D area)
iPoint2D RAWSPEED_READONLY getUncroppedDim () const
iPoint2D RAWSPEED_READONLY getCropOffset () const
void sixteenBitLookup ()
void transferBadPixelsToMap () REQUIRES(!mBadPixelMutex)
void fixBadPixels () REQUIRES(!mBadPixelMutex)
void setTable (const std::vector< uint16_t > &table_, bool dither)
void setTable (std::unique_ptr< TableLookUp > t)
bool isAllocated () const
void createBadPixelMap ()
std::vector< uint32_t > mBadPixelPositions GUARDED_BY (mBadPixelMutex)
void setError (const std::string &err) REQUIRES(!mutex)
bool isTooManyErrors (unsigned many, std::string *firstErr=nullptr) REQUIRES(!mutex)
std::vector< std::string > && getErrors () REQUIRES(!mutex)

Public Attributes

iPoint2D dim
int pitch = 0
uint32_t padding = 0
bool isCFA {true}
ColorFilterArray cfa
int blackLevel = -1
std::array< int, 4 > blackLevelSeparateStorage
Optional< Array2DRef< int > > blackLevelSeparate
Optional< int > whitePoint
std::vector< BlackAreablackAreas
std::vector< uint8_t, AlignedAllocator< uint8_t, 16 > > mBadPixelMap
uint32_t mBadPixelMapPitch = 0
bool mDitherScale
ImageMetaData metadata
Mutex mBadPixelMutex

Protected Member Functions

void fixBadPixelsThread (int start_y, int end_y)
void startWorker (RawImageWorker::RawImageWorkerTask task, bool cropped)

Protected Attributes

RawImageType dataType
std::vector< uint8_t, DefaultInitAllocatorAdaptor< uint8_t, AlignedAllocator< uint8_t, 16 > > > data
int cpp = 1
int bpp = 0
iPoint2D mOffset
iPoint2D uncropped_dim
std::unique_ptr< TableLookUptable

Private Member Functions

void scaleValues_plain (int start_y, int end_y)
void scaleValues (int start_y, int end_y) override
void fixBadPixel (uint32_t x, uint32_t y, int component=0) override
void doLookup (int start_y, int end_y) override
virtual void anchor () const

Private Attributes

Mutex mutex

Friends

class RawImage

Detailed Description

Definition at line 209 of file RawImage.h.

Constructor & Destructor Documentation

◆ RawImageDataU16() [1/2]

rawspeed::RawImageDataU16::RawImageDataU16 ( )

◆ RawImageDataU16() [2/2]

rawspeed::RawImageDataU16::RawImageDataU16 ( const iPoint2D & dim_,
uint32_t cpp_ = 1 )
explicit

Definition at line 57 of file RawImageDataU16.cpp.

References rawspeed::RawImageData::RawImageData().

Here is the call graph for this function:

Member Function Documentation

◆ anchor()

void rawspeed::RawImageData::anchor ( ) const
privatevirtualinherited

Definition at line 51 of file RawImage.cpp.

◆ calculateBlackAreas()

void rawspeed::RawImageDataU16::calculateBlackAreas ( )
overridevirtual

Implements rawspeed::RawImageData.

Definition at line 60 of file RawImageDataU16.cpp.

References rawspeed::Array2DRef(), rawspeed::RawImageData::blackAreas, rawspeed::RawImageData::blackLevel, rawspeed::RawImageData::blackLevelSeparate, rawspeed::RawImageData::blackLevelSeparateStorage, rawspeed::Array2DRef< T >::create(), rawspeed::RawImageData::dim, rawspeed::RawImageData::getU16DataAsUncroppedArray2DRef(), rawspeed::RawImageData::isCFA, rawspeed::RawImageData::mOffset, ThrowRDE, rawspeed::RawImageData::uncropped_dim, x, and y.

Referenced by scaleBlackWhite().

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

◆ clearArea()

void rawspeed::RawImageData::clearArea ( iRectangle2D area)
inherited

Definition at line 326 of file RawImage.cpp.

References rawspeed::iRectangle2D::area(), cpp, dim, rawspeed::iRectangle2D::getBottom(), rawspeed::iRectangle2D::getLeft(), rawspeed::iRectangle2D::getOverlap(), rawspeed::iRectangle2D::getTop(), getU16DataAsCroppedArray2DRef(), rawspeed::iRectangle2D::getWidth(), x, and y.

Referenced by rawspeed::RafDecoder::applyCorrections().

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

◆ createBadPixelMap()

void rawspeed::RawImageData::createBadPixelMap ( )
inherited

Definition at line 201 of file RawImage.cpp.

References assert(), rawspeed::implicit_cast(), isAllocated(), mBadPixelMap, mBadPixelMapPitch, rawspeed::roundUp(), rawspeed::roundUpDivisionSafe(), ThrowRDE, and uncropped_dim.

Referenced by transferBadPixelsToMap().

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

◆ createData()

void rawspeed::RawImageData::createData ( )
inherited

Definition at line 68 of file RawImage.cpp.

References assert(), bpp, cpp, data, dim, getByteDataAsUncroppedArray2DRef(), rawspeed::implicit_cast(), rawspeed::isAligned(), isAllocated(), padding, pitch, poisonPadding(), rawspeed::roundUp(), ThrowRDE, and uncropped_dim.

Referenced by RawImageData(), LLVMFuzzerTestOneInput(), and rawspeed::LLVMFuzzerTestOneInput().

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

◆ doLookup()

void rawspeed::RawImageDataU16::doLookup ( int start_y,
int end_y )
overrideprivatevirtual

Implements rawspeed::RawImageData.

Definition at line 488 of file RawImageDataU16.cpp.

References rawspeed::clampBits(), rawspeed::RawImageData::cpp, rawspeed::RawImageData::getU16DataAsUncroppedArray2DRef(), rawspeed::RawImageData::table, ThrowRDE, rawspeed::RawImageData::uncropped_dim, x, and y.

Here is the call graph for this function:

◆ fixBadPixel()

void rawspeed::RawImageDataU16::fixBadPixel ( uint32_t x,
uint32_t y,
int component = 0 )
overrideprivatevirtual

Implements rawspeed::RawImageData.

Definition at line 399 of file RawImageDataU16.cpp.

References rawspeed::Array2DRef(), rawspeed::clampBits(), rawspeed::RawImageData::cpp, fixBadPixel(), rawspeed::RawImageData::getU16DataAsUncroppedArray2DRef(), rawspeed::RawImageData::isCFA, rawspeed::RawImageData::mBadPixelMap, rawspeed::RawImageData::mBadPixelMapPitch, rawspeed::RawImageData::uncropped_dim, x, and y.

Referenced by fixBadPixel().

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

◆ fixBadPixels()

void rawspeed::RawImageData::fixBadPixels ( )
inherited

Definition at line 232 of file RawImage.cpp.

References rawspeed::RawImageWorker::FIX_BAD_PIXELS, mBadPixelMap, startWorker(), transferBadPixelsToMap(), and uncropped_dim.

Referenced by rawspeed::RawDecoder::decodeRaw(), and setWithLookUp().

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

◆ fixBadPixelsThread()

void rawspeed::RawImageData::fixBadPixelsThread ( int start_y,
int end_y )
protectedinherited

Definition at line 298 of file RawImage.cpp.

References rawspeed::Array2DRef(), fixBadPixel(), mBadPixelMap, mBadPixelMapPitch, uncropped_dim, rawspeed::val, x, and y.

Referenced by fixBadPixel().

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

◆ getBpp()

uint32_t RAWSPEED_READONLY rawspeed::RawImageData::getBpp ( ) const
inlinenodiscardinherited

Definition at line 119 of file RawImage.h.

References bpp.

Referenced by rawspeed::LLVMFuzzerTestOneInput(), and main().

Here is the caller graph for this function:

◆ getByteDataAsUncroppedArray2DRef()

Array2DRef< std::byte > rawspeed::RawImageData::getByteDataAsUncroppedArray2DRef ( )
inlinenodiscardnoexceptinherited

Definition at line 330 of file RawImage.h.

References dataType, rawspeed::F32, getF32DataAsUncroppedArray2DRef(), getU16DataAsUncroppedArray2DRef(), and rawspeed::UINT16.

Referenced by createData(), rawspeed::RawDecoder::decodeRaw(), rawspeed::rstest::anonymous_namespace{rstest.cpp}::imgDataHash(), LLVMFuzzerTestOneInput(), and rawspeed::LLVMFuzzerTestOneInput().

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

◆ getCpp()

uint32_t RAWSPEED_READONLY rawspeed::RawImageData::getCpp ( ) const
inlinenodiscardinherited

◆ getCropOffset()

iPoint2D RAWSPEED_READONLY rawspeed::RawImageData::getCropOffset ( ) const
nodiscardinherited

Definition at line 171 of file RawImage.cpp.

References mOffset.

Referenced by rawspeed::DngOpcodes::FixBadPixelsConstant::apply(), and main().

Here is the caller graph for this function:

◆ getDataType()

rawspeed::RawImageType rawspeed::RawImageData::getDataType ( ) const
inlinenodiscardinherited

◆ getErrors()

std::vector< std::string > && rawspeed::ErrorLog::getErrors ( )
inherited

Definition at line 47 of file ErrorLog.cpp.

References mutex.

Referenced by GUARDED_BY(), and main().

Here is the caller graph for this function:

◆ getF32DataAsCroppedArray2DRef()

CroppedArray2DRef< float > rawspeed::RawImageData::getF32DataAsCroppedArray2DRef ( )
inlinenodiscardnoexceptinherited

Definition at line 324 of file RawImage.h.

References cpp, dim, getF32DataAsUncroppedArray2DRef(), and mOffset.

Referenced by rawspeed::anonymous_namespace{DngOpcodes.cpp}::getDataAsCroppedArray2DRef(), rawspeed::anonymous_namespace{DngOpcodes.cpp}::getImageCropAsRectangle(), rawspeed::RawImageDataFloat::scaleBlackWhite(), and rawspeed::RawImageDataFloat::scaleValues().

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

◆ getF32DataAsUncroppedArray2DRef()

Array2DRef< float > rawspeed::RawImageData::getF32DataAsUncroppedArray2DRef ( )
inlinenodiscardnoexceptinherited

Definition at line 310 of file RawImage.h.

References assert(), cpp, data, dataType, rawspeed::F32, pitch, and uncropped_dim.

Referenced by rawspeed::RawImageDataFloat::calculateBlackAreas(), rawspeed::RawImageDataFloat::fixBadPixel(), getByteDataAsUncroppedArray2DRef(), getF32DataAsCroppedArray2DRef(), LLVMFuzzerTestOneInput(), and rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePFM().

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

◆ getU16DataAsCroppedArray2DRef()

CroppedArray2DRef< uint16_t > rawspeed::RawImageData::getU16DataAsCroppedArray2DRef ( )
inlinenodiscardnoexceptinherited

Definition at line 304 of file RawImage.h.

References cpp, dim, getU16DataAsUncroppedArray2DRef(), and mOffset.

Referenced by rawspeed::DngOpcodes::FixBadPixelsConstant::apply(), clearArea(), rawspeed::anonymous_namespace{DngOpcodes.cpp}::getDataAsCroppedArray2DRef(), rawspeed::anonymous_namespace{DngOpcodes.cpp}::getImageCropAsRectangle(), rawspeed::RawImageDataU16::scaleBlackWhite(), and rawspeed::RawImageDataU16::scaleValues_plain().

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

◆ getU16DataAsUncroppedArray2DRef()

Array2DRef< uint16_t > rawspeed::RawImageData::getU16DataAsUncroppedArray2DRef ( )
inlinenodiscardnoexceptinherited

Definition at line 290 of file RawImage.h.

References assert(), cpp, data, dataType, pitch, rawspeed::UINT16, and uncropped_dim.

Referenced by rawspeed::RafDecoder::applyCorrections(), anonymous_namespace{Cr2sRawInterpolatorBenchmark.cpp}::BM_Cr2sRawInterpolator(), rawspeed::RawImageDataU16::calculateBlackAreas(), rawspeed::RawImageDataU16::doLookup(), rawspeed::RawImageDataU16::fixBadPixel(), getByteDataAsUncroppedArray2DRef(), getU16DataAsCroppedArray2DRef(), LLVMFuzzerTestOneInput(), rawspeed::Cr2Decoder::sRawInterpolate(), and rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePPM().

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

◆ getUncroppedDim()

iPoint2D RAWSPEED_READONLY rawspeed::RawImageData::getUncroppedDim ( ) const
nodiscardinherited

Definition at line 167 of file RawImage.cpp.

References uncropped_dim.

Referenced by rawspeed::DngOpcodes::FixBadPixelsList::FixBadPixelsList(), anonymous_namespace{main.cpp}::BM_RawSpeed(), LLVMFuzzerTestOneInput(), main(), rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePFM(), and rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePPM().

Here is the caller graph for this function:

◆ GUARDED_BY()

std::vector< uint32_t > mBadPixelPositions rawspeed::RawImageData::GUARDED_BY ( mBadPixelMutex )
inherited

References mBadPixelMutex.

◆ isAllocated()

bool rawspeed::RawImageData::isAllocated ( ) const
inlinenodiscardinherited

Definition at line 152 of file RawImage.h.

References data, and isAllocated().

Referenced by createBadPixelMap(), createData(), isAllocated(), and setCpp().

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

◆ isTooManyErrors()

bool rawspeed::ErrorLog::isTooManyErrors ( unsigned many,
std::string * firstErr = nullptr )
inherited

Definition at line 34 of file ErrorLog.cpp.

References mutex.

◆ poisonPadding()

void rawspeed::RawImageData::poisonPadding ( )
inherited

Definition at line 127 of file RawImage.cpp.

Referenced by createData().

Here is the caller graph for this function:

◆ scaleBlackWhite()

◆ scaleValues()

void rawspeed::RawImageDataU16::scaleValues ( int start_y,
int end_y )
overrideprivatevirtual

Implements rawspeed::RawImageData.

Definition at line 185 of file RawImageDataU16.cpp.

References rawspeed::implicit_cast(), scaleValues_plain(), rawspeed::Cpuid::SSE2(), and rawspeed::RawImageData::whitePoint.

Here is the call graph for this function:

◆ scaleValues_plain()

void rawspeed::RawImageDataU16::scaleValues_plain ( int start_y,
int end_y )
private

Definition at line 345 of file RawImageDataU16.cpp.

References assert(), rawspeed::RawImageData::blackLevelSeparate, rawspeed::clampBits(), rawspeed::RawImageData::cpp, rawspeed::RawImageData::dim, rawspeed::RawImageData::getU16DataAsCroppedArray2DRef(), rawspeed::implicit_cast(), rawspeed::RawImageData::mDitherScale, rawspeed::RawImageData::mOffset, rawspeed::RawImageData::whitePoint, x, and y.

Referenced by scaleValues().

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

◆ setCpp()

void rawspeed::RawImageData::setCpp ( uint32_t val)
inherited

Definition at line 153 of file RawImage.cpp.

References bpp, cpp, isAllocated(), ThrowRDE, and rawspeed::val.

Referenced by CreateRawImage().

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

◆ setError()

void rawspeed::ErrorLog::setError ( const std::string & err)
inherited

Definition at line 29 of file ErrorLog.cpp.

References mutex.

◆ setTable() [1/2]

void rawspeed::RawImageData::setTable ( const std::vector< uint16_t > & table_,
bool dither )
inherited

Definition at line 385 of file RawImage.cpp.

References assert(), and setTable().

Referenced by setTable(), and setWithLookUp().

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

◆ setTable() [2/2]

void rawspeed::RawImageData::setTable ( std::unique_ptr< TableLookUp > t)
inherited

Definition at line 381 of file RawImage.cpp.

References table.

◆ setWithLookUp()

void rawspeed::RawImageDataU16::setWithLookUp ( uint16_t value,
std::byte * dst,
uint32_t * random )
inlineoverridevirtual

Implements rawspeed::RawImageData.

Definition at line 345 of file RawImage.h.

References rawspeed::implicit_cast(), and rawspeed::RawImageData::table.

Here is the call graph for this function:

◆ sixteenBitLookup()

void rawspeed::RawImageData::sixteenBitLookup ( )
inherited

Definition at line 374 of file RawImage.cpp.

References rawspeed::RawImageWorker::APPLY_LOOKUP, startWorker(), and table.

Referenced by setWithLookUp().

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

◆ startWorker()

void rawspeed::RawImageData::startWorker ( RawImageWorker::RawImageWorkerTask task,
bool cropped )
protectedinherited

Definition at line 271 of file RawImage.cpp.

References dim, rawspeed::RawImageWorker::FULL_IMAGE, RawImageWorker, rawspeed_get_number_of_processor_cores(), and uncropped_dim.

Referenced by fixBadPixel(), fixBadPixels(), rawspeed::RawImageDataFloat::scaleBlackWhite(), rawspeed::RawImageDataU16::scaleBlackWhite(), and sixteenBitLookup().

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

◆ subFrame()

void rawspeed::RawImageData::subFrame ( iRectangle2D cropped)
inherited

Definition at line 175 of file RawImage.cpp.

References cfa, rawspeed::iRectangle2D::dim, dim, rawspeed::iRectangle2D::hasPositiveArea(), isCFA, rawspeed::iPoint2D::isThisInside(), mOffset, rawspeed::iRectangle2D::pos, ThrowRDE, rawspeed::WARNING, rawspeed::writeLog(), rawspeed::iPoint2D::x, and rawspeed::iPoint2D::y.

Referenced by rawspeed::DngOpcodes::TrimBounds::apply(), and LLVMFuzzerTestOneInput().

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

◆ transferBadPixelsToMap()

void rawspeed::RawImageData::transferBadPixelsToMap ( )
inherited

Definition at line 211 of file RawImage.cpp.

References assert(), createBadPixelMap(), mBadPixelMap, mBadPixelMapPitch, mBadPixelMutex, and uncropped_dim.

Referenced by fixBadPixels(), LLVMFuzzerTestOneInput(), and setWithLookUp().

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

◆ unpoisonPadding()

void rawspeed::RawImageData::unpoisonPadding ( )
inherited

Definition at line 146 of file RawImage.cpp.

◆ RawImage

friend class RawImage
friend

Definition at line 227 of file RawImage.h.

References RawImage.

Referenced by RawImage.

Member Data Documentation

◆ blackAreas

◆ blackLevel

◆ blackLevelSeparate

◆ blackLevelSeparateStorage

std::array<int, 4> rawspeed::RawImageData::blackLevelSeparateStorage
inherited

◆ bpp

int rawspeed::RawImageData::bpp = 0
protectedinherited

◆ cfa

ColorFilterArray rawspeed::RawImageData::cfa
inherited

◆ cpp

◆ data

std::vector<uint8_t, DefaultInitAllocatorAdaptor< uint8_t, AlignedAllocator<uint8_t, 16> > > rawspeed::RawImageData::data
protectedinherited

◆ dataType

◆ dim

◆ isCFA

◆ mBadPixelMap

std::vector<uint8_t, AlignedAllocator<uint8_t, 16> > rawspeed::RawImageData::mBadPixelMap
inherited

◆ mBadPixelMapPitch

uint32_t rawspeed::RawImageData::mBadPixelMapPitch = 0
inherited

◆ mBadPixelMutex

Mutex rawspeed::RawImageData::mBadPixelMutex
inherited

◆ mDitherScale

bool rawspeed::RawImageData::mDitherScale
inherited
Initial value:
=
true

Definition at line 182 of file RawImage.h.

Referenced by rawspeed::RawImageDataU16::scaleValues_plain().

◆ metadata

◆ mOffset

◆ mutex

Mutex rawspeed::ErrorLog::mutex
privateinherited

Definition at line 31 of file ErrorLog.h.

Referenced by getErrors(), GUARDED_BY(), isTooManyErrors(), and setError().

◆ padding

uint32_t rawspeed::RawImageData::padding = 0
inherited

Definition at line 159 of file RawImage.h.

Referenced by createData().

◆ pitch

int rawspeed::RawImageData::pitch = 0
inherited

◆ table

std::unique_ptr<TableLookUp> rawspeed::RawImageData::table
protectedinherited

◆ uncropped_dim

◆ whitePoint


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