Wildmeshing Toolkit
wmtk::components::adaptive_tessellation::image::Image Class Reference

#include <Image.hpp>

Public Member Functions

 Image ()=default
 
 Image (int height_, int width_)
 
ImageMatrixfref_raw_image ()
 
const ImageMatrixfget_raw_image () const
 
int width () const
 
int height () const
 
template<class T >
std::decay_t< T > get (const T &u, const T &v) const
 
float get_pixel (const int i, const int j) const
 
std::pair< int, int > get_pixel_index (const double &u, const double &v) const
 
int get_coordinate (const int x, const WrappingMode mode) const
 
WrappingMode get_wrapping_mode_x () const
 
WrappingMode get_wrapping_mode_y () const
 
bool set (const std::function< float(const double &, const double &)> &f, const WrappingMode mode_x=WrappingMode::CLAMP_TO_EDGE, const WrappingMode mode_y=WrappingMode::CLAMP_TO_EDGE)
 
bool set (const int r, const int c, const float v)
 
bool save (const std::filesystem::path &path) const
 
void load (const std::filesystem::path &path, WrappingMode mode_x, WrappingMode mode_y)
 
void set_wrapping_mode (WrappingMode mode_x, WrappingMode mode_y)
 
Image down_sample () const
 

Protected Attributes

ImageMatrixf m_image
 
WrappingMode m_mode_x = WrappingMode::CLAMP_TO_EDGE
 
WrappingMode m_mode_y = WrappingMode::CLAMP_TO_EDGE
 

Private Types

using DScalar = DScalar2< double, Eigen::Matrix< double, -1, 1 >, Eigen::Matrix< double, -1, -1 > >
 
using ImageMatrixf = Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor|Eigen::AutoAlign >
 

Detailed Description

Definition at line 18 of file Image.hpp.

Member Typedef Documentation

◆ DScalar

using wmtk::components::adaptive_tessellation::image::Image::DScalar = DScalar2<double, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1> >
private

Definition at line 20 of file Image.hpp.

◆ ImageMatrixf

using wmtk::components::adaptive_tessellation::image::Image::ImageMatrixf = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor | Eigen::AutoAlign>
private

Definition at line 21 of file Image.hpp.

Constructor & Destructor Documentation

◆ Image() [1/2]

wmtk::components::adaptive_tessellation::image::Image::Image ( )
default

◆ Image() [2/2]

wmtk::components::adaptive_tessellation::image::Image::Image ( int  height_,
int  width_ 
)
inline

Definition at line 31 of file Image.hpp.

References m_image.

Member Function Documentation

◆ down_sample()

Image wmtk::components::adaptive_tessellation::image::Image::down_sample ( ) const

Definition at line 145 of file Image.cpp.

References height(), m_image, set(), and width().

Here is the call graph for this function:

◆ get()

template<class T >
std::decay_t< T > wmtk::components::adaptive_tessellation::image::Image::get ( const T &  u,
const T &  v 
) const
Parameters
pcoordinates between (0,1)
Returns
/

Definition at line 72 of file Image.hpp.

References wmtk::components::adaptive_tessellation::image::eval_bicubic_coeffs(), wmtk::components::adaptive_tessellation::image::extract_samples(), wmtk::components::adaptive_tessellation::image::get_bicubic_matrix(), wmtk::components::adaptive_tessellation::image::get_value(), height(), m_image, m_mode_x, m_mode_y, and width().

Here is the call graph for this function:

◆ get_coordinate()

int wmtk::components::adaptive_tessellation::image::Image::get_coordinate ( const int  x,
const WrappingMode  mode 
) const

Definition at line 26 of file Image.cpp.

References wmtk::components::adaptive_tessellation::image::CLAMP_TO_EDGE, height(), wmtk::components::adaptive_tessellation::image::MIRROR_REPEAT, wmtk::components::adaptive_tessellation::image::REPEAT, and width().

Here is the call graph for this function:

◆ get_pixel()

float wmtk::components::adaptive_tessellation::image::Image::get_pixel ( const int  i,
const int  j 
) const
inline

Definition at line 43 of file Image.hpp.

References m_image.

◆ get_pixel_index()

std::pair< int, int > wmtk::components::adaptive_tessellation::image::Image::get_pixel_index ( const double &  u,
const double &  v 
) const

Definition at line 46 of file Image.cpp.

References height(), and width().

Here is the call graph for this function:

◆ get_raw_image()

const ImageMatrixf& wmtk::components::adaptive_tessellation::image::Image::get_raw_image ( ) const
inline

Definition at line 34 of file Image.hpp.

