Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvBitmapStreamer Class Referenceabstract

Bitmap streamer base class. More...

#include <ilviews/bitmaps/streamer.h>

Inheritance diagram for IlvBitmapStreamer:
IlvValueInterface IlvBMPStreamer IlvGIFStreamer IlvJPGStreamer IlvPNGStreamer IlvPPMStreamer IlvRGBStreamer IlvTIFFStreamer IlvWBMPStreamer

Public Member Functions

virtual void callReadProgressCallback (IlUInt current, IlUInt max)
 Calls the callback for read progression. More...
 
virtual void callWriteProgressCallback (IlUInt current, IlUInt max)
 Calls the callback for write progression. More...
 
virtual IlBoolean canRead () const
 Indicates whether the instance can read from a stream. Default is IlFalse. More...
 
virtual IlBoolean canWrite () const
 Indicates whether the instance can write to a stream. Default is IlFalse. More...
 
virtual IlBoolean checkSignature (const IlUChar *data, IlUInt size)=0
 Indicates whether the instance can handle the stream. More...
 
virtual const char * getName () const
 Returns the internal name of the streamer. More...
 
IlvQuantizergetQuantizer () const
 Returns the quantizer used by this streamer. More...
 
virtual IlvBitmapDataread (std::istream &stream)
 Reads from a stream. More...
 
virtual IlvBitmapInformationreadInfo (std::istream &stream)
 Reads information from a stream. More...
 
void setQuantizer (IlvQuantizer *quantizer)
 Sets the quantizer used (if needed) by this streamer. More...
 
virtual void setReadProgressCallback (IlvProgressCallback rpCallback, IlAny arg=0)
 Sets the callback for read progression. More...
 
virtual void setWriteProgressCallback (IlvProgressCallback wpCallback, IlAny arg=0)
 Sets the callback for write progression. More...
 
virtual IlBoolean write (IlvBitmapData *bitmapData, std::ostream &stream)
 Writes an IlvBitmapData to a stream. More...
 
- Public Member Functions inherited from IlvValueInterface
virtual IlBoolean applyValue (const IlvValue &value)
 Apply an accessor. More...
 
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the value of an accessor. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count=0)
 Changes several accessor values simultaneously. More...
 
virtual void getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const
 Retrieves the list of available accessors of an object. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Retrieves an accessor value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Retrieves multiple accessor values simultaneously. More...
 

Static Public Member Functions

static IlvBitmapStreamerGet (const char *name)
 Returns a streamer from its name. More...
 
static IlvBitmapStreamer ** GetRegisteredStreamers (IlUInt &count)
 Returns the registered streamers. More...
 
static IlvBitmapRead (IlvDisplay *display, std::istream &stream, const IlUChar *signature, IlUInt signatureLen)
 Reads a bitmap using the registered streamers. More...
 
static IlvBitmapDataReadBitmapData (std::istream &stream, const IlUChar *signature, IlUInt signatureLen)
 Reads bitmap data using the registered streamers. More...
 
static IlvBitmapInformationReadInfo (std::istream &stream, const IlUChar *signature, IlUInt signatureLen)
 Reads bitmap information using the registered streamers. More...
 
static void Register (IlvBitmapStreamer *streamer)
 Registers the given streamer. More...
 
static IlBoolean UnRegister (IlvBitmapStreamer *streamer)
 Unregisters the given streamer. More...
 

Detailed Description

Bitmap streamer base class.

Library: xviews or winviews or mviews (mutually exclusive)

This class provides methods to read/write IlvBitmapData from/to a stream. This is a virtual class that must be subclassed. The stream can be checked for a specific format signature. A bitmap streamer can declare if it knows how to read or write. When reading or writing, callbacks can be called to indicate progression.

Member Function Documentation

◆ callReadProgressCallback()

virtual void IlvBitmapStreamer::callReadProgressCallback ( IlUInt  current,
IlUInt  max 
)
virtual

Calls the callback for read progression.

Parameters
currentThe current read progress value.
maxThe maximum read progress value.

◆ callWriteProgressCallback()

virtual void IlvBitmapStreamer::callWriteProgressCallback ( IlUInt  current,
IlUInt  max 
)
virtual

Calls the callback for write progression.

Parameters
currentThe current write progress value.
maxThe maximum write progress value.

◆ canRead()

virtual IlBoolean IlvBitmapStreamer::canRead ( ) const
virtual

Indicates whether the instance can read from a stream. Default is IlFalse.

Returns
IlTrue if the instance can read from a stream.

Reimplemented in IlvWBMPStreamer, IlvTIFFStreamer, IlvRGBStreamer, IlvPPMStreamer, IlvPNGStreamer, IlvJPGStreamer, IlvGIFStreamer, and IlvBMPStreamer.

◆ canWrite()

virtual IlBoolean IlvBitmapStreamer::canWrite ( ) const
virtual

Indicates whether the instance can write to a stream. Default is IlFalse.

Returns
IlTrue if the instance can write to a stream.

