Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TMatrixDither
Inherited By:
None.
Purpose:
TOrderedDither implements an ordered dithering algorithm. Ordered dithering means that when simulating grays or colors, pixels are highlighted in the same order each time. For example, any simulated shade of gray consists of the same highlighted pixels as any lighter shade, along with additional, highlighted pixels to darken it.
TOrderedDither is derived from TMatrixDither, and thus implements its ordered dithering algorithm through the use of a dither matrix. When constructing an instance of TOrderedDither, specify the dimensions of the matrix. The dither matrix for this class is always square and the default size is 8 x 8. The algorithm implemented by this class uses a magic square.
Create your own ordered dither by deriving from TOrderedDither and overriding CreateDitherMatrix. If your matrix is center clustered, you should also override IsCenterClustered.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TOrderedDither (bool primary =true)
- TOrderedDither (short sideSize, bool primary =true)
- TOrderedDither (const TOrderedDither &)
Interface Category:
API.
Purpose:
- Creates a primary or secondary ordered dither.
- Creates an ordered dither with a dither matrix of the specified size. SideSize must be between 1 and 16 inclusive, otherwise this constructor forces the size to be 8.
- Copy constructor.
Calling Context:
- Call to create a primary or secondary ordered dither.
- Call to create an ordered dither with a dither matrix of the specified size.
- Called to copy an object.
Parameters:
- bool primary =true -The flag indicating whether the new dither hint is primary or secondary. The default value is true.
- short sideSize -The number of elements on each side of the 2-D dither matrix.
- bool primary =true -The flag indicating whether the new dither hint is primary or secondary. The default value is true.
- const TOrderedDither & -The ordered dither to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TOrderedDither ()
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: TOrderedDither::CreateDitherMatrix
virtual DitherMatrix * CreateDitherMatrix (GCoordinate horzDPI, GCoordinate vertDPI) const
Interface Category:
API.
Purpose:
Creates the dither matrix.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate horzDPI -The horizontal resolution of the device.
- GCoordinate vertDPI -The vertical resolution of the device.
Return Value:
Returns a reference to the resulting dither matrix.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TOrderedDither::GetSideSize
short GetSideSize () const
Interface Category:
API.
Purpose:
Returns the number of elements on each side of the dither matrix.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the number of elements on each side of the dither matrix.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TOrderedDither::IsCenterClustered
virtual bool IsCenterClustered () const
Interface Category:
API.
Purpose:
Returns whether or not the ordered dither is clustered in the center. Default implementation of ordered dither is not center clustered and therefore by default this function returns false. Derived classes should override to reflect their dither matrix behavior.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the ordered dither is clustered in the center.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TOrderedDither & operator =(const TOrderedDither & 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: TOrderedDither::operator>>=
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -The stream to which the object streams itself out.
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: TOrderedDither::operator<<=
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The stream from which the object streams itself in.
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: TOrderedDither::TemporaryTypeID
virtual EDitherHintClassID TemporaryTypeID () const
Interface Category:
API.
Purpose:
Returns the type identifier for the specific dither hint class. The return value is one of the values from the enum EDitherHintClassID, defined by this class. This is a temporary replacement for the C++ language typeid operator. This function will go away in the future.
Calling Context:
Call this function instead of the C++ language typeid operator.
Parameters:
Return Value:
Returns kOrderedDither.
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.