References m_image.

Referenced by wmtk::components::adaptive_tessellation::image::SamplingBicubic::sample_T().

Here is the caller graph for this function:

◆ get_wrapping_mode_x()

WrappingMode wmtk::components::adaptive_tessellation::image::Image::get_wrapping_mode_x ( ) const
inline

Definition at line 46 of file Image.hpp.

References m_mode_x.

Referenced by wmtk::components::adaptive_tessellation::image::SamplingBicubic::sample_T().

Here is the caller graph for this function:

◆ get_wrapping_mode_y()

WrappingMode wmtk::components::adaptive_tessellation::image::Image::get_wrapping_mode_y ( ) const
inline

Definition at line 47 of file Image.hpp.

References m_mode_y.

Referenced by wmtk::components::adaptive_tessellation::image::SamplingBicubic::sample_T().

Here is the caller graph for this function:

◆ height()

int wmtk::components::adaptive_tessellation::image::Image::height ( ) const
inline

Definition at line 39 of file Image.hpp.

References m_image.

Referenced by down_sample(), get(), get_coordinate(), get_pixel_index(), wmtk::components::adaptive_tessellation::image::SamplingBicubic::sample_T(), wmtk::components::adaptive_tessellation::image::SamplingImage< Derived >::SamplingImage(), save(), and set().

Here is the caller graph for this function:

◆ load()

void wmtk::components::adaptive_tessellation::image::Image::load ( const std::filesystem::path &  path,
WrappingMode  mode_x,
WrappingMode  mode_y 
)

Definition at line 113 of file Image.cpp.

References wmtk::components::adaptive_tessellation::image::load_image_exr_red_channel(), wmtk::logger(), m_image, and set_wrapping_mode().

Here is the call graph for this function:

◆ ref_raw_image()

ImageMatrixf& wmtk::components::adaptive_tessellation::image::Image::ref_raw_image ( )
inline

Definition at line 33 of file Image.hpp.

References m_image.

◆ save()

bool wmtk::components::adaptive_tessellation::image::Image::save ( const std::filesystem::path &  path) const

Definition at line 84 of file Image.cpp.

References height(), wmtk::logger(), m_image, wmtk::components::adaptive_tessellation::image::save_image_exr_red_channel(), and width().

Here is the call graph for this function:

◆ set() [1/2]

bool wmtk::components::adaptive_tessellation::image::Image::set ( const int  r,
const int  c,
const float  v 
)
inline

Definition at line 52 of file Image.hpp.

References m_image.

◆ set() [2/2]

bool wmtk::components::adaptive_tessellation::image::Image::set ( const std::function< float(const double &, const double &)> &  f,
const WrappingMode  mode_x = WrappingMode::CLAMP_TO_EDGE,
const WrappingMode  mode_y = WrappingMode::CLAMP_TO_EDGE 
)

Definition at line 61 of file Image.cpp.

References height(), m_image, set_wrapping_mode(), and width().

Referenced by wmtk::components::adaptive_tessellation::image::buffer_to_image(), and down_sample().

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

◆ set_wrapping_mode()

void wmtk::components::adaptive_tessellation::image::Image::set_wrapping_mode ( WrappingMode  mode_x,
WrappingMode  mode_y 
)
inline

Definition at line 60 of file Image.hpp.

References m_mode_x, and m_mode_y.

Referenced by load(), and set().

Here is the caller graph for this function:

◆ width()

int wmtk::components::adaptive_tessellation::image::Image::width ( ) const
inline

Definition at line 38 of file Image.hpp.

References m_image.

Referenced by down_sample(), get(), get_coordinate(), get_pixel_index(), wmtk::components::adaptive_tessellation::image::SamplingBicubic::sample_T(), wmtk::components::adaptive_tessellation::image::SamplingImage< Derived >::SamplingImage(), save(), and set().

Here is the caller graph for this function:

Member Data Documentation

◆ m_image

ImageMatrixf wmtk::components::adaptive_tessellation::image::Image::m_image
protected

◆ m_mode_x

WrappingMode wmtk::components::adaptive_tessellation::image::Image::m_mode_x = WrappingMode::CLAMP_TO_EDGE
protected

Definition at line 26 of file Image.hpp.

Referenced by get(), get_wrapping_mode_x(), and set_wrapping_mode().

◆ m_mode_y

WrappingMode wmtk::components::adaptive_tessellation::image::Image::m_mode_y = WrappingMode::CLAMP_TO_EDGE
protected

Definition at line 27 of file Image.hpp.

Referenced by get(), get_wrapping_mode_y(), and set_wrapping_mode().


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