CVR-Lib last update 20 Sep 2009

cvr::ioImageInterface Class Reference
[Programming interfaces]

Base class to all classes that read from or write to a image file. More...

#include <cvrIOImageInterface.h>

Inheritance diagram for cvr::ioImageInterface:

Inheritance graph
[legend]
Collaboration diagram for cvr::ioImageInterface:

Collaboration graph
[legend]

List of all members.

Classes

class  headerInformation
 Common header information block. More...
class  parameters
 ioFunctor parameters class More...

Public Member Functions

 ioImageInterface ()
 ioImageInterface (const ioImageInterface &other)
virtual ~ioImageInterface ()
const parametersgetParameters () const
virtual const std::string & name () const
virtual ioImageInterfaceclone () const =0
virtual ioImageInterfacenewInstance () const =0
ioImageInterfacecopy (const ioImageInterface &other)
ioImageInterfaceoperator= (const ioImageInterface &other)
Loading images and channels
virtual bool load (const std::string &filename, image &img)=0
virtual bool load (const std::string &filename, matrix< ubyte > &chnl, palette &pal)=0
virtual bool load (const std::string &filename, matrix< ubyte > &chnl)
virtual bool load (const std::string &filename, matrix< float > &chnl)
virtual bool load (const std::string &filename, matrix< int32 > &chnl, palette &pal)
virtual bool load (const std::string &filename, matrix< int32 > &chnl)
virtual bool checkHeader (const std::string &filename, headerInformation &info)=0
Saving images and channels
virtual bool save (const std::string &filename, const image &img)=0
virtual bool save (const std::string &filename, const matrix< ubyte > &chnl, const palette &pal)=0
virtual bool save (const std::string &filename, const matrix< ubyte > &chnl)
virtual bool save (const std::string &filename, const matrix< float > &chnl)
virtual bool save (const std::string &filename, const matrix< int32 > &chnl, const palette &pal)
virtual bool save (const std::string &filename, const matrix< int32 > &chnl)

Protected Member Functions

const palettegetGrayPalette () const


Detailed Description

Base class to all classes that read from or write to a image file.

It is a very simple class with nothing but an empty definition of a parameters class with the attribute "filename".

Note that these classes cannot be considered CVR-Lib functors, as they lack the for the later mandatory apply() methods.


Constructor & Destructor Documentation

cvr::ioImageInterface::ioImageInterface (  ) 

Default constructor.

cvr::ioImageInterface::ioImageInterface ( const ioImageInterface other  ) 

Copy constructor.

virtual cvr::ioImageInterface::~ioImageInterface (  )  [virtual]

destructor


Member Function Documentation

virtual bool cvr::ioImageInterface::checkHeader ( const std::string &  filename,
headerInformation info 
) [pure virtual]

Check the file header for common information.

All classes implementing this interface usually provide additional methods to check other options of the specific file formats, or overload the headerInformation to include additional items.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual ioImageInterface* cvr::ioImageInterface::clone (  )  const [pure virtual]

Returns a pointer to a clone of the functor.

Implements cvr::object.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

ioImageInterface& cvr::ioImageInterface::copy ( const ioImageInterface other  ) 

Copy operator.

const palette& cvr::ioImageInterface::getGrayPalette (  )  const [protected]

Method to get a read-only reference to a 256 long gray-palette.

const parameters& cvr::ioImageInterface::getParameters (  )  const

returns current parameters.

Reimplemented from cvr::parametersManager.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
matrix< int32 > &  chnl 
) [virtual]

Load the contents as a integer mask.

Default implementation discards the palette of the other matrix<int32> method.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
matrix< int32 > &  chnl,
palette pal 
) [virtual]

Load the contents as a integer mask.

Default implementation returns the casting of the channel8 related method.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
matrix< float > &  chnl 
) [virtual]

Load a floating point channel.

Not many file formats support floating point channels, so the default implementation just casts a channel8 into the float.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
matrix< ubyte > &  chnl 
) [virtual]

Load the contents as a gray channel.

Default implementation just discards the palette of load(const std::string&,matrix<ubyte>&,palette&)

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
matrix< ubyte > &  chnl,
palette pal 
) [pure virtual]

Load a channel8 as a label mask with its corresponding palette.

If the file contained a color image, then the functor has to quantize the colors and returned the quantized table.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::load ( const std::string &  filename,
image img 
) [pure virtual]

Load file as a color image.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual const std::string& cvr::ioImageInterface::name (  )  const [virtual]

Returns the name of this class.

Implements cvr::object.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual ioImageInterface* cvr::ioImageInterface::newInstance (  )  const [pure virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::object.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

ioImageInterface& cvr::ioImageInterface::operator= ( const ioImageInterface other  ) 

Copy operator.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const matrix< int32 > &  chnl 
) [virtual]

Save the contents as a integer mask.

Default implementation discards the palette of the other matrix<int32> method.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const matrix< int32 > &  chnl,
const palette pal 
) [virtual]

Save the contents as a integer mask.

Default implementation returns the casting of the channel8 related method.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const matrix< float > &  chnl 
) [virtual]

Save a floating point channel.

Not many file formats support floating point channels, so the default implementation just casts the channel to a channel8, which is saved. You normally lose precision.

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const matrix< ubyte > &  chnl 
) [virtual]

Save the contents as a gray channel.

Default implementation just discards the palette of save(const std::string&,matrix<ubyte>&,palette&)

Reimplemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const matrix< ubyte > &  chnl,
const palette pal 
) [pure virtual]

Save a channel8 as a label mask with its corresponding palette.

If the file contained a color image, then the functor has to quantize the colors and returned the quantized table.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.

virtual bool cvr::ioImageInterface::save ( const std::string &  filename,
const image img 
) [pure virtual]

Save file as a color image.

Implemented in cvr::ioBMP, cvr::ioImage, cvr::ioJPEG, and cvr::ioPNG.


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

Generated on Sun Sep 20 22:08:54 2009 for CVR-Lib by Doxygen 1.5.8