Files
src/miniquake2/renderer/capture.ml
Provides miniquake2 renderer capture facilities for this project.
- Package
miniquake2.renderer.capture- Reachable
- Yes
Imports
miniquake2/native.ml as rendercapturenative → src/miniquake2/native.mlstd/fs.ml as rendercapturefs → ../MiniLangCompilerML/std/fs.ml external dependency
Declarations
# canonicalizeOpenGlRgba
function canonicalizeOpenGlRgba(width, height, pixels)
Convert GL's bottom-left RGBA rows to the one canonical top-left layout.
| Parameter | Type | Default | Description |
|---|
width | dynamic | — | Width in the coordinate or storage units used by the caller. |
height | dynamic | — | Height in the coordinate or storage units used by the caller. |
pixels | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
expectedImage | dynamic | — | expectedImage value consumed by this operation. |
actualImage | dynamic | — | actualImage value consumed by this operation. |
channelTolerance | dynamic | — | channelTolerance value consumed by this operation. |
includeAlpha | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
captureImage | dynamic | — | captureImage value consumed by this operation. |
View source
# image
function image(width, height, rgba)
Return the image value.
| Parameter | Type | Default | Description |
|---|
width | dynamic | — | Width in the coordinate or storage units used by the caller. |
height | dynamic | — | Height in the coordinate or storage units used by the caller. |
rgba | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
width | dynamic | — | Width in the coordinate or storage units used by the caller. |
height | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
captureImage | dynamic | — | captureImage value consumed by this operation. |
View source
# validateCaptureDimensions
function validateCaptureDimensions(width, height)
Validate capture dimensions.
| Parameter | Type | Default | Description |
|---|
width | dynamic | — | Width in the coordinate or storage units used by the caller. |
height | dynamic | — | Height in the coordinate or storage units used by the caller. |
View source
# writeTga
function writeTga(path, captureImage)
Write tga.
| Parameter | Type | Default | Description |
|---|
path | dynamic | — | Path of the file or directory used by the operation. |
captureImage | dynamic | — | captureImage value consumed by this operation. |
View source