Optimized Belief Propagation (CPU and GPU)
BpImage< T > Class Template Reference

Class to define images that are used in bp processing. More...

#include <BpImage.h>

Inheritance diagram for BpImage< T >:

Public Member Functions

 BpImage ()
 
 BpImage (const std::array< unsigned int, 2 > &width_height)
 
 BpImage (const std::array< unsigned int, 2 > &width_height, const T *input_pixel_vals)
 
 BpImage (const std::string &file_name)
 
const std::unique_ptr< T[]> & UniquePtrToPixelData () const
 
T * PointerToPixelsStart () const
 
PixelAtPoint (const std::array< unsigned int, 2 > &point_xy) const
 
PixelAtPoint (unsigned int i) const
 
void SetPixelAtPoint (const std::array< unsigned int, 2 > &point_xy, T val)
 
void SetPixelAtPoint (unsigned int i, T val)
 
unsigned int Width () const
 
unsigned int Height () const
 
void SaveImageAsPgm (const std::string &filename) const
 

Protected Member Functions

void LoadImageAsGrayScale (const std::string &file_path_image)
 
void pnm_read (std::ifstream &file, std::string &buf) const
 
BpImage< unsigned char > ImageRead (const std::string &file_name, beliefprop::ImageType image_type, bool weighted_rgb_conversion=true) const
 
unsigned int TotalPixels () const
 

Protected Attributes

std::array< unsigned int, 2 > width_height_
 
std::unique_ptr< T[]> pixels_
 

Detailed Description

template<class T>
class BpImage< T >

Class to define images that are used in bp processing.

Template Parameters
T

Definition at line 56 of file BpImage.h.

Constructor & Destructor Documentation

◆ BpImage() [1/4]

template<class T >
BpImage< T >::BpImage ( )
inline

Definition at line 58 of file BpImage.h.

◆ BpImage() [2/4]

template<class T >
BpImage< T >::BpImage ( const std::array< unsigned int, 2 > &  width_height)
inlineexplicit

Definition at line 60 of file BpImage.h.

◆ BpImage() [3/4]

template<class T >
BpImage< T >::BpImage ( const std::array< unsigned int, 2 > &  width_height,
const T *  input_pixel_vals 
)
inlineexplicit

Definition at line 65 of file BpImage.h.

Here is the call graph for this function:

◆ BpImage() [4/4]

template<class T >
BpImage< T >::BpImage ( const std::string &  file_name)
inlineexplicit

Definition at line 77 of file BpImage.h.

Here is the call graph for this function:

Member Function Documentation

◆ Height()

template<class T >
unsigned int BpImage< T >::Height ( ) const
inline

Definition at line 106 of file BpImage.h.

Here is the caller graph for this function:

◆ ImageRead()

template<class T >
requires std::is_arithmetic_v< T > BpImage< unsigned char > BpImage< T >::ImageRead ( const std::string &  file_name,
beliefprop::ImageType  image_type,
bool  weighted_rgb_conversion = true 
) const
protected

Definition at line 90 of file BpImage.cpp.

◆ LoadImageAsGrayScale()

template<class T >
requires std::is_arithmetic_v< T > void BpImage< T >::LoadImageAsGrayScale ( const std::string &  file_path_image)
protected

Definition at line 31 of file BpImage.cpp.

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

◆ PixelAtPoint() [1/2]

template<class T >
T BpImage< T >::PixelAtPoint ( const std::array< unsigned int, 2 > &  point_xy) const
inline

Definition at line 89 of file BpImage.h.

Here is the caller graph for this function:

◆ PixelAtPoint() [2/2]

template<class T >
T BpImage< T >::PixelAtPoint ( unsigned int  i) const
inline

Definition at line 93 of file BpImage.h.

◆ pnm_read()

template<class T >
requires std::is_arithmetic_v< T > void BpImage< T >::pnm_read ( std::ifstream &  file,
std::string &  buf 
) const
protected

Definition at line 72 of file BpImage.cpp.

◆ PointerToPixelsStart()

template<class T >
T* BpImage< T >::PointerToPixelsStart ( ) const
inline

Definition at line 85 of file BpImage.h.

Here is the caller graph for this function:

◆ SaveImageAsPgm()

template<class T >
void BpImage< T >::SaveImageAsPgm ( const std::string &  filename) const
inline

Definition at line 108 of file BpImage.h.

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

◆ SetPixelAtPoint() [1/2]

template<class T >
void BpImage< T >::SetPixelAtPoint ( const std::array< unsigned int, 2 > &  point_xy,
val 
)
inline

Definition at line 97 of file BpImage.h.

◆ SetPixelAtPoint() [2/2]

template<class T >
void BpImage< T >::SetPixelAtPoint ( unsigned int  i,
val 
)
inline

Definition at line 101 of file BpImage.h.

◆ TotalPixels()

template<class T >
unsigned int BpImage< T >::TotalPixels ( ) const
inlineprotected

Definition at line 130 of file BpImage.h.

Here is the caller graph for this function:

◆ UniquePtrToPixelData()

template<class T >
const std::unique_ptr<T[]>& BpImage< T >::UniquePtrToPixelData ( ) const
inline

Definition at line 81 of file BpImage.h.

◆ Width()

template<class T >
unsigned int BpImage< T >::Width ( ) const
inline

Definition at line 105 of file BpImage.h.

Here is the caller graph for this function:

Member Data Documentation

◆ pixels_

template<class T >
std::unique_ptr<T[]> BpImage< T >::pixels_
protected

Definition at line 118 of file BpImage.h.

◆ width_height_

template<class T >
std::array<unsigned int, 2> BpImage< T >::width_height_
protected

Definition at line 117 of file BpImage.h.


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