Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

sedris::seHelperImage Class Reference
[Utility Classes]

#include <seHelperImage.h>

List of all members.

Public Member Functions

 seHelperImage ()
 Constructor.

 seHelperImage (const seHelperImage &other)
 Copy constructor.

seHelperImageoperator= (const seHelperImage &other)
 Assignment.

virtual ~seHelperImage ()
 Destructor.

void init (seDRMImage &image, SE_Short_Integer_Unsigned mip_level, const SE_Desired_Image_Parameters *des_params=NULL)
SE_Byte_Unsigned * getImageData ()
SE_Integer_Unsigned getImageDataSize ()
 Returns the number of bytes in the (possibly rearranged) image data.


Static Public Member Functions

SE_Integer_Unsigned getRearrangedDataSize (const SE_Desired_Image_Parameters *des_params, SE_Integer_Unsigned size_horizontal, SE_Integer_Unsigned size_vertical, SE_Integer_Unsigned size_z)

Protected Member Functions

void reset ()
 Resets the helper's data.


Protected Attributes

SE_Byte_Unsigned * _data
SE_Integer_Unsigned _data_size


Detailed Description

A helper for reading <Image> data. seHelperImage takes care of memory management and rearrangement of image data. Since the image data is managed by this class (users don't need to free it), you can keep an instance of this class as long as you need access to the image's data. This is true even if the transmittal is closed or the image object used to initialize the helper goes out of scope.

Sample use:

    SE_Desired_Image_Parameters desired_param;
    seHelperImage hlpr;
    seDRMImage image;

    //... retrieve the "image" object, choose MIP level to retrieve
    //... fill out "desired_param" as needed

    hlpr.init(image, mip_level, &desired_param);

    unsigned char *data_ptr = ima_helper.getImageData();

    //... access the image data in "data_ptr"

Warning:
Be careful when using this class in STL containers, since some operations may require copy/reallocation of data which could adversely impact performance.
Author:
Warren Macchi


Constructor & Destructor Documentation

sedris::seHelperImage::seHelperImage  ) 
 

sedris::seHelperImage::seHelperImage const seHelperImage other  ) 
 

virtual sedris::seHelperImage::~seHelperImage  )  [virtual]
 


Member Function Documentation

SE_Byte_Unsigned* sedris::seHelperImage::getImageData  )  [inline]
 

Returns the pointer to the image data. Since the image data is managed by this class (users don't need to free it), you can keep an instance of this class as long as you need access to the image's data. This is true even if the transmittal is closed or the image object used to initialize the helper goes out of scope.

SE_Integer_Unsigned sedris::seHelperImage::getImageDataSize  )  [inline]
 

SE_Integer_Unsigned sedris::seHelperImage::getRearrangedDataSize const SE_Desired_Image_Parameters *  des_params,
SE_Integer_Unsigned  size_horizontal,
SE_Integer_Unsigned  size_vertical,
SE_Integer_Unsigned  size_z
[static]
 

Returns the number of bytes in a rearranged image data. Normally you would not need to use this method. It is provided in case you want to know the size of an image that you are planning to rearrange (possibly to make a choice as to whether to proceed to use the helper or not).

Parameters:
des_params in: the parameters for the rearranging
size_horizontal in: the horizontal size of the image
size_vertical in: the vertical size of the image
size_z in: the z size of the image

void sedris::seHelperImage::init seDRMImage image,
SE_Short_Integer_Unsigned  mip_level,
const SE_Desired_Image_Parameters *  des_params = NULL
 

Initializes the helper and retrieves the image data. The mip_level must be < image's level count (0-based). Optional des_params causes a rearranging of the image data.

Note:
After calling this function, any previous data allocated by this class is freed (hence all previously returned pointers become invalid).
Parameters:
image in: the <Image> object to retrieve data from
mip_level in: the MIP level desired
des_params in (optional): if provided, instructs the helper to rearrange the image data

seHelperImage& sedris::seHelperImage::operator= const seHelperImage other  ) 
 

void sedris::seHelperImage::reset  )  [protected]
 


Member Data Documentation

SE_Byte_Unsigned* sedris::seHelperImage::_data [protected]
 

SE_Integer_Unsigned sedris::seHelperImage::_data_size [protected]
 


The documentation for this class was generated from the following file:
SEDRIS Transmittal Access C++ API 4.0.0 beta - 14 Jul 2004
Copyright © 2004 SEDRIS Docs by Doxygen 1.3.2