SOFA plugin: image  master
Open source framework for multi-physics simuation
sofa::defaulttype::Image< _T > Struct Template Reference

#include <CImgData.h>

5d-image structure on top of a shared memory CImgList More...

Inheritance diagram for sofa::defaulttype::Image< _T >:

Detailed Description

template<typename _T>
struct sofa::defaulttype::Image< _T >

5d-image structure on top of a shared memory CImgList

Protected Attributes

cimg_library::CImgList< Timg
 

Public Member Functions

 Image ()
 constructors/destructors More...
 
 Image (const Image< T > &_img, bool shared=false)
 
 Image (const cimg_library::CImg< T > &_img)
 
Image< T > & operator= (const Image< T > &im)
 copy operators More...
 
Image< T > & assign (const Image< T > &im, const bool shared=false)
 
void clear ()
 
 ~Image () override
 
cimg_library::CImgList< T > & getCImgList ()
 
const cimg_library::CImgList< T > & getCImgList () const
 
cimg_library::CImg< T > & getCImg (const unsigned int t=0)
 
const cimg_library::CImg< T > & getCImg (const unsigned int t=0) const
 
bool isEmpty () const
 
template<class t >
bool isInside (t x, t y, t z) const
 check if image coordinates are inside bounds More...
 
imCoord getDimensions () const
 
void setDimensions (const imCoord &dim) override
 
void fill (const SReal val) override
 
bool operator== (const Image< T > &other) const
 
bool operator!= (const Image< T > &other) const
 
cimg_library::CImg< unsigned int > get_histogram (T &value_min, T &value_max, const unsigned int dimx, const bool mergeChannels=false) const
 
cimg_library::CImg< Tget_plane (const unsigned int coord, const unsigned int axis, const type::Mat< 2, 3, unsigned int > &ROI, const unsigned int t=0, const bool mergeChannels=false) const
 
template<typename Real >
cimg_library::CImg< bool > get_slicedModels (const unsigned int coord, const unsigned int axis, const type::Mat< 2, 3, unsigned int > &ROI, const type::vector< type::Vec< 3, Real > > &position, const type::vector< sofa::component::visual::VisualModelImpl::VisualTriangle > &triangles, const type::vector< sofa::component::visual::VisualModelImpl::VisualQuad > &quads) const
 
size_t approximativeSizeInBytes () const
 
- Public Member Functions inherited from sofa::defaulttype::BaseImage
virtual ~BaseImage ()
 

Static Public Member Functions

static const char * Name ()
 

Friends

std::istream & operator>> (std::istream &in, Image< T > &im)
 
std::ostream & operator<< (std::ostream &out, const Image< T > &im)
 

Attribute details

◆ img

template<typename _T >
cimg_library::CImgList<T> sofa::defaulttype::Image< _T >::img
protected

Constructor details

◆ Image() [1/3]

template<typename _T >
sofa::defaulttype::Image< _T >::Image ( )
inline

constructors/destructors

◆ Image() [2/3]

template<typename _T >
sofa::defaulttype::Image< _T >::Image ( const Image< T > &  _img,
bool  shared = false 
)
inline

◆ Image() [3/3]

template<typename _T >
sofa::defaulttype::Image< _T >::Image ( const cimg_library::CImg< T > &  _img)
inline

◆ ~Image()

template<typename _T >
sofa::defaulttype::Image< _T >::~Image ( )
inlineoverride

Function details

◆ approximativeSizeInBytes()

template<typename _T >
size_t sofa::defaulttype::Image< _T >::approximativeSizeInBytes ( ) const
inline
Returns
an approximative size in bytes, useful for debugging

◆ assign()

template<typename _T >
Image<T>& sofa::defaulttype::Image< _T >::assign ( const Image< T > &  im,
const bool  shared = false 
)
inline

◆ clear()

template<typename _T >
void sofa::defaulttype::Image< _T >::clear ( )
inline

◆ fill()

