ML Reference
MeVis/Foundation/Sources/ML/include/mlTSubImage.h File Reference

This file defines the class TSubImage to administrate/manage/access typed images or subimages which reside in memory. More...

#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 >
 Cursor to access const data of a TSubImage. More...
class  ml::TSubImageCursor< DATATYPE >
 Cursor to access data of a TSubImage for reading and writing. More...
class  ml::TSubImageWithCursor< DATATYPE >
 A class that offers a TSubImage with a TSubImageCursor. More...

Namespaces

namespace  ml
 

Define the namespace name like in the ML. Default is ml.


namespace  std
 

Provide trigonometric etc.


Defines

#define _ML_TSUBIMG_SUBDOT6(pos, offset, stride)
 Private helper macro for calculation of memory offset, calculates (pos-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.
#define _ML_TSUBIMG_SUBDOT3(x, y, z, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.
#define _ML_TSUBIMG_SUBDOT2(x, y, offset, stride)
 Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.
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.
Deprecated
#define TSubImg   TSubImage
#define ConstTSubImgCursor   ConstTSubImageCursor
#define TSubImgCursor   TSubImageCursor
#define TSubImgWithCursor   TSubImageWithCursor

Functions

template<typename T >
TSubImage< T > * ml::tsubimg_cast (SubImage *subImg)
template<typename T >
const TSubImage< T > * ml::tsubimg_cast (const SubImage *subImg)
template<typename T >
TSubImage< T > & ml::tsubimg_cast (SubImage &subImg)
template<typename T >
const TSubImage< T > & ml::tsubimg_cast (const SubImage &subImg)
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>
template<typename T >
TSubImage< T > & ml::tsubimage_cast (SubImage &subImg)
 The tsubimage_cast allows to cast a SubImage (pointer or reference) to a typed TSubImage<T> (pointer or reference).
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)

Detailed Description

This file defines the class TSubImage to administrate/manage/access typed images or subimages which reside in memory.

Author:
Dirk Selle, Wolf Spindler, Florian Link
Date:
9/2009

Definition in file mlTSubImage.h.


Define Documentation

#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( )",                                   \
                     ML_BAD_POINTER_OR_0,                                             \
                     "Valid data pointers in source and target subimage required for" \
                     "subimage copying, thus call is ignored.");                      \
      return;                                                                         \
    }                                                                                 \
  }

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

Definition at line 541 of file mlTSubImage.h.

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

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

Private helper macro for calculation of memory offset, calculates ((xy)-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.

Definition at line 89 of file mlTSubImage.h.

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

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

Private helper macro for calculation of memory offset, calculates ((xyz)-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.

Definition at line 82 of file mlTSubImage.h.

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

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

Private helper macro for calculation of memory offset, calculates (pos-offset) * stride Optimized for 32bit offset, since memory addresses can not be larger than 32bit.

Definition at line 72 of file mlTSubImage.h.

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

#define ConstTSubImgCursor   ConstTSubImageCursor
Deprecated:
Use ConstTSubImageCursor instead of ConstTSubImgCursor.

(MACRO_RENAME)

Definition at line 1246 of file mlTSubImage.h.

#define TSubImg   TSubImage
Deprecated:
Use TSubImage instead of TSubImg.

(MACRO_RENAME)

Definition at line 1006 of file mlTSubImage.h.

#define TSubImgCursor   TSubImageCursor
Deprecated:
Use TSubImageCursor instead of TSubImgCursor.

(MACRO_RENAME)

Definition at line 1335 of file mlTSubImage.h.

#define TSubImgWithCursor   TSubImageWithCursor
Deprecated:
Use TSubImageWithCursor instead of TSubImgWithCursor.

(MACRO_RENAME)

Definition at line 1573 of file mlTSubImage.h.