Class: TDitherHint

Declaration: DitherHints.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TGrafAttribute

Inherited By:

TErrorDiffusionDither TMatrixDither TNoiseDither TSuppressDither

Purpose:

Dithering is the process of simulating gray or color shades on a device that is incapable of rendering those specific colors. For example, a monochrome monitor can only display black or white pixels. However, shades of gray can be simulated by alternating black and white in the neighboring pixels, producing an overall gray affect. Using dithering you can display more shades of gray, or more colors than the device is capable of. However, because multiple pixels are used to represent a single color, you trade off resolution for the increase in gray or color shades. The user gets two preference choices in the bundle for dither hints. First, the primary dither hint is inspected by the device to see if it is appropriate. If the primary dither hint is not appropriate for the device, then the secondary dither hint is inspected. A device may choose to ignore these hints if they are inappropriate. TDitherHint and its derived classes implement various dithering algorithms. Dithering occurs only when the rendering device is capable of dithering (that is why it is called a hint). TDitherHint is derived from TGrafAttribute and works in the same manner as other graphic attributes.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Provided classes include TSuppressDither, TNoiseDither, TErrorDiffusionDither and TMatrixDither. TMatrixDither is an abstract base class from which TOrderedDither and THalftoneDither are derived. Deriving this class is not intended for most developers. Developers deriving classes will have to modify the rendering pipeline for it to take effect.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TDitherHint::TDitherHint

  1. TDitherHint (const TDitherHint &)
  2. TDitherHint (bool Primary)
  3. TDitherHint ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Creates a primary or secondary dither hint.
  3. Default constructor.

Calling Context:

  1. Called to copy an object.
  2. Called to create a primary or secondary dither hint.
  3. Called by the stream-in operators.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::~TDitherHint

virtual ~ TDitherHint ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::GetName

virtual TToken GetName () const

Interface Category:

API.

Purpose:

Returns a token indicating whether the dither hint is primary or secondary.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a token whose value is either PrimaryDitherHint or SecondaryDitherHint.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::operator=

TDitherHint & operator =(const TDitherHint & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::operator>>=

virtual TStream & operator >>=(TStream & towhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::TemporaryTypeID

virtual EDitherHintClassID TemporaryTypeID () const

Interface Category:

API.

Purpose:

Returns the type identifier for the specific dither hint class. This is a temporary replacement for the C++ language typeid operator. This function will go away in the future. Each derived class of TDitherHint must override this function to return the appropriate value for that class. The implementation for TemporaryTypeID in TDitherHint itself returns kCustomDither.

Calling Context:

Call this function instead of the C++ language typeid operator.

Parameters:

Return Value:

Returns an EDitherHintClassID value indicating the dither hint class type of this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDitherHint::GetBaseTemporaryTypeID

virtual EDitherHintClassID GetBaseTemporaryTypeID () const

Interface Category:

API.

Purpose:

Returns the type identifier for the specific dither hint class. This is a temporary replacement for the C++ language typeid operator. This function will go away in the future. Each derived class of TDitherHint must override this function to return the appropriate value for that class. The implementation for GetBaseTemporaryTypeID in TDitherHint itself returns kCustomDither.

Calling Context:

Call this function instead of the C++ language typeid operator.

Parameters:

Return Value:

Returns an EDitherHintClassID value indicating the dither hint class type of this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.