template<typename _T >
void sofa::defaulttype::Image< _T >::fill ( const SReal  val)
inlineoverridevirtual

◆ get_histogram()

template<typename _T >
cimg_library::CImg<unsigned int> sofa::defaulttype::Image< _T >::get_histogram ( T value_min,
T value_max,
const unsigned int  dimx,
const bool  mergeChannels = false 
) const
inline

Returns histograms of image channels (mergeChannels=false) or a single histogram of the norm (mergeChannels=true) the returned image size is [dimx,1,1,mergeChannels?1:nbChannels] Returns min / max values

◆ get_plane()

template<typename _T >
cimg_library::CImg<T> sofa::defaulttype::Image< _T >::get_plane ( const unsigned int  coord,
const unsigned int  axis,
const type::Mat< 2, 3, unsigned int > &  ROI,
const unsigned int  t = 0,
const bool  mergeChannels = false 
) const
inline

◆ get_slicedModels()

template<typename _T >
template<typename Real >
cimg_library::CImg<bool> sofa::defaulttype::Image< _T >::get_slicedModels ( const unsigned int  coord,
const unsigned int  axis,
const type::Mat< 2, 3, unsigned int > &  ROI,
const type::vector< type::Vec< 3, Real > > &  position,
const type::vector< sofa::component::visual::VisualModelImpl::VisualTriangle > &  triangles,
const type::vector< sofa::component::visual::VisualModelImpl::VisualQuad > &  quads 
) const
inline

◆ getCImg() [1/2]

template<typename _T >
cimg_library::CImg<T>& sofa::defaulttype::Image< _T >::getCImg ( const unsigned int  t = 0)
inline

◆ getCImg() [2/2]

template<typename _T >
const cimg_library::CImg<T>& sofa::defaulttype::Image< _T >::getCImg ( const unsigned int  t = 0) const
inline

◆ getCImgList() [1/2]

template<typename _T >
cimg_library::CImgList<T>& sofa::defaulttype::Image< _T >::getCImgList ( )
inline

◆ getCImgList() [2/2]

template<typename _T >
const cimg_library::CImgList<T>& sofa::defaulttype::Image< _T >::getCImgList ( ) const
inline

◆ getDimensions()

template<typename _T >
imCoord sofa::defaulttype::Image< _T >::getDimensions ( ) const
inline

◆ isEmpty()

template<typename _T >
bool sofa::defaulttype::Image< _T >::isEmpty ( ) const
inline

◆ isInside()

template<typename _T >
template<class t >
bool sofa::defaulttype::Image< _T >::isInside ( x,
y,
z 
) const
inline

check if image coordinates are inside bounds

◆ Name()

const char * sofa::defaulttype::ImageB::Name
inlinestatic

◆ operator!=()

template<typename _T >
bool sofa::defaulttype::Image< _T >::operator!= ( const Image< T > &  other) const
inline

◆ operator=()

template<typename _T >
Image<T>& sofa::defaulttype::Image< _T >::operator= ( const Image< T > &  im)
inline

copy operators

◆ operator==()

template<typename _T >
bool sofa::defaulttype::Image< _T >::operator== ( const Image< T > &  other) const
inline

◆ setDimensions()

template<typename _T >
void sofa::defaulttype::Image< _T >::setDimensions ( const imCoord dim)
inlineoverridevirtual

Enum details

◆ DimensionLabel

template<typename _T >
enum sofa::defaulttype::Image::DimensionLabel

the 5 dimension labels of an image ( x, y, z, spectrum=nb channels , time )

Enumerator
DIMENSION_X 
DIMENSION_Y 
DIMENSION_Z 
DIMENSION_S 
DIMENSION_T 
NB_DimensionLabel 

Related details

◆ operator<<

template<typename _T >
std::ostream& operator<< ( std::ostream &  out,
const Image< T > &  im 
)
friend

◆ operator>>

template<typename _T >
std::istream& operator>> ( std::istream &  in,
Image< T > &  im 
)
friend