Dune::Copasi
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Dune::Copasi::TIFFGrayscale Class Reference

This class describes a tiff grayscale. More...

#include <tiff_grayscale.hh>

Public Member Functions

 TIFFGrayscale (const std::filesystem::path &filename, std::size_t max_cache=8)
 Constructs a new instance.
 
const TIFFGrayscaleRow & operator[] (std::size_t row) const
 Array indexer row operator.
 
double operator() (double pos_x, double pos_y) noexcept
 TIFF value by position call operator.
 
std::size_t size () const
 The size of rows for this file.
 
std::size_t rows () const
 The size of rows for this file.
 
std::size_t cols () const
 The size of cols for this file.
 

Detailed Description

This class describes a tiff grayscale.

This class opens, closes, and query information from a single tiff image. Data can be queried using matrix like indices with the bracket operator or using space coordinates using the parenthesis operator.

Constructor & Destructor Documentation

◆ TIFFGrayscale()

Dune::Copasi::TIFFGrayscale::TIFFGrayscale ( const std::filesystem::path & filename,
std::size_t max_cache = 8 )
explicit

Constructs a new instance.

Parameters
[in]filenameThe filename
[in]max_cacheThe maximum row cache.

Member Function Documentation

◆ cols()

std::size_t Dune::Copasi::TIFFGrayscale::cols ( ) const

The size of cols for this file.

Returns
Number of cols in this file

◆ operator()()

double Dune::Copasi::TIFFGrayscale::operator() ( double pos_x,
double pos_y )
noexcept

TIFF value by position call operator.

Here we assume that TIFFTAG_RESOLUTIONUNIT has same units as the grid. Since we never check grid units, we also do not check tiff units

Parameters
[in]pos_xThe x position in same units as the tiff file
[in]pos_yThe y position in same units as the tiff file
Returns
Scaled TIFF value if x and y are in the TIFF domain, 0 otherwise

◆ operator[]()

const TIFFGrayscaleRow & Dune::Copasi::TIFFGrayscale::operator[] ( std::size_t row) const

Array indexer row operator.

Warning
Row object is only a proxy object and ... TODO
Parameters
[in]rowThe row index
Returns
The row

◆ rows()

std::size_t Dune::Copasi::TIFFGrayscale::rows ( ) const

The size of rows for this file.

Returns
Number of rows in this file

◆ size()

std::size_t Dune::Copasi::TIFFGrayscale::size ( ) const

The size of rows for this file.

Returns
Number of rows in this file

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