Leiter.MarchingsquaresPixmap: Types Modinfo Source  

Marching squares algorithm implementation

This module provides an implementation of the marching squares algorithm.
Short info: The marching squares algorithm is an algorithm to plot implicit functions.
Working with this module is kind of straightforward: Create an object of TCurvePlotter and feed it with the necessary information:
-The sampling function, the sample's width and height
-Whether or not you want to interpolate
-the threshold (look up how the algorithm works if you want to know what the threshold is)
-the number of cells in horizontal and vertical direction
-the color of the contour which will be plotted

After that, invoke the "Plot"-Method (which returns a new pixmap containing the contour) or the "PlotToPixmap"-Method
(if you already have a pixmap on which you want to plot the contour). For plotting you can also specify a viewport.

Types Summary

TCurvePlotter Curve plotter Type.

Types

Type TCurvePlotter
DescriptionCurve plotter Type.
Methods Summary
__MarchCell Private method. DO NOT TOUCH!
Plot Plot.
PlotToPixmap Plot to a specified pixmap.
SetCellNum Set cell number.
SetColorARGB Set color.
SetInterpolation  
SetSampleFnc Set sample function.
SetSampleSize Set sample size.
SetThreshold Set the threshold.
Method __MarchCell(X:Int,Y:Int,CellWidth:Int,CellHeight:Int)
DescriptionPrivate method. DO NOT TOUCH!
Method Plot:TPixmap(Width:Int,Height:Int,VX1:Int=0,VY1:Int=0,VX2:Int=-1,VY2:Int=-1)
DescriptionPlot.
InformationThis function creates a new pixmap and plots to it.
Method PlotToPixmap(Pixmap:TPixmap,VX1:Int=0,VY1:Int=0,VX2:Int=-1,VY2:Int=-1)
DescriptionPlot to a specified pixmap.
Method SetCellNum(Size:Int)
DescriptionSet cell number.
InformationUse this to set the number of cells in horizontal and vertical direction.
Method SetColorARGB(ARGB:Int)
DescriptionSet color.
InformationUse this to set the color (as an ARGB integer) of the plotted contour.
Method SetInterpolation(fInterpolate:Int=False)
Method SetSampleFnc(Fnc:Float(X:Int,Y:Int))
DescriptionSet sample function.
InformationUse this to set the function which returns the used data.
Method SetSampleSize(Width:Int,Height:Int)
DescriptionSet sample size.
InformationUse this to set the maximum size of the sample (limits the viewport of plotting)
Method SetThreshold(Threshold:Float=0)
DescriptionSet the threshold.
InformationUse this to set the used threshold.

Module Information

AuthorCalvin 'n-Halbleiter' Bornhofen
Version1.0
LicensePublic Domain
CopyrightCalvin Bornhofen