Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
Image sampling is the process of sampling an image prior to drawing it. Often the image is interpolated (enlarged) or decimated (shrunk), reducing the number of pixels. When an image is on a device of a different resolution, it is interpolated or decimated as appropriate to maintain the same visual size on both devices. Interpolation and decimation also occur during affine or perspective transformations on the image graphic.
TImageSamplingControl lets you specify a filtering method to control the appearance of the rendered image when it has been interpolated or decimated. The different filtering methods represent various quality and drawing speed trade-offs. This class defines an enumerated type ESampleStyle to let you specify the filtering method used when shrinking or stretching an image. You can also customize your own filtering method. TImageSamplingControl also controls what action takes place in destination pixels when the destination rectangle is larger than the image. The area outside the image but inside the destination rectangle is known as the abyss.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Classes deriving from TImageSamplingControl should override GetMagnificationFilterFunction, GetMinificationFilterFunction, GetMagnificationSupport, GetMinificationSupport, MagnificationIsInUnitRange, and MinificationIsInUnitRange.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TImageSamplingControl ()
- TImageSamplingControl (ESampleStyle minificationstyle, ESampleStyle magnificationstyle)
- TImageSamplingControl (const TImageSamplingControl &)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a new sampling control object initialized with the minification and magnification styles specified.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- ESampleStyle minificationstyle -The filter type to use when shrinking the image.
- ESampleStyle magnificationstyle -The filter type to use when enlarging the image.
- const TImageSamplingControl & src -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TImageSamplingControl ()
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.
ESampleStyle GetMagnificationStyle () const
Interface Category:
API.
Purpose:
Returns an ESampleStyle, indicating the filtering method used for interpolation or enlargement of the image.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns an ESampleStyle, indicating the filtering method used for interpolation.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
ESampleStyle GetMinificationStyle () const
Interface Category:
API.
Purpose:
Returns an ESampleStyle, indicating the filtering method used for decimation (shrinking) of the image.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns an ESampleStyle, indicating the filtering method used for decimation.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
const TColor * GetAbyssColor () const
Interface Category:
API.
Purpose:
Returns the abyss fill color. The abyss fill color is used only when the abyss style is kFillWithColor.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the color with which the abyss will be filled.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool MagnificationIsCardinal () const
Interface Category:
API.
Purpose:
Indicates if the magnification of the image is cardinal. The default return value is false.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the magnification of the image is cardinal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool MinificationIsCardinal () const
Interface Category:
API.
Purpose:
Indicates if the decimation of the image is cardinal. The default return value is false.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the decimation of the image is cardinal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetMagnificationStyle (ESampleStyle style)
Interface Category:
API.
Purpose:
Sets the filtering method used for interpolation (enlargement) to the specified ESampleStyle.
Calling Context:
Call this function directly.
Parameters:
- ESampleStyle style -The new interpolation filtering method.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetMinificationStyle (ESampleStyle style)
Interface Category:
API.
Purpose:
Sets the filtering method used for decimation (shrinking) to the specified ESampleStyle.
Calling Context:
Call this function directly.
Parameters:
- ESampleStyle style -The new decimation filtering method.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetAbyssColor (const TColor & color)
Interface Category:
API.
Purpose:
Sets the abyss fill color. The abyss fill color only applies when the abyss style is kFillWithColor.
Calling Context:
Call this function directly.
Parameters:
- const TColor & color -The new abyss fill color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TImageSamplingControl::MagnificationIsInUnitRange
virtual bool MagnificationIsInUnitRange () const
Interface Category:
API.
Purpose:
Returns true if the width of the sampling method used for interpolation is within the range (0..1). The default implementation returns true if the magnification style is not kSinc2Filter, kSinc3Filter, or kCubicFIlter.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the magnification of the image is in unit range.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
Member Function: TImageSamplingControl::MinificationIsInUnitRange
virtual bool MinificationIsInUnitRange () const
Interface Category:
API.
Purpose:
Returns true if the width of the sampling method used for decimation is within the range (0..1). The default implementation returns true if the minification style is not kSinc2Filter, kSinc3Filter, or kCubicFIlter.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if minification of the image is in unit range.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
virtual GCoordinate GetMagnificationSupport () const
Interface Category:
API.
Purpose:
Returns the width of the sampling method used in interpolation.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the width of the interpolation sampling method.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
virtual GCoordinate GetMinificationSupport () const
Interface Category:
API.
Purpose:
Returns the width of the sampling method used in decimation.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the width of the decimation sampling method.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
Member Function: TImageSamplingControl::GetMagnificationFilterFunction
virtual GFilterFunc GetMagnificationFilterFunction () const
Interface Category:
API.
Purpose:
Returns a pointer to the filter function used in interpolation.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to the filter function used in interpolation.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
Member Function: TImageSamplingControl::GetMinificationFilterFunction
virtual GFilterFunc GetMinificationFilterFunction () const
Interface Category:
API.
Purpose:
Returns a pointer to the filter function used in decimation.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to the filter function used in decimation.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Classes deriving from TImageSamplingControl should override this function.
TImageSamplingControl & operator =(const TImageSamplingControl & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
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.
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.
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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.