MiniQuake2

src/miniquake2/renderer/capture.ml

Provides miniquake2 renderer capture facilities for this project.

Package
miniquake2.renderer.capture
Reachable
Yes

Imports

Declarations

canonicalizeOpenGlRgba

function canonicalizeOpenGlRgba(width, height, pixels)

Convert GL's bottom-left RGBA rows to the one canonical top-left layout.

ParameterTypeDefaultDescription
widthdynamic—Width in the coordinate or storage units used by the caller.
heightdynamic—Height in the coordinate or storage units used by the caller.
pixelsdynamic—pixels value consumed by this operation.

View source

miniquake2.renderer.capture.CaptureImage struct

compare

function compare(expectedImage, actualImage, channelTolerance, includeAlpha)

Exact counts plus an explicit per-channel tolerance form a driver-robust, machine-consumable metric without hiding large localized errors in one mean.

ParameterTypeDefaultDescription
expectedImagedynamic—expectedImage value consumed by this operation.
actualImagedynamic—actualImage value consumed by this operation.
channelTolerancedynamic—channelTolerance value consumed by this operation.
includeAlphadynamic—includeAlpha value consumed by this operation.

View source

encodeTga

function encodeTga(captureImage)

Uncompressed true-colour TGA, top-left origin, 8 alpha bits. This stays compatible with original ref_gl screenshots while preserving alpha exactly.

ParameterTypeDefaultDescription
captureImagedynamic—captureImage value consumed by this operation.

View source

image

function image(width, height, rgba)

Return the image value.

ParameterTypeDefaultDescription
widthdynamic—Width in the coordinate or storage units used by the caller.
heightdynamic—Height in the coordinate or storage units used by the caller.
rgbadynamic—rgba value consumed by this operation.

View source

miniquake2.renderer.capture.PixelDiff struct

readOpenGlFrame

function readOpenGlFrame(width, height)

Read the current back buffer before EndFrame swaps it. Dithering is disabled so repeated captures on one GL implementation do not depend on pixel phase.

ParameterTypeDefaultDescription
widthdynamic—Width in the coordinate or storage units used by the caller.
heightdynamic—Height in the coordinate or storage units used by the caller.

View source

RENDERCAPTURE_GL_DITHER

const RENDERCAPTURE_GL_DITHER = 3024

Defines the rendercapture gl dither constant used by the miniquake2 renderer capture module.

View source

RENDERCAPTURE_GL_RGBA

const RENDERCAPTURE_GL_RGBA = 6408

Defines the rendercapture gl rgba constant used by the miniquake2 renderer capture module.

View source

RENDERCAPTURE_GL_UNSIGNED_BYTE

const RENDERCAPTURE_GL_UNSIGNED_BYTE = 5121

Defines the rendercapture gl unsigned byte constant used by the miniquake2 renderer capture module.

View source

rgbaChecksum

function rgbaChecksum(captureImage)

Return the rgba checksum value.

ParameterTypeDefaultDescription
captureImagedynamic—captureImage value consumed by this operation.

View source

validateCaptureDimensions

function validateCaptureDimensions(width, height)

Validate capture dimensions.

ParameterTypeDefaultDescription
widthdynamic—Width in the coordinate or storage units used by the caller.
heightdynamic—Height in the coordinate or storage units used by the caller.

View source

writeTga

function writeTga(path, captureImage)

Write tga.

ParameterTypeDefaultDescription
pathdynamic—Path of the file or directory used by the operation.
captureImagedynamic—captureImage value consumed by this operation.

View source