Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::MagickConverter< T > Class Template Reference

#include <MagickCodec.h>

List of all members.


Detailed Description

template<class T>
class prapi::MagickConverter< T >

Converts ImageMagic images to a matrices.

This needs to be a separate class due to different template specializations for color images. This one is for gray-scale images.


Static Public Methods

const char * getColorType ()
 Return "I", since one-layer images are always intensity images.

void * getPixels (const util::Matrix< T > &mat)
 Get the pixel data from a matrix.

void destroyPixels (void *pixels)
 Destroy the pointer returned by getPixels().

T * getPixels (::Image *image) throw (util::MatrixException&)
 Get the pixel data from an ImageMagick image.

size_t getPixelSize ()
 Get the number of bytes each pixel needs for storage.


Member Function Documentation

template<class T>
const char* prapi::MagickConverter< T >::getColorType   [inline, static]
 

Return "I", since one-layer images are always intensity images.

This value is interpreted by the underlying ImageMagick library.

template<class T>
T * prapi::MagickConverter< T >::getPixels ::Image   image throw (util::MatrixException&) [static]
 

Get the pixel data from an ImageMagick image.

This method is used to convert an ImageMagick image to a matrix. The pixel array must be deallocated by the caller with delete[], if the responsibility is not given to a matrix. An example:

 Image* image = (get this somehow);
 int* data MagickConverter<int>getPixels(image);
 Matrix<int> matrix(image->rows, image->columns, data, true);
 

See also:
MagickCodec::constituteMatrix(Image*)


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.