Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
anonymous_namespace{tiffsource.cc} Namespace Reference

Typedefs

using TagInfo = std::pair< ttag_t, std::string >
 

Functions

template<typename T >
TIFFGetFieldChecked (const TIFFPtr &file, const TagInfo &tag)
 
template<typename T >
TIFFGetFieldCheckedOr (const TIFFPtr &file, const TagInfo &tag, T default_value)
 
bool approx (const BitmapMetaData &left, const BitmapMetaData &right)
 
void TIFFCloseUnlessNull (TIFF *tif)
 

Typedef Documentation

◆ TagInfo

using anonymous_namespace{tiffsource.cc}::TagInfo = typedef std::pair<ttag_t, std::string>

Function Documentation

◆ approx()

bool anonymous_namespace{tiffsource.cc}::approx ( const BitmapMetaData left,
const BitmapMetaData right 
)
45 {
46 return left.type == right.type && left.bitsPerSample == right.bitsPerSample && left.samplesPerPixel == right.samplesPerPixel
47 && left.rect == right.rect && static_cast<bool>(left.colormapHelper) == static_cast<bool>(right.colormapHelper);
48 }
Segment< int > const right(3, 7)
std::string type
Definition opentiledbitmapinterface.hh:44
ColormapHelperBase::Ptr colormapHelper
Definition opentiledbitmapinterface.hh:49
unsigned int bitsPerSample
Definition opentiledbitmapinterface.hh:45
unsigned int samplesPerPixel
Definition opentiledbitmapinterface.hh:46
Scroom::Utils::Rectangle< int > rect
Definition opentiledbitmapinterface.hh:47

◆ TIFFCloseUnlessNull()

void anonymous_namespace{tiffsource.cc}::TIFFCloseUnlessNull ( TIFF *  tif)
51 {
52 if(tif)
53 {
54 TIFFClose(tif);
55 }
56 }

◆ TIFFGetFieldChecked()

template<typename T >
T anonymous_namespace{tiffsource.cc}::TIFFGetFieldChecked ( const TIFFPtr &  file,
const TagInfo tag 
)
20 {
21 T result{};
22
23 if(1 != TIFFGetField(file.get(), tag.first, &result))
24 {
25 throw std::invalid_argument("Field not present in tiff file: " + std::string(tag.second));
26 }
27
28 return result;
29 }
SampleIterator< const uint8_t > result
Definition sampleiterator-tests.cc:94

◆ TIFFGetFieldCheckedOr()

template<typename T >
T anonymous_namespace{tiffsource.cc}::TIFFGetFieldCheckedOr ( const TIFFPtr &  file,
const TagInfo tag,
default_value 
)
33 {
34 T result{};
35
36 if(1 != TIFFGetField(file.get(), tag.first, &result))
37 {
38 return default_value;
39 }
40
41 return result;
42 }