CRM64Pro GDK v0.19.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches

Description

GFX module providing generic graphics primitives, visual effects and utilities [v26.07.0].

Overview

The GFX module provides a collection of generic graphics methods for drawing primitives, immediate visual effects and performing color conversions. Drawing methods are optimized for real-time effects when rendering to screens. When rendering to images, primitives write to the source surface and cached textures are synchronized lazily before the next screen render. Public packed color parameters use logical RGBA order: 0xRRGGBBAA. This is independent from SDL internal surface and texture formats such as SDL_PIXELFORMAT_ARGB8888. setSurfacePixel() and getSurfacePixel() are low-level SDL helpers and use the target SDL_Surface pixel format, not 0xRRGGBBAA.

Key features

  • Pixel operations: Direct pixel access on images and screens
  • Line primitives: Horizontal, vertical and arbitrary line drawing
  • Shape primitives: Rectangles, round rectangles, circles, ellipses and polygons
  • Fill modes: Outlined and filled variants for all shapes
  • Visual effects: Cached additive glow, radial glow, flash, custom Image/Sprite glow and 2D lightmap point/spot light helpers with occluders
  • Color conversion: Multiple color space transformations

Pixel operations

Get pixelRead individual pixel color from an image or screen
Set pixelWrite individual pixel color to an image or screen

Drawing primitives

LinesHorizontal line, vertical line and arbitrary line
RectangleOutlined and filled rectangle
Round rectangleOutlined and filled rectangle with rounded corners
CircleOutlined and filled circle
EllipseOutlined and filled ellipse
PolygonOutlined and filled polygon with arbitrary vertices

Color conversions

RGB ↔ HSVRed-Green-Blue to Hue-Saturation-Value
RGB ↔ YUVRed-Green-Blue to Luminance-Chrominance
RGB ↔ YCCRed-Green-Blue to Luminance-Chroma

Performance considerations

Screen targetFast enough for real-time effects
Image targetWrites the source surface and marks cached textures dirty. Texture upload happens lazily before the next screen render

Best practices

  • Prefer rendering to screens over images for real-time drawing effects
  • Use horizontal and vertical line methods when applicable, they are faster than arbitrary lines
  • Batch image-target drawing before rendering the image to merge dirty regions and reduce setup cost
  • Use glow helpers for decorative emissive effects; they do not illuminate scene objects or cast shadows
  • Use beginLighting(), drawLight()/drawSpotLight() and endLighting() after world rendering to apply 2D lightmap lighting before UI rendering
  • Leverage color conversions for dynamic color manipulation effects (e.g., HSV for hue shifting)
  • Pre-render complex shapes to images during loading rather than drawing them every frame
  • Access the module exclusively through Main::gfx()
Note
The GFX module is a singleton, automatically created once Main is instantiated. You can get a reference to this module using Main::gfx() method.
The GFX module is automatically released when Main::terminate() is called. At this time, any resource still loaded will be released, avoiding resource leaks.

Classes

class  CRM64Pro::GFX
 GFX class. More...

Functions

bool CRM64Pro::GFX::info (Sint32 iMode=0) override
 Request GFX module information.
bool CRM64Pro::GFX::beginLighting (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA=255, Sint32 idRes=0)
 Start a 2D lightmap rendering pass.
bool CRM64Pro::GFX::addLightOccluderRect (float fX1, float fY1, float fX2, float fY2)
 Add a rectangular light occluder to the active lighting pass.
bool CRM64Pro::GFX::addLightOccluderSegment (float fX1, float fY1, float fX2, float fY2)
 Add a segment light occluder to the active lighting pass.
bool CRM64Pro::GFX::addLightOccluderCircle (float fX, float fY, float fRadius)
 Add a circular light occluder to the active lighting pass.
bool CRM64Pro::GFX::addLightOccluderPolygon (const float *fVX, const float *fVY, Sint32 iNV)
 Add a polygon light occluder to the active lighting pass.
bool CRM64Pro::GFX::drawLight (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, bool bUseOccluders=true)
 Draw a point light into the active lighting pass.
bool CRM64Pro::GFX::drawLight (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, bool bUseOccluders=true)
 Draw a point light into the active lighting pass.
bool CRM64Pro::GFX::drawSpotLight (float fX, float fY, float fRadius, float fDirection, float fAngle, Uint32 iColor, float fIntensity=1.0f, bool bUseOccluders=true)
 Draw a spot light into the active lighting pass.
bool CRM64Pro::GFX::drawSpotLight (float fX, float fY, float fRadius, float fDirection, float fAngle, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, bool bUseOccluders=true)
 Draw a spot light into the active lighting pass.
