C++ Bitmap Library  release
Public Member Functions | List of all members
response_image< T > Class Template Reference

#include <bitmap_image.hpp>

Public Member Functions

 response_image (const std::size_t &width, const std::size_t &height, const T null=T(0))
 
std::size_t width () const
 
std::size_t height () const
 
void set_all (const T &t)
 
const T & operator() (const std::size_t &x, const std::size_t &y) const
 
T & operator() (const std::size_t &x, const std::size_t &y)
 
bool valid (const std::size_t &x, const std::size_t &y)
 
void inc_all (const T &v)
 
void mul_all (const T &v)
 
T * row (const std::size_t &row_index)
 
const T * row (const std::size_t &row_index) const
 

Detailed Description

template<typename T>
class response_image< T >

Definition at line 2988 of file bitmap_image.hpp.

Constructor & Destructor Documentation

◆ response_image()

template<typename T>
response_image< T >::response_image ( const std::size_t &  width,
const std::size_t &  height,
const T  null = T(0) 
)
inline

Definition at line 2992 of file bitmap_image.hpp.

2993  : width_ (width ),
2994  height_(height),
2995  null_ (null )
2996  {
2997  data_.resize(width_ * height_);
2998  }
std::size_t height() const
std::size_t width() const

Member Function Documentation

◆ height()

template<typename T>
std::size_t response_image< T >::height ( ) const
inline

Definition at line 3001 of file bitmap_image.hpp.

Referenced by sobel_operator().

3001 { return height_; }
Here is the caller graph for this function:

◆ inc_all()

template<typename T>
void response_image< T >::inc_all ( const T &  v)
inline

Definition at line 3029 of file bitmap_image.hpp.

3030  {
3031  for (std::size_t i = 0; i < data_.size(); ++i)
3032  {
3033  data_[i] += v;
3034  }
3035  }

◆ mul_all()

template<typename T>
void response_image< T >::mul_all ( const T &  v)
inline

Definition at line 3037 of file bitmap_image.hpp.

3038  {
3039  for (std::size_t i = 0; i < data_.size(); ++i)
3040  {
3041  data_[i] *= v;
3042  }
3043  }

◆ operator()() [1/2]

template<typename T>
const T& response_image< T >::operator() ( const std::size_t &  x,
const std::size_t &  y 
) const
inline

Definition at line 3008 of file bitmap_image.hpp.

3009  {
3010  if (y >= height_) return null_;
3011  if (x >= width_ ) return null_;
3012 
3013  return data_[width_ * y + x];
3014  }

◆ operator()() [2/2]

template<typename T>
T& response_image< T >::operator() ( const std::size_t &  x,
const std::size_t &  y 
)
inline

Definition at line 3016 of file bitmap_image.hpp.

3017  {
3018  if (y >= height_) return null_;
3019  if (x >= width_ ) return null_;
3020 
3021  return data_[width_ * y + x];
3022  }

◆ row() [1/2]

template<typename T>
T* response_image< T >::row ( const std::size_t &  row_index)
inline

Definition at line 3045 of file bitmap_image.hpp.

Referenced by sobel_operator().

3046  {
3047  if (row_index < height_)
3048  return &data_[width_ * row_index];
3049  else
3050  return reinterpret_cast<T*>(0);
3051  }
Here is the caller graph for this function:

◆ row() [2/2]

template<typename T>
const T* response_image< T >::row ( const std::size_t &  row_index) const
inline

Definition at line 3053 of file bitmap_image.hpp.

3054  {
3055  if (row_index < height_)
3056  return data_[width_ * row_index];
3057  else
3058  return reinterpret_cast<T*>(0);
3059  }

◆ set_all()

template<typename T>
void response_image< T >::set_all ( const T &  t)
inline

Definition at line 3003 of file bitmap_image.hpp.

3004  {
3005  std::fill_n(data_.begin(), data_.size(), t);
3006  }

◆ valid()

template<typename T>
bool response_image< T >::valid ( const std::size_t &  x,
const std::size_t &  y 
)
inline

Definition at line 3024 of file bitmap_image.hpp.

3025  {
3026  return ((x < width_ ) || (y < height_));
3027  }

◆ width()

template<typename T>
std::size_t response_image< T >::width ( ) const
inline

Definition at line 3000 of file bitmap_image.hpp.

Referenced by sobel_operator().

3000 { return width_; }
Here is the caller graph for this function:

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