On this page:
5.1 Rendering Canvas Procedures
wfl->fx
wfxmerge
wfxextract
wfxtest
wfxtest>=
wfxidmerge
widextract
widmerge
canvas-getwid
wfx->rgb
wbuffer->canvas
idbuffer->canvas
widwrap
8.10

5 RRLL: Rendering Canvas

Dominik Pantůček <dominik.pantucek@trustica.cz>

Racket Rogue-Like Library: Rendering Canvas

Extension for rrll/canvas that uses unused bits for storing the depth and id buffers in the canvas data.

5.1 Rendering Canvas Procedures

 (require rrll/canvas/render) package: rrll-canvas-render

procedure

(wfl->fx wfl)  fixnum?

  wfl : flonum?
Converts floating point representation of w-value to fixed-point representation for storing in canvas data.

procedure

(wfxmerge rgb wfx)  fixnum?

  rgb : fixnum?
  wfx : fixnum?
Merges 24-bit RGB color with fixed-point representation of w-value.

procedure

(wfxextract wrgb)  fixnum?

  wrgb : fixnum?
Extracts the w-buffer fixnum? value from given combined data.

procedure

(wfxtest wrgb wfx)  boolean?

  wrgb : fixnum?
  wfx : fixnum?
Tests whether given wfx value is greater than the extracted value from given wrgb.

procedure

(wfxtest>= wrgb wfx)  boolean?

  wrgb : fixnum?
  wfx : fixnum?
Tests whether given wfx value is greater than or equal to the extracted value from given wrgb.

procedure

(wfxidmerge rgb wfx id)  fixnum?

  rgb : fixnum?
  wfx : fixnum?
  id : fixnum?
Merges the color value with fixed-point w-buffer value and numerical surface identifier to one value.

procedure

(widextract iwrgb)  fixnum?

  iwrgb : fixnum?
Extracts id value from given combined color, w-buffer and id composite value.

procedure

(widmerge wrgb id)  fixnum?

  wrgb : fixnum?
  id : fixnum?
Merges id value into color (possibly with wfx information).

procedure

(canvas-getwid can x y)  fixnum?

  can : canvas?
  x : fixnum?
  y : fixnum?
Extracts id value from composite pixel data at given location of the provided canvas?.

procedure

(wfx->rgb wfx)  fixnum?

  wfx : fixnum?
Converts the fixed-point wfx value into a single color of given color scale from black over blue to white. Used by wbuffer-w->canvas.

procedure

(wbuffer->canvas wcan)  canvas?

  wcan : canvas?
Creates a canvas? with color representation of the fixed-point w-buffer values from given canvas?.

procedure

(idbuffer->canvas wcan)  canvas?

  wcan : canvas?
Creates a canvas? with color representation of the fixed-point w-buffer values from given canvas?.

procedure

(widwrap id)  fixnum?

  id : fixnum?
Makes sure the id is not bigger than the internal maximum value.