Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <ImageTransform.h>
Link against: imagetransform.lib

Class CImageTransform

class CImageTransform : public CBase;

Description

The public API for clients to call the Image Transform (scaling) library. This class provides functions to scale images held in files or descriptors.

Derivation

Members

Defined in CImageTransform:

Inherited from CBase:


Construction and destruction


NewL(RFs &)

IMPORT_C static CImageTransform* NewL(RFs &aFs);

Description

Constructs a CImageTransform object.

Parameters

RFs &aFs

A reference to a file server session for the transform API to use.

Return value

CImageTransform *

A pointer to a fully constructed CImageTransform.


~CImageTransform()

IMPORT_C ~CImageTransform();

Description

This is the destructor for this class and is responsible for deallocating all resources

[Top]


Member functions


SetPluginUidL(TUid)

IMPORT_C void SetPluginUidL(TUid aPluginUid);

Description

Specifies the UID of the image transform plugin to load

Parameters

TUid aPluginUid

The plugin's implementation UID

Leave codes

KErrArgument

The UID is KNullUid


SetSourceFilenameL(const TDesC &)

IMPORT_C void SetSourceFilenameL(const TDesC &aFilename);

Description

Specifies the name of the source file containing the image to transform

Parameters

const TDesC16 &aFilename

The source filename

Leave codes

KNotFound

The file does not exist


SetSourceDataL(const TDesC8 &)

IMPORT_C void SetSourceDataL(const TDesC8 &aData);

Description

Specifies the source descriptor containing the image to transform. Note that this descriptor must persist while the the image is transformed. i.e. the data is not copied. Special care must be taken when passing a TPtrC8 or TPtr8 to this function: The TPtrC8/TPtr8 itself (as well as the data it points to) must be persistent.

Parameters

const TDesC8 &aData

The source descriptor

Leave codes

KErrArgument

The length is zero


SetSourceMimeTypeL(const TDesC8 &)

IMPORT_C void SetSourceMimeTypeL(const TDesC8 &aMIMEType);

Description

Specifies the MIME type of the source image.

Parameters

const TDesC8 &aMIMEType

The MIME type of the source image

Leave codes

KErrArgument

The length is zero


SetSourceImageTypeL(TUid,TUid)

IMPORT_C void SetSourceImageTypeL(TUid aImageType, TUid aImageSubType=TUid::Null());

Description

Specifies the source image's type and (optionally) its subtype

Parameters

TUid aImageType

The UID of the source image's type

TUid aImageSubType

The UID of the source image's subtype

Leave codes

KErrArgument

aImageType is KNullUid


SetSourceRect(const TRect &)

IMPORT_C void SetSourceRect(const TRect &aRect);

Description

Defines a clipping region. Only the specified region will be converted. It is not supported by the Symbian Jpeg ImageTransform Plugin.

Parameters

const TRect &aRect

The coordinates of the clipping region


ClearSourceRect()

IMPORT_C void ClearSourceRect();

Description

Clears the clipping region.


SetDestFilenameL(const TDesC &)

IMPORT_C void SetDestFilenameL(const TDesC &aFilename);

Description

Specifies the name of the destination file where the transformed image is to be written to.

Parameters

const TDesC16 &aFilename

The destination filename

Leave codes

KArgument

The length is zero


SetDestDataL(HBufC8 *&)

IMPORT_C void SetDestDataL(HBufC8 *&aData);

Description

Defines the destination descriptor. This is a reference to a pointer that is owned by the client app. The pointer should be NULL: the plugin will take responsibility for allocating (and potentially growing) the descriptor.

Parameters

HBufC8 *&aData

The destination descriptor.

Leave codes

KErrArgument

The pointer is not NULL


SetDestSizeInPixelsL(const TSize &,TBool)

IMPORT_C void SetDestSizeInPixelsL(const TSize &aDestinationSize, TBool aMaintainAspectRatio=ETrue);

Description

Specifies the requested destination image size.

Parameters

const TSize &aDestinationSize

The requested size of the destination size in pixels

TBool aMaintainAspectRatio

Requests that the aspect ratio be maintained as far as possible defaults to true

Leave codes

KErrArgument

The destination size is zero


SetOptionsL(TUint)

IMPORT_C void SetOptionsL(TUint aOptions);

Description

Defines how the image is to be transformed. The specified option must be one of the options supported or a combination of them, see CImageTransform::TOptions.

Parameters

TUint aOptions

The required option or combination of options from CImageTransform::TOptions

Leave codes

KErrArgument

One or more of the specified option flags is invalid


SetPreserveImageData(TBool)

IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);

Description

Specifies that either the original image data is to preserved, as far as possible, or that the image data should be re-encoded to produce a more size-efficient image.

Parameters

TBool aPreserveImageData

Requests that the aspect ratio be preserved Defaults to false


SetupL()

IMPORT_C void SetupL();

Description

Requests that a suitable plugin be selected and instantiated. Leaves with KErrNotFound if no suitable plugin found or if the framework or plugin finds any error in any of the preceeding SetXXX() calls

Leave codes

KErrNotFound

No suitable plugin was found


Transform(TRequestStatus &)

IMPORT_C void Transform(TRequestStatus &aStatus);

Description

Initiates an asynchronous image transform operation. The framework will panic if no plugin has been instantiated already.

Parameters

TRequestStatus &aStatus

Request status to signal when scaling is complete.

Panic codes

EIllegalCallSequence

No plugin loaded.


CancelTransform()

IMPORT_C void CancelTransform();

Description

Cancels any asynchronous image transform operation currently in progress.


Reset()

IMPORT_C void Reset();

Description

Resets all SetXXX() calls so that the state is the same as that immediately after a call to CImageTransform::NewL(RFs &). Deletes the plugin if one is loaded.


Extension()const

IMPORT_C CImageTransformPluginExtension* Extension() const;

Description

Gets a pointer to a plugin extension

Return value

CImageTransformPluginExtension *

A pointer to a fully constructed CImageTransformPluginExtension NULL, if there is no extension to the plugin

Panic codes

EIllegalCallSequence

No plugin loaded.

[Top]


Member enumerations


Enum TOptions

TOptions

Description

Flags to control how the image is transformed. The EThumbnail and EIgnoreExifMetadataProcessing are mutually exclusive, and SHOULD NOT be used together. If they are, then EThumbnail is used.

EOptionNone

No flag set. This is the default option

EThumbnail

If set, the destination image will always have a thumbnail. If the source already has a thumbnail, then this is the one that will appear in the destination, otherwise one will be generated.

EIgnoreExifMetadataProcessing

If set, then the Exif data is not parsed and ExifMetaData() will always return NULL. If the source image is EXIF, then the EXIF information is copied without modification (i.e. without parsing) to the destination. In cases where the source is JFIF, the destination image is also JFIF.

EEnumBoundary

TOptions should not be set greater than or equal to this value.