Class TCustomImageFormatHandler

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCustomImageFormatHandler = class abstract(TObject)

Description

Extension class for TImageFormatManager that supports saving and loading different image formats and can be plugged to one or more image format managers.

Hierarchy

  • TObject
  • TCustomImageFormatHandler

Overview

Methods

Public constructor Create(const AManager: TImageFormatManager);
Public function LoadFromStream(const Context: Pointer; const Extension: StdString; const Stream: TStream; const DestSurface: TPixelSurface; const AlphaFormatRequest: TAlphaFormatRequest): Boolean; virtual; abstract;
Public function SaveToStream(const Context: Pointer; const Extension: StdString; const Stream: TStream; const SourceSurface: TPixelSurface; const Quality: Pointer): Boolean; virtual; abstract;
Protected function GetManager: TImageFormatManager; virtual;
Protected procedure RegisterExtension(const Extension: StdString; const Context: Pointer = nil); virtual;
Protected procedure RegisterExtensions; virtual; abstract;

Properties

Public property Manager: TImageFormatManager read GetManager;

Description

Methods

Public constructor Create(const AManager: TImageFormatManager);

Creates instance of image format handler and associates it with the provided manager class.

Public function LoadFromStream(const Context: Pointer; const Extension: StdString; const Stream: TStream; const DestSurface: TPixelSurface; const AlphaFormatRequest: TAlphaFormatRequest): Boolean; virtual; abstract;

Loads image from the stream. Context parameter will contain the same value as the one passed to RegisterExtension function during creation. The rest of parameters have the same meaning as in methods inside TCustomImageFormatManager class.

Public function SaveToStream(const Context: Pointer; const Extension: StdString; const Stream: TStream; const SourceSurface: TPixelSurface; const Quality: Pointer): Boolean; virtual; abstract;

Saves image to the stream. Context parameter will contain the same value as the one passed to RegisterExtension function during creation. The rest of parameters have the same meaning as in methods inside TCustomImageFormatManager class.

Protected function GetManager: TImageFormatManager; virtual;

Returns reference to image format manager that is associated with this handler. If there is more than one manager referring to this handler, then the first one is returned.

Protected procedure RegisterExtension(const Extension: StdString; const Context: Pointer = nil); virtual;

Registers a specific extension to be processed by this handler along with some custom Context pointer, which will be saved and later provided to LoadFromStream and SaveToStream methods.

Protected procedure RegisterExtensions; virtual; abstract;

This method is executed during creation of TCustomImageFormatHandler class to register extensions that are supported by the handler. During this call, one or more RegisterExtension calls should be made to register supported extensions.

Properties

Public property Manager: TImageFormatManager read GetManager;

Reference to image format manager that is associated with this class.


Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.