Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

ImageFX Class

Renders a bitmap image in the effect pipeline.

The ImageFX class will render a source image into a given rectangle within the current user coordinate system. The client has the option of providing a pre-allocated Bitmap or the path to a Image file as the source.

If a pre-allocated Bitmap is to be used, it must be created under the ownership of the ImageFX object, and this must be configured prior to initialisation. It is required that the bitmap uses 32 bits per pixel and that the alpha channel is enabled.

If a source image file is referenced, it will be upscaled to meet the requirements automatically as needed.

Technically the ImageFX object is represented by a new viewport, the bounds of which are defined by attributes X, Y, Width and Height. The placement and scaling of the referenced image is controlled by the AspectRatio field.

Structure

The ImageFX class consists of the following fields:

Access
NameTypeComment
 AspectRatioARFSVG compliant aspect ratio settings.
NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible.
ARF::X_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
 BitmapOBJECTPTRThe Bitmap being used as the image source.

Reading the Bitmap field will return the Bitmap that is being used as the image source. Note that if a custom Bitmap is to be used, the correct way to do this as to assign it to the ImageFX object via ownership rules.

If an image has been processed by setting the Path, the Bitmap will refer to the content that has been processed.

 PathSTRINGPath to an image file supported by the Image class.
 ResampleMethodVSMThe resample algorithm to use for transforming the source image.
NameDescription
VSM::AUTOThe default option is chosen by the system. This will typically be BILINEAR, but slow machines may switch to nearest neighbour and high speed machines could use more advanced methods.
VSM::BESSELUses a broad Bessel filter that can preserve detail during resampling, but is slower than the smaller-kernel methods.
VSM::BICUBICProduces a similar result to BILINEAR at a slightly higher CPU cost and a marginally sharper after-effect.
VSM::BILINEARBilinear is a common algorithm that produces a reasonable quality image quickly.
VSM::BLACKMANFive times slower than BILINEAR, the final result will be less sharp than SINC.
VSM::GAUSSIANUses a Gaussian filter that softens the result, reducing aliasing at the cost of sharp edge detail.
VSM::KAISERUses a Kaiser-windowed filter, giving smooth interpolation with low ringing and a cost close to BILINEAR.
VSM::LANCZOSThis well known algorithm may serve as a point of comparison for evaluating the results of other methods. It shares characteristics with SINC and BLACKMAN.
VSM::MITCHELLUses a Mitchell-Netravali filter, balancing sharpness and smoothness at a cost similar to BICUBIC.
VSM::NEIGHBOURNearest neighbour is the fastest sampler at the cost of poor quality.
VSM::QUADRICUses a quadratic filter with a modest kernel, giving smoother results than BILINEAR with limited extra cost.
VSM::SINCFive times slower than BILINEAR, the final result is of very good quality.
VSM::SPLINE16About twice as slow as BILINEAR, this method samples a 4x4 area and produces a considerably better result, and is a good choice for enlarging images without producing artifacts when contrasting colours are present.
 XMLDefSTRINGReturns an SVG compliant XML string that describes the filter.

Actions

The following actions are currently supported:

DrawRender the effect to the target bitmap.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.
ImageFX class documentation © Paul Manias © 2010-2026

ARF Type

Aspect ratios control alignment, scaling and clipping.

NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible.
ARF::X_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
ImageFX module documentation © Paul Manias © 2010-2026

VSM Type

NameDescription
VSM::AUTOThe default option is chosen by the system. This will typically be BILINEAR, but slow machines may switch to nearest neighbour and high speed machines could use more advanced methods.
VSM::BESSELUses a broad Bessel filter that can preserve detail during resampling, but is slower than the smaller-kernel methods.
VSM::BICUBICProduces a similar result to BILINEAR at a slightly higher CPU cost and a marginally sharper after-effect.
VSM::BILINEARBilinear is a common algorithm that produces a reasonable quality image quickly.
VSM::BLACKMANFive times slower than BILINEAR, the final result will be less sharp than SINC.
VSM::GAUSSIANUses a Gaussian filter that softens the result, reducing aliasing at the cost of sharp edge detail.
VSM::KAISERUses a Kaiser-windowed filter, giving smooth interpolation with low ringing and a cost close to BILINEAR.
VSM::LANCZOSThis well known algorithm may serve as a point of comparison for evaluating the results of other methods. It shares characteristics with SINC and BLACKMAN.
VSM::MITCHELLUses a Mitchell-Netravali filter, balancing sharpness and smoothness at a cost similar to BICUBIC.
VSM::NEIGHBOURNearest neighbour is the fastest sampler at the cost of poor quality.
VSM::QUADRICUses a quadratic filter with a modest kernel, giving smoother results than BILINEAR with limited extra cost.
VSM::SINCFive times slower than BILINEAR, the final result is of very good quality.
VSM::SPLINE16About twice as slow as BILINEAR, this method samples a 4x4 area and produces a considerably better result, and is a good choice for enlarging images without producing artifacts when contrasting colours are present.
ImageFX module documentation © Paul Manias © 2010-2026