Reimplemented in IlvWBMPStreamer, IlvTIFFStreamer, IlvRGBStreamer, IlvPPMStreamer, IlvPNGStreamer, IlvJPGStreamer, IlvGIFStreamer, and IlvBMPStreamer.

◆ checkSignature()

virtual IlBoolean IlvBitmapStreamer::checkSignature ( const IlUChar data,
IlUInt  size 
)
pure virtual

Indicates whether the instance can handle the stream.

Parameters
dataThe stream signature.
sizeThe size of the stream signature.
Returns
IlTrue if the instance recognizes the signature.

Implemented in IlvWBMPStreamer, IlvTIFFStreamer, IlvRGBStreamer, IlvPPMStreamer, IlvPNGStreamer, IlvJPGStreamer, IlvGIFStreamer, and IlvBMPStreamer.

◆ Get()

static IlvBitmapStreamer* IlvBitmapStreamer::Get ( const char *  name)
static

Returns a streamer from its name.

Parameters
nameThe name of the streamer.

◆ getName()

virtual const char* IlvBitmapStreamer::getName ( ) const
virtual

Returns the internal name of the streamer.

Returns
The name of the streamer.

Reimplemented from IlvValueInterface.

◆ getQuantizer()

IlvQuantizer* IlvBitmapStreamer::getQuantizer ( ) const

Returns the quantizer used by this streamer.

Returns
The quantizer.

◆ GetRegisteredStreamers()

static IlvBitmapStreamer** IlvBitmapStreamer::GetRegisteredStreamers ( IlUInt count)
static

Returns the registered streamers.

Parameters
countThe number of registered streamers.
Returns
An array of count streamers.

◆ Read()

static IlvBitmap* IlvBitmapStreamer::Read ( IlvDisplay display,
std::istream &  stream,
const IlUChar signature,
IlUInt  signatureLen 
)
static

Reads a bitmap using the registered streamers.

Parameters
displayThe display to use.
streamThe stream to read from.
signatureThe first bytes of the stream.
signatureLenThe size of the signature.

◆ read()

virtual IlvBitmapData* IlvBitmapStreamer::read ( std::istream &  stream)
virtual

Reads from a stream.

Parameters
streamThe stream to read from.
Returns
An instance of IlvBitmapData.

Reimplemented in IlvPNGStreamer, and IlvGIFStreamer.

◆ ReadBitmapData()

static IlvBitmapData* IlvBitmapStreamer::ReadBitmapData ( std::istream &  stream,
const IlUChar signature,
IlUInt  signatureLen 
)
static

Reads bitmap data using the registered streamers.

Parameters
streamThe stream to read from.
signatureThe first bytes of the stream.
signatureLenThe size of the signature.

◆ readInfo()

virtual IlvBitmapInformation* IlvBitmapStreamer::readInfo ( std::istream &  stream)
virtual

Reads information from a stream.

Parameters
streamThe stream to read from.
Returns
An instance of IlvBitmapInformation.

◆ ReadInfo()

static IlvBitmapInformation* IlvBitmapStreamer::ReadInfo ( std::istream &  stream,
const IlUChar signature,
IlUInt  signatureLen 
)
static

Reads bitmap information using the registered streamers.

Parameters
streamThe stream to read from.
signatureThe first bytes of the stream.
signatureLenThe size of the signature.

◆ Register()

static void IlvBitmapStreamer::Register ( IlvBitmapStreamer streamer)
static

Registers the given streamer.

Parameters
streamerThe streamer to register.

◆ setQuantizer()

void IlvBitmapStreamer::setQuantizer ( IlvQuantizer quantizer)

Sets the quantizer used (if needed) by this streamer.

Parameters
quantizerThe new quantizer.

◆ setReadProgressCallback()

virtual void IlvBitmapStreamer::setReadProgressCallback ( IlvProgressCallback  rpCallback,
IlAny  arg = 0 
)
virtual

Sets the callback for read progression.

The callback indicating read progression will be called. The arguments of the callback will be the current bitmap streamer, the current read progress value, the maximum read progress value, and a user-defined argument.

Parameters
rpCallbackThe read progression callback.
argA user-defined argument.

◆ setWriteProgressCallback()

virtual void IlvBitmapStreamer::setWriteProgressCallback ( IlvProgressCallback  wpCallback,
IlAny  arg = 0 
)
virtual

Sets the callback for write progression.

The callback will be called indicating write progression. The arguments to the callback will be the current bitmap streamer, the current write progress value, the maximum write progress value, and a user-defined argument.

Parameters
wpCallbackThe write progression callback.
argA user-defined argument.

◆ UnRegister()

static IlBoolean IlvBitmapStreamer::UnRegister ( IlvBitmapStreamer streamer)
static

Unregisters the given streamer.

Parameters
streamerThe streamer to unregister.

◆ write()

virtual IlBoolean IlvBitmapStreamer::write ( IlvBitmapData bitmapData,
std::ostream &  stream 
)
virtual

Writes an IlvBitmapData to a stream.

Parameters
bitmapDataThe bitmap data to write.
streamThe stream to write to.
Returns
IlTrue if the bitmap data has been written.

Reimplemented in IlvPNGStreamer.