H3D::H3DImageLoaderNode Class Reference
[Abstract nodes.]

H3DImageLoaderNode is a virtual base class for classes that read an image file format such as PNG or JPEG and construct an Image class with the data from the file. More...

#include <H3D/H3DImageLoaderNode.h>

Inheritance diagram for H3D::H3DImageLoaderNode:

Inheritance graph

List of all members.

Classes

struct  FileReaderRegistration
 Class used to register a class to the registered file readers. More...

Public Types

typedef bool(* SupportsFileFunc )(const string &url)
 Function ptr type for.

Public Member Functions

 H3DImageLoaderNode ()
 Constructor.
virtual ImageloadImage (const string &url)=0
 Pure virtual function to load an Image from a url.
virtual string defaultXMLContainerField ()
 TODO: Implement /virtual Image *loadImage( const istream &is ) = 0;.

Static Public Member Functions

static H3DImageLoaderNodegetSupportedFileReader (const string &url)
 Given an url to a file, it returns an instance of a H3DImageLoaderNode class that can handle that file type.
static void registerFileReader (const string &name, CreateNodeFunc create, SupportsFileFunc supports)
 Register a file reader that can then be returned by getSupportedFileReader().
static void registerFileReader (const FileReaderRegistration &fr)
 Register a file reader that can then be returned by getSupportedFileReader().


Detailed Description

H3DImageLoaderNode is a virtual base class for classes that read an image file format such as PNG or JPEG and construct an Image class with the data from the file.

Each subclass must define the loadImage () function. It is used by e.g. the ImageTexture node.


Member Function Documentation

virtual string H3D::H3DImageLoaderNode::defaultXMLContainerField (  )  [inline, virtual]

TODO: Implement /virtual Image *loadImage( const istream &is ) = 0;.

Returns the default xml containerField attribute value. For this node it is "imageLoader".

Reimplemented from H3D::Node.

H3DImageLoaderNode * H3DImageLoaderNode::getSupportedFileReader ( const string &  url  )  [static]

Given an url to a file, it returns an instance of a H3DImageLoaderNode class that can handle that file type.

If no such class is registered NULL is returned.

Referenced by H3D::ImageTexture::SFImage::loadImage(), and H3D::Image3DTexture::SFImage::loadImage().

virtual Image* H3D::H3DImageLoaderNode::loadImage ( const string &  url  )  [pure virtual]

Pure virtual function to load an Image from a url.

Returns:
An Image * with the image data loaded from the url.

Implemented in H3D::FreeImageLoader, and H3D::RawImageLoader.

static void H3D::H3DImageLoaderNode::registerFileReader ( const FileReaderRegistration fr  )  [inline, static]

Register a file reader that can then be returned by getSupportedFileReader().

static void H3D::H3DImageLoaderNode::registerFileReader ( const string &  name,
CreateNodeFunc  create,
SupportsFileFunc  supports 
) [inline, static]

Register a file reader that can then be returned by getSupportedFileReader().

Parameters:
name The name of the class
create A function for creating an instance of that class.
supports A function to determine if the class supports a given file type.

Referenced by H3D::H3DImageLoaderNode::FileReaderRegistration::FileReaderRegistration().


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

Generated on Fri Nov 7 10:30:17 2008 for H3D API by  doxygen 1.5.7