RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rstest.cpp File Reference
#include "RawSpeed-API.h"
#include "adt/Array1DRef.h"
#include "adt/Array2DRef.h"
#include "adt/Casts.h"
#include "adt/NotARational.h"
#include "io/FileIOException.h"
#include "md5.h"
#include <array>
#include <bit>
#include <cassert>
#include <chrono>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
#include "io/MMapReader.h"
#include <iomanip>
Include dependency graph for rstest.cpp:

Go to the source code of this file.

Classes

struct  rawspeed::rstest::anonymous_namespace{rstest.cpp}::options
class  rawspeed::rstest::anonymous_namespace{rstest.cpp}::RstestHashMismatch
struct  rawspeed::rstest::anonymous_namespace{rstest.cpp}::Timer
class  ifstream
 STL class. More...
class  ofstream
 STL class. More...

Namespaces

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

Typedefs

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

Functions

md5::MD5Hasher::state_type rawspeed::rstest::anonymous_namespace{rstest.cpp}::imgDataHash (const RawImage &raw)
void rawspeed::rstest::anonymous_namespace{rstest.cpp}::__attribute__ ((format(printf, 2, 3))) APPEND(ostringstream *oss
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::va_start (args, format)
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::vsnprintf (line.data(), sizeof(line), format, args)
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::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-> rawspeed::rstest::anonymous_namespace{rstest.cpp}::getUncroppedDim ()
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::for (auto ba :r->blackAreas) APPEND(&oss
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::for (uint32_t p :r->mBadPixelPositions) APPEND(&oss
APPEND & rawspeed::rstest::anonymous_namespace{rstest.cpp}::oss (hash_of_line_hashes).c_str()
 rawspeed::rstest::anonymous_namespace{rstest.cpp}::for (const auto errors=r->getErrors();const std::string &e :errors) APPEND(&oss
WARNING e rawspeed::rstest::anonymous_namespace{rstest.cpp}::c_str ())
return oss rawspeed::rstest::anonymous_namespace{rstest.cpp}::str ()
void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePPM (const RawImage &raw, const std::string &fn)
void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writePFM (const RawImage &raw, const std::string &fn)
void rawspeed::rstest::anonymous_namespace{rstest.cpp}::writeImage (const RawImage &raw, const std::string &fn)
int64_t rawspeed::rstest::anonymous_namespace{rstest.cpp}::process (const std::string &filename, const CameraMetaData *metadata, const options &o)
int rawspeed::rstest::anonymous_namespace{rstest.cpp}::results (const map< std::string, std::string, std::less<> > &failedTests, const options &o)
int rawspeed::rstest::anonymous_namespace{rstest.cpp}::usage (const char *progname)
int main (int argc_, char **argv_)
uint16_t getU16BE (const void *data)
uint32_t getU32LE (const void *data)
constexpr uint64_t RAWSPEED_READNONE roundUp (uint64_t value, uint64_t multiple)

Variables

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

Function Documentation

◆ getU16BE()

uint16_t rawspeed::getU16BE ( const void * data)
inline

Definition at line 124 of file Endianness.h.

Referenced by rawspeed_test::anonymous_namespace{EndiannessTest.cpp}::TEST_P(), and rawspeed_test::anonymous_namespace{EndiannessTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ getU32LE()

uint32_t rawspeed::getU32LE ( const void * data)
inline

Definition at line 127 of file Endianness.h.

Referenced by rawspeed_test::anonymous_namespace{EndiannessTest.cpp}::TEST_P(), and rawspeed_test::anonymous_namespace{EndiannessTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ main()

int main ( int argc_,
char ** argv_ )

Definition at line 547 of file rstest.cpp.

References rawspeed::Array1DRef(), rawspeed::implicit_cast(), and metadata.

Here is the call graph for this function:

◆ roundUp()

uint64_t RAWSPEED_READNONE rawspeed::roundUp ( uint64_t value,
uint64_t multiple )
constexpr

Definition at line 134 of file Common.h.