File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::ImageFactoryFromImage< TImageContainer > Class Template Reference

Aim: implements a factory to produce images from a "bigger/original" one according to a given domain. More...

#include <DGtal/images/ImageFactoryFromImage.h>

Public Types

typedef ImageFactoryFromImage< TImageContainerSelf
typedef TImageContainer ImageContainer
 Types copied from the container.
typedef ImageContainer::Domain Domain
typedef ImageContainer OutputImage
 New types.

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 Checking concepts.
 ImageFactoryFromImage (Alias< ImageContainer > anImage)
 ~ImageFactoryFromImage ()
const Domaindomain () const
void selfDisplay (std::ostream &out) const
bool isValid () const
OutputImagerequestImage (const Domain &aDomain)
void flushImage (OutputImage *outputImage)
void detachImage (OutputImage *outputImage)

Protected Attributes

ImageContainermyImagePtr
 Alias on the image container.

Private Member Functions

 ImageFactoryFromImage (const ImageFactoryFromImage &other)
ImageFactoryFromImageoperator= (const ImageFactoryFromImage &other)

Detailed Description

template<typename TImageContainer>
class DGtal::ImageFactoryFromImage< TImageContainer >

Aim: implements a factory to produce images from a "bigger/original" one according to a given domain.

Description of template class 'ImageFactoryFromImage'

Template Parameters
TImageContaineran image container type (model of CImage).

The factory images production (images are copied, so it's a creation process) is done with the function 'requestImage' so the deletion must be done with the function 'detachImage'.

The update of the original image is done with the function 'flushImage'.

Examples
images/exampleImageFactoryFromHDF5.cpp, and images/exampleTiledImage.cpp.

Definition at line 66 of file ImageFactoryFromImage.h.

Member Typedef Documentation

◆ Domain

◆ ImageContainer

template<typename TImageContainer>
typedef TImageContainer DGtal::ImageFactoryFromImage< TImageContainer >::ImageContainer

Types copied from the container.

Definition at line 78 of file ImageFactoryFromImage.h.

◆ OutputImage

template<typename TImageContainer>
typedef ImageContainer DGtal::ImageFactoryFromImage< TImageContainer >::OutputImage

New types.

Definition at line 82 of file ImageFactoryFromImage.h.

◆ Self

Constructor & Destructor Documentation

◆ ImageFactoryFromImage() [1/2]

template<typename TImageContainer>
DGtal::ImageFactoryFromImage< TImageContainer >::ImageFactoryFromImage ( Alias< ImageContainer > anImage)
inline

Constructor.

Parameters
anImagealias on the underlying image container.

Definition at line 92 of file ImageFactoryFromImage.h.

92 :
94 {
95 }
Aim: implements a factory to produce images from a "bigger/original" one according to a given domain.
ImageContainer * myImagePtr
Alias on the image container.

References myImagePtr.

Referenced by ImageFactoryFromImage(), and operator=().

◆ ~ImageFactoryFromImage()

Destructor. Does nothing

Definition at line 101 of file ImageFactoryFromImage.h.

101{}

◆ ImageFactoryFromImage() [2/2]

template<typename TImageContainer>
DGtal::ImageFactoryFromImage< TImageContainer >::ImageFactoryFromImage ( const ImageFactoryFromImage< TImageContainer > & other)
private

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

Checking concepts.

◆ detachImage()

template<typename TImageContainer>
void DGtal::ImageFactoryFromImage< TImageContainer >::detachImage ( OutputImage * outputImage)
inline

Free (i.e. delete) an OutputImage.

Parameters
outputImagethe OutputImage.

Definition at line 185 of file ImageFactoryFromImage.h.

186 {
187 delete outputImage;
188 }

◆ domain()

template<typename TImageContainer>
const Domain & DGtal::ImageFactoryFromImage< TImageContainer >::domain ( ) const
inline

Returns a reference to the underlying image domain.

Returns
a reference to the domain.

Definition at line 119 of file ImageFactoryFromImage.h.

120 {
121 return myImagePtr->domain();
122 }

References myImagePtr.

◆ flushImage()

template<typename TImageContainer>
void DGtal::ImageFactoryFromImage< TImageContainer >::flushImage ( OutputImage * outputImage)
inline

Flush (i.e. write/synchronize) an OutputImage.

Parameters
outputImagethe OutputImage.

Definition at line 170 of file ImageFactoryFromImage.h.

171 {
174 for (; it != it_end; ++it)
175 {
176 myImagePtr->setValue(*it, (*outputImage)(*it));
177 }
178 }
const ConstIterator & begin() const
HyperRectDomain_Iterator< Point > Iterator
Typedef of domain iterators.
const ConstIterator & end() const

References DGtal::HyperRectDomain< TSpace >::begin(), DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::HyperRectDomain< TSpace >::end(), and myImagePtr.

◆ isValid()

template<typename TImageContainer>
bool DGtal::ImageFactoryFromImage< TImageContainer >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

Definition at line 139 of file ImageFactoryFromImage.h.

140 {
141 return (myImagePtr->isValid());
142 }

References myImagePtr.

◆ operator=()

◆ requestImage()

template<typename TImageContainer>
OutputImage * DGtal::ImageFactoryFromImage< TImageContainer >::requestImage ( const Domain & aDomain)
inline

Returns a pointer of an OutputImage created with the Domain aDomain.

Parameters
aDomainthe domain.
Returns
an ImagePtr.

Definition at line 151 of file ImageFactoryFromImage.h.

152 {
154
157 for (; it != it_end; ++it)
158 {
159 outputImage->setValue(*it, (*myImagePtr)(*it));
160 }
161
162 return outputImage;
163 }
ImageContainer OutputImage
New types.

References DGtal::HyperRectDomain< TSpace >::begin(), DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::HyperRectDomain< TSpace >::end(), myImagePtr, and DGtal::ImageContainerBySTLVector< TDomain, TValue >::setValue().

◆ selfDisplay()

template<typename TImageContainer>
void DGtal::ImageFactoryFromImage< TImageContainer >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myImagePtr

template<typename TImageContainer>
ImageContainer* DGtal::ImageFactoryFromImage< TImageContainer >::myImagePtr
protected

Alias on the image container.

Default constructor.

Definition at line 201 of file ImageFactoryFromImage.h.

Referenced by domain(), flushImage(), ImageFactoryFromImage(), isValid(), and requestImage().


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