Class TSpaceFillingCurve
Unit
CastleSpaceFillingCurves
Declaration
type TSpaceFillingCurve = class(TObject)
Description
Base abstract space-filling curve class.
Generates consecutive points by NextPixel, until EndOfPixels = True , filling the 2D space in [0..SizeX-1, 0..SizeY-1]. To process (exactly once) each point of your 2D space, you can use something like
while not SFCurve.EndOfPixels do DoSomethingOnPixel(SFCurve.NextPixel);
We try to make NextPixel and EndOfPixels work instantly fast, preferably making some preprocessing at construction time.
Hierarchy
- TObject
- TSpaceFillingCurve
Overview
Methods
Properties
 |
property SizeX: Cardinal read FSizeX; |
 |
property SizeY: Cardinal read FSizeY; |
 |
property PixelsCount: Cardinal read FPixelsCount; |
Description
Methods
 |
constructor Create(ASizeX, ASizeY: Cardinal); virtual; |
|
 |
function EndOfPixels: boolean; virtual; abstract; |
|
 |
procedure SkipPixels(SkipCount: Cardinal); virtual; abstract; |
Skip next SkipCount curve points. Just like you would call NextPixel SkipCount times, ignoring the result. Although may be implemented much faster, so don't worry about calling with large SkipCount values.
Do not ever try to skip beyond the end of points. That is, do not use SkipCount > PixelsCount - PixelsDone . For example, do not use SkipCount > 0 if currently EndOfPixels - True .
|
 |
procedure Reset; virtual; abstract; |
Start generating points back from the beginning.
|
 |
function PixelsDone: Cardinal; virtual; abstract; |
How many curve points were generated. Number of generated points (by NextPixel or skipped by SkipPixels), since the last Reset or constructor.
|
 |
class function SFCName: string; virtual; abstract; |
Nice curve name, like 'swapscan', 'hilbert' or 'peano'.
|
Properties
 |
property SizeX: Cardinal read FSizeX; |
Size of the 2D space filled by space-filling curve. It's OK even if they are 0 (then EndOfPixels = True instantly).
|
 |
property SizeY: Cardinal read FSizeY; |
|
 |
property PixelsCount: Cardinal read FPixelsCount; |
Shortcut for SizeX * SizeY.
|
Generated by PasDoc 0.13.0 on 2014-10-26 05:15:15
|