RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rawspeed::rstest::anonymous_namespace{rstest.cpp} Namespace Reference

Classes

struct  options
class  RstestHashMismatch
struct  Timer

Typedefs

using file_ptr = std::unique_ptr<FILE, decltype(fclose)>

Functions

md5::MD5Hasher::state_type imgDataHash (const RawImage &raw)
void __attribute__ ((format(printf, 2, 3))) APPEND(ostringstream *oss
 va_start (args, format)
 vsnprintf (line.data(), sizeof(line), format, args)
 va_end (args)
*oss<< line.data();}std::string img_hash(const RawImage &r, bool noSamples) { ostringstream oss;if(noSamples) APPEND(&oss, "camera support status is unknown due to lack of samples\n");APPEND(&oss, "make: %s\n", r->metadata.make.c_str());APPEND(&oss, "model: %s\n", r->metadata.model.c_str());APPEND(&oss, "mode: %s\n", r->metadata.mode.c_str());APPEND(&oss, "canonical_make: %s\n", r->metadata.canonical_make.c_str());APPEND(&oss, "canonical_model: %s\n", r->metadata.canonical_model.c_str());APPEND(&oss, "canonical_alias: %s\n", r->metadata.canonical_alias.c_str());APPEND(&oss, "canonical_id: %s\n", r->metadata.canonical_id.c_str());APPEND(&oss, "isoSpeed: %d\n", r->metadata.isoSpeed);APPEND(&oss, "blackLevel: %d\n", r->blackLevel);APPEND(&oss, "whitePoint: ");if(!r->whitePoint) APPEND(&oss, "unknown");else APPEND(&oss, "%d", *r->whitePoint);APPEND(&oss, "\n");APPEND(&oss, "blackLevelSeparate: ");if(!r->blackLevelSeparate) { APPEND(&oss, "none");} else { APPEND(&oss, "(%i x %i)", r->blackLevelSeparate->width(), r->blackLevelSeparate->height());if(auto blackLevelSeparate1D=r->blackLevelSeparate->getAsArray1DRef();blackLevelSeparate1D &&blackLevelSeparate1D->size() !=0) { for(auto l :*blackLevelSeparate1D) APPEND(&oss, " %d", l);} } APPEND(&oss, "\n");APPEND(&oss, "wbCoeffs:");if(!r->metadata.wbCoeffs) APPEND(&oss, " (none)");else { for(const auto &e :*r->metadata.wbCoeffs) APPEND(&oss, " %f", implicit_cast< double >(e));} APPEND(&oss, "\n");APPEND(&oss, "colorMatrix:");if(r->metadata.colorMatrix.empty()) APPEND(&oss, " (none)");else { for(const NotARational< int > &e :r->metadata.colorMatrix) APPEND(&oss, " %i/%i", e.num, e.den);} APPEND(&oss, "\n");APPEND(&oss, "isCFA: %d\n", r->isCFA);APPEND(&oss, "cfa: %s\n", r->cfa.asString().c_str());APPEND(&oss, "filters: 0x%x\n", r->cfa.getDcrawFilter());APPEND(&oss, "bpp: %u\n", r->getBpp());APPEND(&oss, "cpp: %u\n", r->getCpp());APPEND(&oss, "dataType: %u\n", static_cast< unsigned >(r->getDataType()));const iPoint2D dimUncropped=r-> getUncroppedDim ()
 for (auto ba :r->blackAreas) APPEND(&oss
 for (uint32_t p :r->mBadPixelPositions) APPEND(&oss
APPEND & oss (hash_of_line_hashes).c_str()
 for (const auto errors=r->getErrors();const std::string &e :errors) APPEND(&oss
WARNING e c_str ())
return oss str ()
void writePPM (const RawImage &raw, const std::string &fn)
void writePFM (const RawImage &raw, const std::string &fn)
void writeImage (const RawImage &raw, const std::string &fn)
int64_t process (const std::string &filename, const CameraMetaData *metadata, const options &o)
int results (const map< std::string, std::string, std::less<> > &failedTests, const options &o)
int usage (const char *progname)

Variables

void const char * format
void const char va_list args
APPEND & oss
const iPoint2D cropTL = r->getCropOffset()
__pad0__
d ba isVertical
d ba ba offset
d ba ba ba size
 u
 p
rawspeed::md5::MD5Hasher::state_type hash_of_line_hashes = imgDataHash(r)
WARNING __pad1__
auto fclose = [](std::FILE* fp) { std::fclose(fp); }

Typedef Documentation

◆ file_ptr

using rawspeed::rstest::anonymous_namespace{rstest.cpp}::file_ptr = std::unique_ptr<FILE, decltype(fclose)>

Definition at line 267 of file rstest.cpp.

Function Documentation

◆ __attribute__()

void rawspeed::rstest::anonymous_namespace{rstest.cpp}::__attribute__ ( (format(printf, 2, 3)) )

References format, and oss.

◆ c_str()

WARNING e rawspeed::rstest::anonymous_namespace{rstest.cpp}::c_str ( )

Referenced by oss(), writePFM(), and writePPM().

Here is the caller graph for this function:

◆ for() [1/3]

rawspeed::rstest::anonymous_namespace{rstest.cpp}::for ( auto ba :r-> blackAreas) &

◆ for() [2/3]

rawspeed::rstest::anonymous_namespace{rstest.cpp}::for ( const auto errors = r->getErrors(); const std::string& e : errors) &

◆ for() [3/3]

rawspeed::rstest::anonymous_namespace{rstest.cpp}::for ( uint32_t p :r-> mBadPixelPositions) &

References p.

◆ getUncroppedDim()

*oss<< line.data();}std::string img_hash(const RawImage &r, bool noSamples) { ostringstream oss;if(noSamples) APPEND(&oss, "camera support status is unknown due to lack of samples\n");APPEND(&oss, "make: %s\n", r->metadata.make.c_str());APPEND(&oss, "model: %s\n", r->metadata.model.c_str());APPEND(&oss, "mode: %s\n", r->metadata.mode.c_str());APPEND(&oss, "canonical_make: %s\n", r->metadata.canonical_make.c_str());APPEND(&oss, "canonical_model: %s\n", r->metadata.canonical_model.c_str());APPEND(&oss, "canonical_alias: %s\n", r->metadata.canonical_alias.c_str());APPEND(&oss, "canonical_id: %s\n", r->metadata.canonical_id.c_str());APPEND(&oss, "isoSpeed: %d\n", r->metadata.isoSpeed);APPEND(&oss, "blackLevel: %d\n", r->blackLevel);APPEND(&oss, "whitePoint: ");if(!r->whitePoint) APPEND(&oss, "unknown");else APPEND(&oss, "%d", *r->whitePoint);APPEND(&oss, "\n");APPEND(&oss, "blackLevelSeparate: ");if(!r->blackLevelSeparate) { APPEND(&oss, "none");} else { APPEND(&oss, "(%i x %i)", r->blackLevelSeparate->width(), r->blackLevelSeparate->height());if(auto blackLevelSeparate1D=r->blackLevelSeparate->getAsArray1DRef();blackLevelSeparate1D &&blackLevelSeparate1D->size() !=0) { for(auto l :*blackLevelSeparate1D) APPEND(&oss, " %d", l);} } APPEND(&oss, "\n");APPEND(&oss, "wbCoeffs:");if(!r->metadata.wbCoeffs) APPEND(&oss, " (none)");else { for(const auto &e :*r->metadata.wbCoeffs) APPEND(&oss, " %f", implicit_cast< double >(e));} APPEND(&oss, "\n");APPEND(&oss, "colorMatrix:");if(r->metadata.colorMatrix.empty()) APPEND(&oss, " (none)");else { for(const NotARational< int > &e :r->metadata.colorMatrix) APPEND(&oss, " %i/%i", e.num, e.den);} APPEND(&oss, "\n");APPEND(&oss, "isCFA: %d\n", r->isCFA);APPEND(&oss, "cfa: %s\n", r->cfa.asString().c_str());APPEND(&oss, "filters: 0x%x\n", r->cfa.getDcrawFilter());APPEND(&oss, "bpp: %u\n", r->getBpp());APPEND(&oss, "cpp: %u\n", r->getCpp());APPEND(&oss, "dataType: %u\n", static_cast< unsigned >(r->getDataType()));const iPoint2D dimUncropped=r-> rawspeed::rstest::anonymous_namespace{rstest.cpp}::getUncroppedDim ( )

◆ imgDataHash()

md5::MD5Hasher::state_type rawspeed::rstest::anonymous_namespace{rstest.cpp}::imgDataHash ( const RawImage & raw)

Definition at line 128 of file rstest.cpp.

References rawspeed::RawImageData::getByteDataAsUncroppedArray2DRef(), rawspeed::Array2DRef< T >::height(), imgDataHash(), and rawspeed::Array2DRef< T >::width().

Referenced by imgDataHash().

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

◆ oss()

APPEND & rawspeed::rstest::anonymous_namespace{rstest.cpp}::oss ( hash_of_line_hashes )

References c_str(), hash_of_line_hashes, rawspeed::md5::hash_to_string(), and oss.

Here is the call graph for this function:

◆ process()

int64_t rawspeed::rstest::anonymous_namespace{rstest.cpp}::process ( const std::string & filename,
const CameraMetaData * metadata,
const options & o )

Definition at line 367 of file rstest.cpp.

References rawspeed::buf, rawspeed::rstest::anonymous_namespace{rstest.cpp}::options::create, rawspeed::rstest::anonymous_namespace{rstest.cpp}::options::dump, rawspeed::rstest::anonymous_namespace{rstest.cpp}::options::force, rawspeed::MMapReader::getAsBuffer(), rawspeed::RawParser::getDecoder(), metadata, process(), and writeImage().

Referenced by process().

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

◆ results()

int rawspeed::rstest::anonymous_namespace{rstest.cpp}::results ( const map< std::string, std::string, std::less<> > & failedTests,
const options & o )

Definition at line 467 of file rstest.cpp.

References rawspeed::rstest::anonymous_namespace{rstest.cpp}::options::create, and results().

Referenced by results().

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

◆ str()

return oss rawspeed::rstest::anonymous_namespace{rstest.cpp}::str ( )

References oss.

◆ usage()

int rawspeed::rstest::anonymous_namespace{rstest.cpp}::usage ( const char * progname)

Definition at line 512 of file rstest.cpp.

References usage().

Referenced by usage().

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

◆ va_end()

rawspeed::rstest::anonymous_namespace{rstest.cpp}::va_end ( args )

References args, and oss.

◆ va_start()

rawspeed::rstest::anonymous_namespace{rstest.cpp}::va_start ( args ,
format  )

References args, and format.

◆ vsnprintf()

rawspeed::rstest::anonymous_namespace{rstest.cpp}::vsnprintf ( line. data(),
sizeof(line) ,
format ,
args  )

References args, and format.

◆ writeImage()

void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writeImage ( const RawImage & raw,
const std::string & fn )

Definition at line 355 of file rstest.cpp.

References rawspeed::F32, rawspeed::RawImageData::getDataType(), rawspeed::UINT16, writeImage(), writePFM(), and writePPM().

Referenced by process(), and writeImage().

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

◆ writePFM()

void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePFM ( const RawImage & raw,
const std::string & fn )

Definition at line 297 of file rstest.cpp.

References assert(), c_str(), fclose, format, rawspeed::RawImageData::getCpp(), rawspeed::RawImageData::getF32DataAsUncroppedArray2DRef(), rawspeed::getU32LE(), rawspeed::RawImageData::getUncroppedDim(), rawspeed::implicit_cast(), rawspeed::isAligned(), rawspeed::roundUp(), ThrowFIE, writePFM(), rawspeed::iPoint2D::x, x, rawspeed::iPoint2D::y, and y.

Referenced by writeImage(), and writePFM().

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

◆ writePPM()

void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePPM ( const RawImage & raw,
const std::string & fn )

Definition at line 269 of file rstest.cpp.

References c_str(), fclose, format, rawspeed::RawImageData::getCpp(), rawspeed::getU16BE(), rawspeed::RawImageData::getU16DataAsUncroppedArray2DRef(), rawspeed::RawImageData::getUncroppedDim(), ThrowFIE, writePPM(), rawspeed::iPoint2D::x, x, rawspeed::iPoint2D::y, and y.

Referenced by writeImage(), and writePPM().

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

Variable Documentation

◆ __pad0__

d rawspeed::rstest::anonymous_namespace{rstest.cpp}::__pad0__

Definition at line 241 of file rstest.cpp.

◆ __pad1__

WARNING rawspeed::rstest::anonymous_namespace{rstest.cpp}::__pad1__

Definition at line 261 of file rstest.cpp.

◆ args

void const char va_list rawspeed::rstest::anonymous_namespace{rstest.cpp}::args
Initial value:
{
std::array<char, 1024> line

Definition at line 156 of file rstest.cpp.

Referenced by va_end(), va_start(), and vsnprintf().

◆ cropTL

const iPoint2D rawspeed::rstest::anonymous_namespace{rstest.cpp}::cropTL = r->getCropOffset()

Definition at line 230 of file rstest.cpp.

◆ fclose

auto rawspeed::rstest::anonymous_namespace{rstest.cpp}::fclose = [](std::FILE* fp) { std::fclose(fp); }

Definition at line 266 of file rstest.cpp.

Referenced by writePFM(), and writePPM().

◆ format

void const char* rawspeed::rstest::anonymous_namespace{rstest.cpp}::format

Definition at line 153 of file rstest.cpp.

Referenced by __attribute__(), va_start(), vsnprintf(), writePFM(), and writePPM().

◆ hash_of_line_hashes

rawspeed::md5::MD5Hasher::state_type rawspeed::rstest::anonymous_namespace{rstest.cpp}::hash_of_line_hashes = imgDataHash(r)

Definition at line 256 of file rstest.cpp.

Referenced by oss().

◆ isVertical

d ba rawspeed::rstest::anonymous_namespace{rstest.cpp}::isVertical

Definition at line 241 of file rstest.cpp.

◆ offset

d ba ba rawspeed::rstest::anonymous_namespace{rstest.cpp}::offset

Definition at line 241 of file rstest.cpp.

◆ oss

APPEND & rawspeed::rstest::anonymous_namespace{rstest.cpp}::oss

Definition at line 228 of file rstest.cpp.

Referenced by __attribute__(), oss(), str(), and va_end().

◆ p

rawspeed::rstest::anonymous_namespace{rstest.cpp}::p

Definition at line 251 of file rstest.cpp.

Referenced by for().

◆ size

d ba ba ba rawspeed::rstest::anonymous_namespace{rstest.cpp}::size

Definition at line 241 of file rstest.cpp.

◆ u

rawspeed::rstest::anonymous_namespace{rstest.cpp}::u

Definition at line 251 of file rstest.cpp.