set_ray_dither_parms(3G)
NAME
set_ray_dither_parms, inq_ray_dither_parms − set/inquire dithering scheme for 8-bit ray tracing output
SYNOPSIS
C Syntax:
void set_ray_dither_parms(fildes,scene_id,dither_scheme);
int fildes,scene_id,dither_scheme;
void inq_ray_dither_parms(fildes,scene_id,dither_scheme);
int fildes,scene_id,*dither_scheme;
FORTRAN77 Syntax:
subroutine set_ray_dither_parms(fildes,scene_id,dither_scheme)
integer*4 fildes,scene_id,dither_scheme
subroutine inq_ray_dither_parms(fildes,scene_id,dither_scheme)
integer*4 fildes,scene_id,*dither_scheme
Pascal Syntax:
procedure set_ray_dither_parms(fildes,scene_id,dither_scheme:
integer);
procedure inq_ray_dither_parms(fildes,scene_id:integer;
var dither_scheme:integer);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
scene_id Scene identifier; as returned by create_scene.
Input/Output Parameters
dither_scheme
Dithering scheme to use. Must be ERROR_DIFFUSION optionally ORed together with RANDOMIZE.
Discussion
Ray tracing always produces and stores images as 24-bit bitmaps, with eight bits each of red, green, and blue. In order to display such images on 8-bit display hardware, dithering must be done. set_ray_dither_parms gives the user some control over the dithering process.
SBRR supports an ERROR_DIFFUSION dithering scheme. This algorithm dithers a target 24-bit pixel value, reducing it to eight bits. Once the output value is found, the resulting pixel error is calculated and distributed to neighboring pixels. This distributed error is added to the target values of the neighboring pixels before their output value is found.
Sometimes dithering may produce a disturbing pattern in the resulting image. The RANDOMIZE flag may be used to reduce the effect of this pattern. RANDOMIZE simply varies each error value by a random amount, with the effect of adding some noise to the image. The resulting image may appear somewhat grainy, but the strength of the patterns produced by the dithering will be reduced.
Render_scene always stores images in full 24-bit format, so it’s possible to experiment with the different dithering schemes at output time without having to re-render the image each time. If set_ray_output has screen_on set TRUE, then the screen output of render_scene will use the current dither scheme, but the image will still be stored in 24-bit format.
Dithering is only done for 8-bit display devices. If the destination device has 24 planes, then set_ray_dither_parms is ignored.
NOTES
Ray tracing parameters do not affect radiosity renderings of scene_id.
This command cannot be stored in a segment.
ERRORS
Invalid file descriptor.
Invalid scene_id.
Invalid dither_scheme.
DEFAULTS
The default dither_scheme for any scene is ERROR_DIFFUSION.
SEE ALSO
render_scene(3G), set_ray_output(3G).
— July 12, 1991