Scroom  0.14
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 
)
47  {
48  return left.type == right.type && left.bitsPerSample == right.bitsPerSample && left.samplesPerPixel == right.samplesPerPixel
49  && left.rect == right.rect && static_cast<bool>(left.colormapHelper) == static_cast<bool>(right.colormapHelper);
50  }

Referenced by Scroom::Tiff::Source::reset().

Here is the caller graph for this function:

◆ TIFFCloseUnlessNull()

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

Referenced by Scroom::Tiff::open().

Here is the caller graph for this function:

◆ TIFFGetFieldChecked()

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

◆ TIFFGetFieldCheckedOr()

template<typename T >
T anonymous_namespace{tiffsource.cc}::TIFFGetFieldCheckedOr ( const TIFFPtr &  file,
const TagInfo tag,
default_value 
)
35  {
36  T result{};
37 
38  if(1 != TIFFGetField(file.get(), tag.first, &result))
39  {
40  return default_value;
41  }
42 
43  return result;
44  }
Scroom::TiledBitmap::BitmapMetaData::samplesPerPixel
unsigned int samplesPerPixel
Definition: opentiledbitmapinterface.hh:45
Scroom::TiledBitmap::BitmapMetaData::bitsPerSample
unsigned int bitsPerSample
Definition: opentiledbitmapinterface.hh:44
Scroom::TiledBitmap::BitmapMetaData::rect
Scroom::Utils::Rectangle< int > rect
Definition: opentiledbitmapinterface.hh:46
Scroom::TiledBitmap::BitmapMetaData::colormapHelper
ColormapHelperBase::Ptr colormapHelper
Definition: opentiledbitmapinterface.hh:48
Scroom::TiledBitmap::BitmapMetaData::type
std::string type
Definition: opentiledbitmapinterface.hh:43