bool CRM64Pro::GFX::endLighting ()
 Finish the active 2D lightmap rendering pass.
bool CRM64Pro::GFX::setSurfacePixel (float fX, float fY, Uint32 iColor, SDL_Surface *pSurface)
 Draw a pixel in a surface.
Uint32 CRM64Pro::GFX::getSurfacePixel (float fX, float fY, SDL_Surface *pSurface) const
 Get a pixel color from a surface.
bool CRM64Pro::GFX::setPixel (float fX, float fY, Uint32 iColor, Sint32 idRes=0)
 Draw a pixel.
bool CRM64Pro::GFX::setPixel (float fX, float fY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a pixel.
Uint32 CRM64Pro::GFX::getPixel (float fX, float fY, Sint32 idRes=0) const
 Get a pixel color.
bool CRM64Pro::GFX::lineH (float fX1, float fX2, float fY, Uint32 iColor, Sint32 idRes=0)
 Draw a horizontal line.
bool CRM64Pro::GFX::lineH (float fX1, float fX2, float fY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a horizontal line.
bool CRM64Pro::GFX::lineV (float fX, float fY1, float fY2, Uint32 iColor, Sint32 idRes=0)
 Draw a vertical line.
bool CRM64Pro::GFX::lineV (float fX, float fY1, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a vertical line.
bool CRM64Pro::GFX::line (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
 Draw a line.
bool CRM64Pro::GFX::line (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a line.
bool CRM64Pro::GFX::rect (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
 Draw an outlined rectangle.
bool CRM64Pro::GFX::rect (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw an outlined rectangle.
bool CRM64Pro::GFX::rectFilled (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
 Draw a filled rectangle.
bool CRM64Pro::GFX::rectFilled (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a filled rectangle.
bool CRM64Pro::GFX::rectRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint32 iColor, Sint32 idRes=0)
 Draw a round outlined rectangle.
bool CRM64Pro::GFX::rectRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a round outlined rectangle.
bool CRM64Pro::GFX::rectFilledRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint32 iColor, Sint32 idRes=0)
 Draw a round filled rectangle.
bool CRM64Pro::GFX::rectFilledRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a round filled rectangle.
bool CRM64Pro::GFX::arc (float fX, float fY, float fRad, float fStart, float fEnd, Uint32 iColor, Sint32 idRes=0)
 Draw an arc.
bool CRM64Pro::GFX::arc (float fX, float fY, float fRad, float fStart, float fEnd, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw an arc.
bool CRM64Pro::GFX::circle (float fX, float fY, float fRad, Uint32 iColor, Sint32 idRes=0)
 Draw an outlined circle.
bool CRM64Pro::GFX::circle (float fX, float fY, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw an outlined circle.
bool CRM64Pro::GFX::circleFilled (float fX, float fY, float fRad, Uint32 iColor, Sint32 idRes=0)
 Draw a filled circle.
bool CRM64Pro::GFX::circleFilled (float fX, float fY, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a filled circle.
bool CRM64Pro::GFX::drawGlow (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a soft additive glow.
bool CRM64Pro::GFX::drawGlow (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a soft additive glow.
bool CRM64Pro::GFX::drawRadialGlow (float fX, float fY, float fInnerRadius, float fOuterRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a soft additive radial glow with a solid inner radius.
bool CRM64Pro::GFX::drawRadialGlow (float fX, float fY, float fInnerRadius, float fOuterRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a soft additive radial glow with a solid inner radius.
bool CRM64Pro::GFX::drawFlash (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a short hot-center additive flash.
bool CRM64Pro::GFX::drawFlash (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
 Draw a short hot-center additive flash.
bool CRM64Pro::GFX::drawGlowImage (Sint32 idImage, float fX, float fY, float fScale, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
 Draw an image as a tinted additive glow.
bool CRM64Pro::GFX::drawGlowImage (Sint32 idImage, float fX, float fY, float fScale, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
 Draw an image as a tinted additive glow.
bool CRM64Pro::GFX::drawGlowSprite (Sint32 idSprite, float fX, float fY, float fScale, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
 Draw the current sprite frame as a tinted additive glow.
bool CRM64Pro::GFX::drawGlowSprite (Sint32 idSprite, float fX, float fY, float fScale, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
 Draw the current sprite frame as a tinted additive glow.
bool CRM64Pro::GFX::ellipse (float fX, float fY, float fRadX, float fRadY, Uint32 iColor, Sint32 idRes=0)
 Draw an outlined ellipse.
bool CRM64Pro::GFX::ellipse (float fX, float fY, float fRadX, float fRadY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw an outlined ellipse.
bool CRM64Pro::GFX::ellipseFilled (float fX, float fY, float fRadX, float fRadY, Uint32 iColor, Sint32 idRes=0)
 Draw a filled ellipse.
bool CRM64Pro::GFX::ellipseFilled (float fX, float fY, float fRadX, float fRadY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a filled ellipse.
bool CRM64Pro::GFX::polygon (const float *fVX, const float *fVY, Sint32 iNV, Uint32 iColor, Sint32 idRes=0)
 Draw an outlined polygon.
bool CRM64Pro::GFX::polygon (const float *fVX, const float *fVY, Sint32 iNV, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw an outlined polygon.
bool CRM64Pro::GFX::polygonFilled (const float *fVX, const float *fVY, Sint32 iNV, Uint32 iColor, Sint32 idRes=0)
 Draw a filled polygon.
bool CRM64Pro::GFX::polygonFilled (const float *fVX, const float *fVY, Sint32 iNV, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
 Draw a filled polygon.
bool CRM64Pro::GFX::rgbToHSV (Uint8 iR, Uint8 iG, Uint8 iB, float *fH, float *fS, float *fV)
 Color conversion from RGB to HSV.
bool CRM64Pro::GFX::hsvToRGB (float fH, float fS, float fV, Uint8 *iR, Uint8 *iG, Uint8 *iB)
 Color conversion from HSV to RGB.
bool CRM64Pro::GFX::rgbToYUV (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 *iY, Uint8 *iU, Uint8 *iV)
 Color conversion from RGB to YUV.
bool CRM64Pro::GFX::yuvToRGB (Uint8 iY, Uint8 iU, Uint8 iV, Uint8 *iR, Uint8 *iG, Uint8 *iB)
 Color conversion from YUV to RGB.
bool CRM64Pro::GFX::rgbToYCC (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 *iY, Uint8 *iCb, Uint8 *iCr)
 Color conversion from RGB to YCC.
bool CRM64Pro::GFX::yccToRGB (Uint8 iY, Uint8 iCb, Uint8 iCr, Uint8 *iR, Uint8 *iG, Uint8 *iB)
 Color conversion from YCC to RGB.

Function Documentation

◆ info()

bool CRM64Pro::GFX::info ( Sint32 iMode = 0)
override

Request GFX module information.

Writes information to the default log.

Parameters
iModeReserved for future use. Pass 0.
Returns
true on success, or false on failure.

◆ beginLighting()

bool CRM64Pro::GFX::beginLighting ( Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA = 255,
Sint32 idRes = 0 )

Start a 2D lightmap rendering pass.

Creates or reuses a screen-sized lightmap, clears it to the ambient color and redirects rendering to it. Draw the scene first, then call beginLighting(), optionally add light occluders, drawLight() or drawSpotLight() for each light and endLighting().

Parameters
iRAmbient red component. Lower values darken the scene.
iGAmbient green component. Lower values darken the scene.
iBAmbient blue component. Lower values darken the scene.
iAAmbient alpha stored in the lightmap. It does not affect the current MOD composite.
idResa valid screen handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
Image targets are not supported by the lightmap pass in this version.
Lighting modulates already-rendered scene content. It is different from glow helpers, which are decorative additive overlays and do not affect scene brightness.
gfx.beginLighting(32, 32, 40);
gfx.addLightOccluderRect(100.0f, 100.0f, 180.0f, 160.0f);
gfx.drawLight(x, y, 180.0f, 255, 220, 160, 255);
gfx.endLighting();

◆ addLightOccluderRect()

bool CRM64Pro::GFX::addLightOccluderRect ( float fX1,
float fY1,
float fX2,
float fY2 )

Add a rectangular light occluder to the active lighting pass.

Parameters
fX1X coordinate of the first rectangle corner.
fY1Y coordinate of the first rectangle corner.
fX2X coordinate of the opposite rectangle corner.
fY2Y coordinate of the opposite rectangle corner.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
Coordinates are in the active render target coordinate space.

◆ addLightOccluderSegment()

bool CRM64Pro::GFX::addLightOccluderSegment ( float fX1,
float fY1,
float fX2,
float fY2 )

Add a segment light occluder to the active lighting pass.

Parameters
fX1X coordinate of the segment start.
fY1Y coordinate of the segment start.
fX2X coordinate of the segment end.
fY2Y coordinate of the segment end.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
Coordinates are in the active render target coordinate space.

◆ addLightOccluderCircle()

bool CRM64Pro::GFX::addLightOccluderCircle ( float fX,
float fY,
float fRadius )

Add a circular light occluder to the active lighting pass.

Parameters
fXX coordinate of the circle center.
fYY coordinate of the circle center.
fRadiusCircle radius in pixels. Must be greater than 0.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
Coordinates are in the active render target coordinate space.

◆ addLightOccluderPolygon()

bool CRM64Pro::GFX::addLightOccluderPolygon ( const float * fVX,
const float * fVY,
Sint32 iNV )

Add a polygon light occluder to the active lighting pass.

Parameters
fVXArray of polygon vertex X coordinates. The array is not modified.
fVYArray of polygon vertex Y coordinates. The array is not modified.
iNVNumber of vertices. Must be greater than or equal to 3.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
Coordinates are in the active render target coordinate space.

◆ drawLight() [1/2]

bool CRM64Pro::GFX::drawLight ( float fX,
float fY,
float fRadius,
Uint32 iColor,
float fIntensity = 1.0f,
bool bUseOccluders = true )

Draw a point light into the active lighting pass.

Parameters
fXX coordinate of the light center.
fYY coordinate of the light center.
fRadiusRadius in pixels of the light. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
bUseOccluderstrue to clip this light against active light occluders, false to ignore them. Default is true.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting().
This is a soft radial point light. Occlusion uses the immediate occluders submitted to the active lighting pass.

◆ drawLight() [2/2]

bool CRM64Pro::GFX::drawLight ( float fX,
float fY,
float fRadius,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
bool bUseOccluders = true )

Draw a point light into the active lighting pass.

Parameters
fXX coordinate of the light center.
fYY coordinate of the light center.
fRadiusRadius in pixels of the light. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
bUseOccluderstrue to clip this light against active light occluders, false to ignore them. Default is true.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting().
This is a soft radial point light. Occlusion uses the immediate occluders submitted to the active lighting pass.

◆ drawSpotLight() [1/2]

bool CRM64Pro::GFX::drawSpotLight ( float fX,
float fY,
float fRadius,
float fDirection,
float fAngle,
Uint32 iColor,
float fIntensity = 1.0f,
bool bUseOccluders = true )

Draw a spot light into the active lighting pass.

Parameters
fXX coordinate of the light origin.
fYY coordinate of the light origin.
fRadiusRadius in pixels of the light. Must be greater than 0.
fDirectionDirection in degrees. 0 points right, 90 points down.
fAngleCone angle in degrees. Values greater than or equal to 360 behave like drawLight().
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
bUseOccluderstrue to clip this light against active light occluders, false to ignore them. Default is true.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting().
This is a soft radial cone light with hard cone edges. Occlusion uses the immediate occluders submitted to the active lighting pass.

◆ drawSpotLight() [2/2]

bool CRM64Pro::GFX::drawSpotLight ( float fX,
float fY,
float fRadius,
float fDirection,
float fAngle,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
bool bUseOccluders = true )

Draw a spot light into the active lighting pass.

Parameters
fXX coordinate of the light origin.
fYY coordinate of the light origin.
fRadiusRadius in pixels of the light. Must be greater than 0.
fDirectionDirection in degrees. 0 points right, 90 points down.
fAngleCone angle in degrees. Values greater than or equal to 360 behave like drawLight().
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
bUseOccluderstrue to clip this light against active light occluders, false to ignore them. Default is true.
Returns
true on success, or false on failure.
Note
Must be called between beginLighting() and endLighting().
This is a soft radial cone light with hard cone edges. Occlusion uses the immediate occluders submitted to the active lighting pass.

◆ endLighting()

bool CRM64Pro::GFX::endLighting ( )

Finish the active 2D lightmap rendering pass.

Returns
true on success, or false on failure.
Note
Restores the previous render target and applies the accumulated lightmap over the screen selected by beginLighting().

◆ setSurfacePixel()

bool CRM64Pro::GFX::setSurfacePixel ( float fX,
float fY,
Uint32 iColor,
SDL_Surface * pSurface )

Draw a pixel in a surface.

Parameters
fXX (horizontal) coordinate of the pixel.
fYY (vertical) coordinate of the pixel.
iColorThe color value of the pixel to draw, in the SDL_Surface pixel format (not 0xRRGGBBAA).
pSurfaceSDL_Surface pointer.
Returns
true on success, or false on failure.
Note
Invalid surfaces or out-of-bounds coordinates return false.
When used on Image::getSurface(), call Image::markDirty() for the modified rectangle.

◆ getSurfacePixel()

Uint32 CRM64Pro::GFX::getSurfacePixel ( float fX,
float fY,
SDL_Surface * pSurface ) const

Get a pixel color from a surface.

Parameters
fXX (horizontal) coordinate of the pixel.
fYY (vertical) coordinate of the pixel.
pSurfaceSDL_Surface pointer.
Returns
A Uint32 iValue with the raw pixel value in the SDL_Surface pixel format.
Note
Invalid surfaces or out-of-bounds coordinates return 0.

◆ setPixel() [1/2]

bool CRM64Pro::GFX::setPixel ( float fX,
float fY,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a pixel.

Parameters
fXX (horizontal) coordinate of the pixel.
fYY (vertical) coordinate of the pixel.
iColorThe color value of the pixel to draw (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ setPixel() [2/2]

bool CRM64Pro::GFX::setPixel ( float fX,
float fY,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a pixel.

Parameters
fXX (horizontal) coordinate of the pixel.
fYY (vertical) coordinate of the pixel.
iRThe red color value of the pixel to draw.
iGThe green color value of the pixel to draw.
iBThe blue color value of the pixel to draw.
iAThe alpha value of the pixel to draw.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ getPixel()

Uint32 CRM64Pro::GFX::getPixel ( float fX,
float fY,
Sint32 idRes = 0 ) const

Get a pixel color.

Parameters
fXX (horizontal) coordinate of the pixel.
fYY (vertical) coordinate of the pixel.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
The RGBA pixel value (0xRRGGBBAA), or transparent black (0x00000000) on failure.
Note
Transparent black is also a valid pixel value, so this method cannot distinguish it from failure.
When idRes is a screen, this method captures a full screen snapshot for every call and then reads one pixel. This can allocate memory and force a renderer/GPU readback stall. Do not call it in per-pixel loops or frame-critical code.
For batch image reads, use Image::getSurface() with getSurfacePixel(). For batch screen reads, capture a screen snapshot once and read from that surface.

◆ lineH() [1/2]

bool CRM64Pro::GFX::lineH ( float fX1,
float fX2,
float fY,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a horizontal line.

Parameters
fX1X coordinate of the first point of the line.
fX2X coordinate of the second point of the line.
fYY coordinate of the points of the line.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ lineH() [2/2]

bool CRM64Pro::GFX::lineH ( float fX1,
float fX2,
float fY,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a horizontal line.

Parameters
fX1X coordinate of the first point of the line.
fX2X coordinate of the second point of the line.
fYY coordinate of the points of the line.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ lineV() [1/2]

bool CRM64Pro::GFX::lineV ( float fX,
float fY1,
float fY2,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a vertical line.

Parameters
fXX coordinate of the points of the line.
fY1Y coordinate of the first point of the line.
fY2Y coordinate of the second point of the line.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ lineV() [2/2]

bool CRM64Pro::GFX::lineV ( float fX,
float fY1,
float fY2,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a vertical line.

Parameters
fXX coordinate of the points of the line.
fY1Y coordinate of the first point of the line.
fY2Y coordinate of the second point of the line.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ line() [1/2]

bool CRM64Pro::GFX::line ( float fX1,
float fY1,
float fX2,
float fY2,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a line.

Parameters
fX1X coordinate of the first point of the line.
fY1Y coordinate of the first point of the line.
fX2X coordinate of the second point of the line.
fY2Y coordinate of the second point of the line.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ line() [2/2]

bool CRM64Pro::GFX::line ( float fX1,
float fY1,
float fX2,
float fY2,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a line.

Parameters
fX1X coordinate of the first point of the line.
fY1Y coordinate of the first point of the line.
fX2X coordinate of the second point of the line.
fY2Y coordinate of the second point of the line.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ rect() [1/2]

bool CRM64Pro::GFX::rect ( float fX1,
float fY1,
float fX2,
float fY2,
Uint32 iColor,
Sint32 idRes = 0 )

Draw an outlined rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rect() [2/2]

bool CRM64Pro::GFX::rect ( float fX1,
float fY1,
float fX2,
float fY2,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw an outlined rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectFilled() [1/2]

bool CRM64Pro::GFX::rectFilled ( float fX1,
float fY1,
float fX2,
float fY2,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a filled rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectFilled() [2/2]

bool CRM64Pro::GFX::rectFilled ( float fX1,
float fY1,
float fX2,
float fY2,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a filled rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectRound() [1/2]

bool CRM64Pro::GFX::rectRound ( float fX1,
float fY1,
float fX2,
float fY2,
float fRad,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a round outlined rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
fRadRadius in pixels of the corner arc.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectRound() [2/2]

bool CRM64Pro::GFX::rectRound ( float fX1,
float fY1,
float fX2,
float fY2,
float fRad,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a round outlined rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
fRadRadius in pixels of the corner arc.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectFilledRound() [1/2]

bool CRM64Pro::GFX::rectFilledRound ( float fX1,
float fY1,
float fX2,
float fY2,
float fRad,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a round filled rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
fRadRadius in pixels of the corner arc.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ rectFilledRound() [2/2]

bool CRM64Pro::GFX::rectFilledRound ( float fX1,
float fY1,
float fX2,
float fY2,
float fRad,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a round filled rectangle.

Parameters
fX1X coordinate of the left edge of the rectangle.
fY1Y coordinate of the top edge of the rectangle.
fX2X coordinate of the exclusive right edge of the rectangle.
fY2Y coordinate of the exclusive bottom edge of the rectangle.
fRadRadius in pixels of the corner arc.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Note
Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.
Returns
true on success, or false on failure.

◆ arc() [1/2]

bool CRM64Pro::GFX::arc ( float fX,
float fY,
float fRad,
float fStart,
float fEnd,
Uint32 iColor,
Sint32 idRes = 0 )

Draw an arc.

Parameters
fXX coordinate of the center of the arc.
fYY coordinate of the center of the arc.
fRadRadius in pixels of the arc.
fStartStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
fEndEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ arc() [2/2]

bool CRM64Pro::GFX::arc ( float fX,
float fY,
float fRad,
float fStart,
float fEnd,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw an arc.

Parameters
fXX coordinate of the center of the arc.
fYY coordinate of the center of the arc.
fRadRadius in pixels of the arc.
fStartStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
fEndEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ circle() [1/2]

bool CRM64Pro::GFX::circle ( float fX,
float fY,
float fRad,
Uint32 iColor,
Sint32 idRes = 0 )

Draw an outlined circle.

Parameters
fXX coordinate of the center of the circle.
fYY coordinate of the center of the circle.
fRadRadius in pixels of the circle.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ circle() [2/2]

bool CRM64Pro::GFX::circle ( float fX,
float fY,
float fRad,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw an outlined circle.

Parameters
fXX coordinate of the center of the circle.
fYY coordinate of the center of the circle.
fRadRadius in pixels of the circle.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ circleFilled() [1/2]

bool CRM64Pro::GFX::circleFilled ( float fX,
float fY,
float fRad,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a filled circle.

Parameters
fXX coordinate of the center of the circle.
fYY coordinate of the center of the circle.
fRadRadius in pixels of the circle.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ circleFilled() [2/2]

bool CRM64Pro::GFX::circleFilled ( float fX,
float fY,
float fRad,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a filled circle.

Parameters
fXX coordinate of the center of the circle.
fYY coordinate of the center of the circle.
fRadRadius in pixels of the circle.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ drawGlow() [1/2]

bool CRM64Pro::GFX::drawGlow ( float fX,
float fY,
float fRadius,
Uint32 iColor,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a soft additive glow.

Parameters
fXX coordinate of the center of the glow.
fYY coordinate of the center of the glow.
fRadiusRadius in pixels of the glow. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawGlow() [2/2]

bool CRM64Pro::GFX::drawGlow ( float fX,
float fY,
float fRadius,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a soft additive glow.

Parameters
fXX coordinate of the center of the glow.
fYY coordinate of the center of the glow.
fRadiusRadius in pixels of the glow. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawRadialGlow() [1/2]

bool CRM64Pro::GFX::drawRadialGlow ( float fX,
float fY,
float fInnerRadius,
float fOuterRadius,
Uint32 iColor,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a soft additive radial glow with a solid inner radius.

Parameters
fXX coordinate of the center of the glow.
fYY coordinate of the center of the glow.
fInnerRadiusRadius in pixels of the full-intensity core. Must be greater than or equal to 0.
fOuterRadiusOuter radius in pixels where the glow fades to transparent. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawRadialGlow() [2/2]

bool CRM64Pro::GFX::drawRadialGlow ( float fX,
float fY,
float fInnerRadius,
float fOuterRadius,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a soft additive radial glow with a solid inner radius.

Parameters
fXX coordinate of the center of the glow.
fYY coordinate of the center of the glow.
fInnerRadiusRadius in pixels of the full-intensity core. Must be greater than or equal to 0.
fOuterRadiusOuter radius in pixels where the glow fades to transparent. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawFlash() [1/2]

bool CRM64Pro::GFX::drawFlash ( float fX,
float fY,
float fRadius,
Uint32 iColor,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a short hot-center additive flash.

Parameters
fXX coordinate of the center of the flash.
fYY coordinate of the center of the flash.
fRadiusRadius in pixels of the flash. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawFlash() [2/2]

bool CRM64Pro::GFX::drawFlash ( float fX,
float fY,
float fRadius,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw a short hot-center additive flash.

Parameters
fXX coordinate of the center of the flash.
fYY coordinate of the center of the flash.
fRadiusRadius in pixels of the flash. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawGlowImage() [1/2]

bool CRM64Pro::GFX::drawGlowImage ( Sint32 idImage,
float fX,
float fY,
float fScale,
Uint32 iColor,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw an image as a tinted additive glow.

Parameters
idImageImage handle used as the glow sprite.
fXX coordinate of the center of the glow image.
fYY coordinate of the center of the glow image.
fScaleUniform scale applied to the image. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This method temporarily applies additive blending, color modulation and alpha modulation to the image and restores the original render state before returning.
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawGlowImage() [2/2]

bool CRM64Pro::GFX::drawGlowImage ( Sint32 idImage,
float fX,
float fY,
float fScale,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw an image as a tinted additive glow.

Parameters
idImageImage handle used as the glow sprite.
fXX coordinate of the center of the glow image.
fYY coordinate of the center of the glow image.
fScaleUniform scale applied to the image. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This method temporarily applies additive blending, color modulation and alpha modulation to the image and restores the original render state before returning.
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawGlowSprite() [1/2]

bool CRM64Pro::GFX::drawGlowSprite ( Sint32 idSprite,
float fX,
float fY,
float fScale,
Uint32 iColor,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw the current sprite frame as a tinted additive glow.

Parameters
idSpriteSprite handle used as the glow sprite.
fXX coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
fYY coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
fScaleUniform scale applied to the sprite. Must be greater than 0.
iColorThe color value (0xRRGGBBAA).
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This method uses the sprite current animation frame. It temporarily applies additive blending, color modulation and alpha modulation to the assigned image and restores the original render state before returning.
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ drawGlowSprite() [2/2]

bool CRM64Pro::GFX::drawGlowSprite ( Sint32 idSprite,
float fX,
float fY,
float fScale,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
float fIntensity = 1.0f,
Sint32 idRes = 0 )

Draw the current sprite frame as a tinted additive glow.

Parameters
idSpriteSprite handle used as the glow sprite.
fXX coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
fYY coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
fScaleUniform scale applied to the sprite. Must be greater than 0.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
fIntensityBrightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.
Note
This method uses the sprite current animation frame. It temporarily applies additive blending, color modulation and alpha modulation to the assigned image and restores the original render state before returning.
This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

◆ ellipse() [1/2]

bool CRM64Pro::GFX::ellipse ( float fX,
float fY,
float fRadX,
float fRadY,
Uint32 iColor,
Sint32 idRes = 0 )

Draw an outlined ellipse.

Parameters
fXX coordinate of the center of the ellipse.
fYY coordinate of the center of the ellipse.
fRadXhorizontal radius in pixels of the ellipse.
fRadYvertical radius in pixels of the ellipse.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ ellipse() [2/2]

bool CRM64Pro::GFX::ellipse ( float fX,
float fY,
float fRadX,
float fRadY,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw an outlined ellipse.

Parameters
fXX coordinate of the center of the ellipse.
fYY coordinate of the center of the ellipse.
fRadXhorizontal radius in pixels of the ellipse.
fRadYvertical radius in pixels of the ellipse.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ ellipseFilled() [1/2]

bool CRM64Pro::GFX::ellipseFilled ( float fX,
float fY,
float fRadX,
float fRadY,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a filled ellipse.

Parameters
fXX coordinate of the center of the ellipse.
fYY coordinate of the center of the ellipse.
fRadXhorizontal radius in pixels of the ellipse.
fRadYvertical radius in pixels of the ellipse.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ ellipseFilled() [2/2]

bool CRM64Pro::GFX::ellipseFilled ( float fX,
float fY,
float fRadX,
float fRadY,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a filled ellipse.

Parameters
fXX coordinate of the center of the ellipse.
fYY coordinate of the center of the ellipse.
fRadXhorizontal radius in pixels of the ellipse.
fRadYvertical radius in pixels of the ellipse.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ polygon() [1/2]

bool CRM64Pro::GFX::polygon ( const float * fVX,
const float * fVY,
Sint32 iNV,
Uint32 iColor,
Sint32 idRes = 0 )

Draw an outlined polygon.

Parameters
fVXVertex array containing X coordinates of the points of the polygon. The array is not modified.
fVYVertex array containing Y coordinates of the points of the polygon. The array is not modified.
iNVNumber of points in the vertex array. From a minimum number of 3 up to 31.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ polygon() [2/2]

bool CRM64Pro::GFX::polygon ( const float * fVX,
const float * fVY,
Sint32 iNV,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw an outlined polygon.

Parameters
fVXVertex array containing X coordinates of the points of the polygon. The array is not modified.
fVYVertex array containing Y coordinates of the points of the polygon. The array is not modified.
iNVNumber of points in the vertex array. From a minimum number of 3 up to 31.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ polygonFilled() [1/2]

bool CRM64Pro::GFX::polygonFilled ( const float * fVX,
const float * fVY,
Sint32 iNV,
Uint32 iColor,
Sint32 idRes = 0 )

Draw a filled polygon.

Parameters
fVXVertex array containing X coordinates of the points of the polygon. The array is not modified.
fVYVertex array containing Y coordinates of the points of the polygon. The array is not modified.
iNVNumber of points in the vertex array. From a minimum number of 3 up to 31.
iColorThe color value (0xRRGGBBAA).
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ polygonFilled() [2/2]

bool CRM64Pro::GFX::polygonFilled ( const float * fVX,
const float * fVY,
Sint32 iNV,
Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 iA,
Sint32 idRes = 0 )

Draw a filled polygon.

Parameters
fVXVertex array containing X coordinates of the points of the polygon. The array is not modified.
fVYVertex array containing Y coordinates of the points of the polygon. The array is not modified.
iNVNumber of points in the vertex array. From a minimum number of 3 up to 31.
iRThe red color value.
iGThe green color value.
iBThe blue color value.
iAThe alpha value.
idResa valid screen or image handle. By default it tries to use the default screen.
Returns
true on success, or false on failure.

◆ rgbToHSV()

bool CRM64Pro::GFX::rgbToHSV ( Uint8 iR,
Uint8 iG,
Uint8 iB,
float * fH,
float * fS,
float * fV )

Color conversion from RGB to HSV.

Parameters
iRRed component.
iGGreen component.
iBBlue component.
fHnon-null pointer to Hue component. Greys use -1.
fSnon-null pointer to Saturation component in the range [0, 1].
fVnon-null pointer to Value component in the range [0, 1].
Returns
true on success, or false on failure.

◆ hsvToRGB()

bool CRM64Pro::GFX::hsvToRGB ( float fH,
float fS,
float fV,
Uint8 * iR,
Uint8 * iG,
Uint8 * iB )

Color conversion from HSV to RGB.

Parameters
fHfinite Hue component in degrees. Values are normalized to [0, 360).
fSSaturation component in the range [0, 1].
fVValue component in the range [0, 1].
iRnon-null pointer to Red component.
iGnon-null pointer to Green component.
iBnon-null pointer to Blue component.
Returns
true on success, or false on failure.

◆ rgbToYUV()

bool CRM64Pro::GFX::rgbToYUV ( Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 * iY,
Uint8 * iU,
Uint8 * iV )

Color conversion from RGB to YUV.

Parameters
iRRed component.
iGGreen component.
iBBlue component.
iYnon-null pointer to luma component.
iUnon-null pointer to chrominance U component.
iVnon-null pointer to chrominance V component.
Returns
true on success, or false on failure.

◆ yuvToRGB()

bool CRM64Pro::GFX::yuvToRGB ( Uint8 iY,
Uint8 iU,
Uint8 iV,
Uint8 * iR,
Uint8 * iG,
Uint8 * iB )

Color conversion from YUV to RGB.

Parameters
iYluma component.
iUchrominance U component.
iVchrominance V component.
iRnon-null pointer to Red component.
iGnon-null pointer to Green component.
iBnon-null pointer to Blue component.
Returns
true on success, or false on failure.

◆ rgbToYCC()

bool CRM64Pro::GFX::rgbToYCC ( Uint8 iR,
Uint8 iG,
Uint8 iB,
Uint8 * iY,
Uint8 * iCb,
Uint8 * iCr )

Color conversion from RGB to YCC.

Parameters
iRRed component.
iGGreen component.
iBBlue component.
iYnon-null pointer to luma component.
iCbnon-null pointer to chrominance blue component.
iCrnon-null pointer to chrominance red component.
Returns
true on success, or false on failure.

◆ yccToRGB()

bool CRM64Pro::GFX::yccToRGB ( Uint8 iY,
Uint8 iCb,
Uint8 iCr,
Uint8 * iR,
Uint8 * iG,
Uint8 * iB )

Color conversion from YCC to RGB.

Parameters
iYluma component.
iCbchrominance blue component.
iCrchrominance red component.
iRnon-null pointer to Red component.
iGnon-null pointer to Green component.
iBnon-null pointer to Blue component.
Returns
true on success, or false on failure.