CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TMegaImageResource

Unit

Resources

Declaration

type TMegaImageResource = class(TImageResource)

Description

Stores an extra large image which can not be handled as usual due to its size. The image is stored in a stream divided into blocks. Some number of blocks are cached in memory. Optimal block size and cache size depending on how the mega image will be used and should be determined empirically.

Hierarchy

TImageResource > TResource > TItem > TBaseItem

Methods

Overview

Publicdestructor Destroy; override;
Publicprocedure AddProperties(const Result: Props.TProperties); override;
Publicfunction GetBlockData(ALevel, ABlockX, ABlockY: Integer): Pointer;
Publicfunction LoadRect(const Rect: TRect; ALevel: Integer; Dest: Pointer; DestImageWidth: Integer): Boolean;
Publicfunction LoadRectAsRGBA(Rect: TRect; ALevel: Integer; Dest: Pointer; DestImageWidth: Integer): Boolean;
Publicfunction LoadSeq(AX, AY, ALength, ALevel: Integer; Dest: Pointer): Boolean;
Publicfunction SaveRect(Rect: TRect; ALevel: Integer; Src: Pointer; SrcImageWidth: Integer; BuildMips: Boolean): Boolean;
Publicfunction SaveSeq(AX, AY, ALength, ALevel: Integer; Src: Pointer): Boolean;
Publicprocedure SetDimensions(AWidth, AHeight: Integer); override;
Publicprocedure SetProperties(Properties: Props.TProperties); override;

Description

Publicdestructor Destroy; override;

 

Publicprocedure AddProperties(const Result: Props.TProperties); override;

 

Publicfunction GetBlockData(ALevel, ABlockX, ABlockY: Integer): Pointer;

Returns address of data of the specified block. Puts the block into cache if it was not here already.

Publicfunction LoadRect(const Rect: TRect; ALevel: Integer; Dest: Pointer; DestImageWidth: Integer): Boolean;

Copies a rectangular area of the specified mip level of the megaimage to an image with width DestImageWidth and data located in memory at Dest and returns True if success

Publicfunction LoadRectAsRGBA(Rect: TRect; ALevel: Integer; Dest: Pointer; DestImageWidth: Integer): Boolean;

Copies a rectangular area of the specified mip level of the megaimage to an RGBA image with width DestImageWidth and data located in memory at Dest and returns True if success

Publicfunction LoadSeq(AX, AY, ALength, ALevel: Integer; Dest: Pointer): Boolean;

Copies a sequence of ALength pixels starting at (AX, AY) from the specified mip level of the megaimage to an image with width DestImageWidth and data located in memory at Dest and returns True if success

Publicfunction SaveRect(Rect: TRect; ALevel: Integer; Src: Pointer; SrcImageWidth: Integer; BuildMips: Boolean): Boolean;

Copies a rectangular area from an image with width SrcImageWidth and data located in memory at Src to the specified mip level of the megaimage and returns True if success. Rebuilds all mipmaps lower than Level if BuildMips is True.

Publicfunction SaveSeq(AX, AY, ALength, ALevel: Integer; Src: Pointer): Boolean;

Copies a sequence of ALength pixels from an image with data located in memory at Src to a rectangular area on the specified mip level of the mega image starting at (AX, AY) from the specified mip level of the megaimage and returns True if success

Publicprocedure SetDimensions(AWidth, AHeight: Integer); override;

 

Publicprocedure SetProperties(Properties: Props.TProperties); override;

 

Properties

Overview

Publicproperty DataStream: TStream;

Description

Publicproperty DataStream: TStream;

Data store stream

Last modified: 26 Oct, 2008
Copyright (C) 2006-2008, casteng.com