GEMLIB  0.44.0
Functions
VDI raster functions

raster functions More...

Functions

void v_get_pixel (VdiHdl, short x, short y, short *pel, short *color_idx)
 
void vr_trnfm (VdiHdl, MFDB *src, MFDB *dst)
 
void vro_cpyfm (VdiHdl, short mode, short pxy[], MFDB *src, MFDB *dst)
 
void vrt_cpyfm (VdiHdl, short mode, short pxy[], MFDB *src, MFDB *dst, short color[])
 

Detailed Description

raster functions

todo: add description here

Function Documentation

void v_get_pixel ( short  handle,
short  x,
short  y,
short *  pel,
short *  index 
)

On a device with up to 8 planes (256 simultaneously displayable colors) this function returns the value and the color index of a pixel.

Parameters
handleDevice handle
x
y
pelpixel value
[option CHECK_NULLPTR] pel may be NULL
indexcolor index
[option CHECK_NULLPTR] index may be NULL
Since
all VDI versions (screen drivers only)

In HiColor (15 or 16 bits) pel contains the pixel value and index is usually -1.

In TrueColor pel ist the low word and index the high word of the pixel value.

References VDI_CNTRLMAX.

void vr_trnfm ( short  handle,
MFDB src,
MFDB dst 
)

transforms a raster from standard format to device-specific format and vice-versa. The transformation can be "in place" which means that both MFDBs point to the same address. In this case transforming a big bitmap takes ages...

Parameters
handleDevice handle
srcpointer to the source MFDB
dstpointer to the destination MFDB
Since
all VDI versions

References VDI_CNTRLMAX.

void vro_cpyfm ( short  handle,
short  mode,
short  pxy[],
MFDB src,
MFDB dst 
)

copies a rectangular raster onto another rectangular raster and performs the specified logic operations. Both rasters must be in device-specific format or they must have only one plane.

Parameters
handleDevice handle
modelogical operation
  • 0: result=0
  • 1: result=source and destination
  • 2: result=source and (not destination)
  • 3: result=source
  • 4: result=(not source) and destination
  • 5: result=destination (!)
  • 6: result=source xor destination
  • 7: result=source or destination
  • 8: result=not (source or destination)
  • 9: result=not (source xor destination)
  • 10: result=not destination
  • 11: result=source or (not destination)
  • 12: result=not source
  • 13: result=(not source) or destination
  • 14: result=not (source and destination)
  • 15: result=1
pxycoordinates
  • xyarr[0..3]: coordinates of the source rectangle
  • xyarr[4..7]: coordinates of the destination rectangle
srcpointer to the source MFDB
dstpointer to the destination MFDB
Since
all VDI versions (extended since NVDI 4.10)

If the screen (or the device specified by handle) is the source or destination of a raster operation, the MFDB structure element fd_addr should be zero!

The clipping rectangle for the destination raster is enabled only if fd_addr of the destination MFDB is zero.

The source rectangle will not be clipped (it must be within the raster area).

Note:
Usually vro_cpyfm() ignores the height and width of the destination rectangle and uses the size of the source. If you want to scale a bitmap, you have to set the most significant bit in the transfer mode (wr_mode | 0x8000). In this case vro_cpyfm() scales the bitmap according to the size of the destination rectangle. Wheter the driver is able to scale or not is returned by vq_extnd() in work_out[30] (you are only allowed to set the upper bit of the mode if it is able to).

References VDI_CNTRLMAX.

void vrt_cpyfm ( short  handle,
short  mode,
short  pxy[],
MFDB src,
MFDB dst,
short  color[] 
)

This function expands a monochrome raster (one plane) considering the foreground and background color and copies the raster onto the destination raster using the specified writing mode.

Parameters
handleDevice handle
modewriting mode
pxycoordinates
  • xyarr[0..3]: coordinates of the source rectangle
  • xyarr[4..7]: coordinates of the destination rectangle
srcpointer to the source MFDB
dstpointer to the destination MFDB
color
  • color[0] : color index for "black" points
  • color[1] : color index for "white" points
Since
all VDI versions

If the screen is the destination raster, fd_addr should be zero!

Note:
Usually vrt_cpyfm() ignores the height and width of the destination rectangle and uses the size of the source. If you want to scale a bitmap, you have to set the most significant bit in the transfer mode (wr_mode | 0x8000). In this case vrt_cpyfm() scales the bitmap according to the size of the destination rectangle. Wheter the driver is able to scale or not is returned by vq_extnd() in work_out[30] (you are only allowed to set the upper bit of the mode if it is able to).

References VDI_CNTRLMAX.