rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvQuantizer Class Reference

Quantizer base class. More...

#include <ilviews/bitmaps/quantize.h>

Inheritance diagram for IlvQuantizer:
IlvFixedQuantizer IlvWUQuantizer IlvNetscapeQuantizer IlvQuickQuantizer

List of all members.

Public Member Functions

virtual IlvColorMapcomputeColorMap (const IlvBitmapData *data, IlUInt numcols)=0
 Computes the colormap from the original true color bitmap data.
virtual IlBoolean hasDithering () const
 Returns whether the instance uses Floyd-Steinberg dithering.
virtual IlvIndexedBitmapDataquantize (const IlvBitmapData *data, IlUInt numcols)
 Creates indexed bitmap data from true color bitmap data using the requested number of colors (this number can be ignored by the actual quantizer). The default implementation calls computeColorMap and then remap.
virtual IlvIndexedBitmapDataremap (const IlvBitmapData *data, const IlvColorMap *colormap, IlBoolean fsdither=((IlBoolean) 1))
 Remaps the true colors to the indexed colors.
void setDithering (IlBoolean dither)
 Sets whether the instance uses Floyd-Steinberg dithering.

Detailed Description

Quantizer base class.

Library: display

This class provides methods to convert true color images to indexed images. This is a virtual class that must be subclassed. This class knows how to remap true colors to indexed colors using a dithering method called Floyd-Steinberg diffusion, leading to high quality images, even with few colors.

See also:
IlvFixedQuantizer, IlvQuickQuantizer, IlvWUQuantizer, IlvNetscapeQuantizer

Member Function Documentation

virtual IlvColorMap* IlvQuantizer::computeColorMap ( const IlvBitmapData data,
IlUInt  numcols 
) [pure virtual]

Computes the colormap from the original true color bitmap data.

Parameters:
data The original true color bitmap data.
numcols The requested number of colors.
Returns:
The computed colormap.

Implemented in IlvFixedQuantizer, and IlvWUQuantizer.

virtual IlBoolean IlvQuantizer::hasDithering (  )  const [virtual]

Returns whether the instance uses Floyd-Steinberg dithering.

Returns:
IlTrue if the instance uses Floyd-Steinberg dithering.
virtual IlvIndexedBitmapData* IlvQuantizer::quantize ( const IlvBitmapData data,
IlUInt  numcols 
) [virtual]

Creates indexed bitmap data from true color bitmap data using the requested number of colors (this number can be ignored by the actual quantizer). The default implementation calls computeColorMap and then remap.

Parameters:
data The true color bitmap data.
numcols The requested number of colors.
Returns:
The computed indexed bitmap data.
virtual IlvIndexedBitmapData* IlvQuantizer::remap ( const IlvBitmapData data,
const IlvColorMap colormap,
IlBoolean  fsdither = ((IlBoolean) 1) 
) [virtual]

Remaps the true colors to the indexed colors.

Parameters:
data The original true color bitmap data.
colormap The colormap to remap the bitmap data to.
fsdither An IlBoolean value to indicate whether or not to use Floyd-Steinberg error diffusion.
Returns:
The computed indexed bitmap data.

Reimplemented in IlvQuickQuantizer.

void IlvQuantizer::setDithering ( IlBoolean  dither  ) 

Sets whether the instance uses Floyd-Steinberg dithering.

Parameters:
dither An IlBoolean indicating whether dithering is performed.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.