DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
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. More...
 
typedef ImageContainer::Domain Domain
 
typedef ImageContainer OutputImage
 New types. More...
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 Checking concepts. More...
 
 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. More...
 

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

Definition at line 79 of file ImageFactoryFromImage.h.

◆ 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

Definition at line 72 of file ImageFactoryFromImage.h.

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 :
93 myImagePtr(&anImage)
94 {
95 }
ImageContainer * myImagePtr
Alias on the image container.

◆ ~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()

template<typename TImageContainer >
DGtal::ImageFactoryFromImage< TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TImageContainer >)  )

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 }
const Domain & domain() const

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), and DGtal::ImageFactoryFromImage< TImageContainer >::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 {
172 typename Domain::Iterator it = outputImage->domain().begin();
173 typename Domain::Iterator it_end = outputImage->domain().end();
174 for (; it != it_end; ++it)
175 {
176 myImagePtr->setValue(*it, (*outputImage)(*it));
177 }
178 }
Iterator for HyperRectDomain.
void setValue(const Point &aPoint, const Value &aValue)

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::ImageFactoryFromImage< TImageContainer >::myImagePtr, and DGtal::ImageContainerBySTLVector< TDomain, TValue >::setValue().

◆ 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 DGtal::ImageContainerBySTLVector< TDomain, TValue >::isValid(), and DGtal::ImageFactoryFromImage< TImageContainer >::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 {
153 OutputImage* outputImage = new OutputImage(aDomain);
154
155 typename Domain::Iterator it = outputImage->domain().begin();
156 typename Domain::Iterator it_end = outputImage->domain().end();
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::ImageContainerBySTLVector< TDomain, TValue >::domain(), DGtal::ImageFactoryFromImage< TImageContainer >::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

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