Class: TImageSamplingControl

Declaration: ImageSamplingControl.h

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.

Member Function: TImageSamplingControl::TImageSamplingControl

  1. TImageSamplingControl ()
  2. TImageSamplingControl (ESampleStyle minificationstyle, ESampleStyle magnificationstyle)
  3. TImageSamplingControl (const TImageSamplingControl &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a new sampling control object initialized with the minification and magnification styles specified.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Call this function directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImageSamplingControl::~TImageSamplingControl

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.

Member Function: TImageSamplingControl::GetMagnificationStyle

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.

Member Function: TImageSamplingControl::GetMinificationStyle

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.

Member Function: TImageSamplingControl::GetAbyssColor

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.

Member Function: TImageSamplingControl::MagnificationIsCardinal

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.

Member Function: TImageSamplingControl::MinificationIsCardinal

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.

Member Function: TImageSamplingControl::SetMagnificationStyle

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImageSamplingControl::SetMinificationStyle

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TImageSamplingControl::SetAbyssColor

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:

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.

Member Function: TImageSamplingControl::GetMagnificationSupport

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.

Member Function: TImageSamplingControl::GetMinificationSupport

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.

Member Function: TImageSamplingControl::operator=

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.

Member Function: TImageSamplingControl::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: TImageSamplingControl::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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.