ML Reference
mlTSubImage.h File Reference
#include "mlInitSystemML.h"
#include "mlSubImage.h"
#include "mlTypeTraits.h"
#include "mlTemplateSupport.h"

Go to the source code of this file.

Classes

class  ml::TSubImage< DATATYPE >
 This template class manages/represents a rectangular 6d image region in memory which is organized linearly. More...
 
class  ml::TSubImageCursorBase< DATATYPE >
 Base class for all TSubImage Cursors. More...
 
class  ml::ConstTSubImageCursor< DATATYPE >
 Predeclaration for const cursor. More...
 
class  ml::TSubImageCursor< DATATYPE >
 Predeclaration for cursor. More...
 
class  ml::TSubImageWithCursor< DATATYPE >
 A class that offers a TSubImage with a TSubImageCursor. More...
 

Namespaces

namespace  ml
 Main documentation file for ML users and developers.
 
namespace  std
 STL namespace.
 

Macros

#define _ML_TSUBIMG_SUBDOT6(pos, offset, stride)
 Private helper macro for calculation of memory offset, calculates (pos-offset) * stride.
 
#define _ML_TSUBIMG_SUBDOT3(x, y, z, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride.
 
#define _ML_TSUBIMG_SUBDOT2(x, y, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride.
 
Copying voxel from one subimage to another
#define _ML_CHECK_SUBIMAGE_DATA_POINTERS(FROM_PTR, TO_PTR)
 Internal helper macro to check validity of data pointers of subimages.
 

Functions

template<typename DATATYPE >
ostream & std::operator<< (ostream &ostr, const ml::TSubImage< DATATYPE > &v)
 Implement print of subimage into std::ostream.
 
Casting of SubImage to TSubImage<T>

The tsubimage_cast allows to cast a SubImage (pointer or reference) to a typed TSubImage<T> (pointer or reference).

If the cast is not possible because the datatype of the SubImage does not match the T of tsubimage_cast<T>, a fatal ML error occurs.

Usage:

TSubImage<MLfloat>& tsubimg = tsubimage_cast<MLfloat>(subimg);
This template class manages/represents a rectangular 6d image region in memory which is organized lin...
template<typename T >
TSubImage< T > & ml::tsubimage_cast (SubImage &subImg)
 
template<typename T >
const TSubImage< T > & ml::tsubimage_cast (const SubImage &subImg)
 
template<typename T >
TSubImage< T > * ml::tsubimage_cast (SubImage *subImg)
 
template<typename T >
const TSubImage< T > * ml::tsubimage_cast (const SubImage *subImg)
 

Macro Definition Documentation

◆ _ML_CHECK_SUBIMAGE_DATA_POINTERS

#define _ML_CHECK_SUBIMAGE_DATA_POINTERS ( FROM_PTR,
TO_PTR )
Value:
/* Check for valid data pointers to avoid memory access errors. */ \
{ \
if (!FROM_PTR || !TO_PTR){ \
ML_PRINT_ERROR("TSubImage::copySubImageTyped( )", \
"Valid data pointers in source and target subimage required for" \
"subimage copying, thus call is ignored."); \
return; \
} \
}
#define ML_BAD_POINTER_OR_0
A pointer is NULL or a value is NULL or 0 where it should not be; this sometimes indicates a memory a...
Definition mlTypeDefs.h:933

Internal helper macro to check validity of data pointers of subimages.

Definition at line 482 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved(), and ml::TSubImage< DATATYPE >::copySubImageTyped().

◆ _ML_TSUBIMG_SUBDOT2

#define _ML_TSUBIMG_SUBDOT2 ( x,
y,
offset,
stride )
Value:
(((x) - (offset).x) * (stride).x + \
((y) - (offset).y) * (stride).y)

Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride.

Definition at line 59 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::getImageValue(), and ml::TSubImage< DATATYPE >::setImageValue().

◆ _ML_TSUBIMG_SUBDOT3

#define _ML_TSUBIMG_SUBDOT3 ( x,
y,
z,
offset,
stride )
Value:
(((x) - (offset).x) * (stride).x + \
((y) - (offset).y) * (stride).y + \
((z) - (offset).z) * (stride).z)

Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride.

Definition at line 53 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::getImagePointer(), ml::TSubImage< DATATYPE >::getImagePointer(), ml::TSubImageWithCursor< DATATYPE >::setCursorImagePosition(), and ml::TSubImageCursorBase< DATATYPE >::setImagePosition().

◆ _ML_TSUBIMG_SUBDOT6

#define _ML_TSUBIMG_SUBDOT6 ( pos,
offset,
stride )
Value:
(((pos).x - (offset).x) * (stride).x + \
((pos).y - (offset).y) * (stride).y + \
((pos).z - (offset).z) * (stride).z + \
((pos).c - (offset).c) * (stride).c + \
((pos).t - (offset).t) * (stride).t + \
((pos).u - (offset).u) * (stride).u)

Private helper macro for calculation of memory offset, calculates (pos-offset) * stride.

Definition at line 44 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved(), ml::TSubImage< DATATYPE >::getImagePointer(), ml::TSubImage< DATATYPE >::getImagePointer(), ml::TSubImageWithCursor< DATATYPE >::setCursorImagePosition(), and ml::TSubImageCursorBase< DATATYPE >::setImagePosition().