From 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 17 Oct 2008 06:10:33 +0000 Subject: First commit - moving from LuaForge to SourceForge --- html/en/drv/irgb.html | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 html/en/drv/irgb.html (limited to 'html/en/drv/irgb.html') diff --git a/html/en/drv/irgb.html b/html/en/drv/irgb.html new file mode 100644 index 0000000..3ab71f4 --- /dev/null +++ b/html/en/drv/irgb.html @@ -0,0 +1,117 @@ + + + + + + +CD_IMAGERGB + + + + + +

CD_IMAGERGB - RGB Client Image Driver (cdirgb.h)

+ +

This driver allows access to a Client Image, an imaged based in RGB colors with 24 + or 32 bits per pixel (8 per channel). + It is used to implement high-quality offscreen drawings, but is slower than the Server Image version. In fact, it is a + rasterizer, that is, it converts vector primitives into a raster representation. All primitives are implemented by the + library and are not system-dependent (the primitives of the Server Image version are system-dependent).

+ +

Use

+ +

The canvas is created by means of a call to the function + cdCreateCanvas(CD_IMAGERGB, + Data), after which other functions in the CD library can be called as usual. The function creates an RGB image, + and then a CD canvas. The Data parameter string has the following format:

+ +
"widthxheight [r g b] -r[resolution]"      in C "%dx%d %p %p %p -r%g"
+or
+"widthxheight [r g b a] -r[resolution] -a"    in C "%dx%d %p %p %p %p -r%g -a"
+ +

It must include the canvas' dimensions. Width and height + are provided in pixels (note the lowercase "x" between them). As an option, you can specify the buffers to be used by + the driver, so that you can draw over an existing image. The resolution can be defined with parameter + -r; its default value is "3.78 pixels/mm" (96 DPI). 

+

When the parameter -a is specified an alpha channel will be added to the +canvas underlying image. All primitives will be composed using an over operator +if the foreground or background colors have alpha components. This channel is +initialized with transparent (0). The other channels are initialized with white +(255, 255, 255). After drawing in the RGBA image the resulting alpha channel can +be used to compose the image in another canvas.

+

All channels are initialized only when allocated internally by the driver. +They are not initialized when allocated by the application.

+

Any amount of such canvases may exist simultaneously. It is important to note that a call to function + cdKillCanvas is required to + release internal allocated memory.

+

In Lua, the canvas can be created in two ways: with an already defined image or without it. With an image, an RGB + image must be passed as parameter, created by functions + cd.CreateImageRGB, + cd.CreateImageRGBA or + cd.CreateBitmap + in Lua. The resolution must be passed in an extra parameter after the image.

+ +

Exclusive Functions

+ +

cd.ImageRGB(canvas: cdCanvas) -> (imagergb: cdImageRGB +or cdImageRGBA) [in Lua]
+cd.ImageRGBBitmap(canvas: cdCanvas) -> (bitmap: cdBitmap) [in Lua]

+ +

Returns the canvas' internal image.

+ +

Behavior of Functions

+ +

All primitives are from the Simulation driver, see the Simulation driver's documentation for + further information.

+ +

Control

+ +

Coordinate System and Clipping

+ +

Colors

+ +

Exclusive Attributes

+ + + + + + + + + \ No newline at end of file -- cgit v1.2.3