Home| base |src.lib|graphic|fbuffer| FrameBufferSetUser Index

FrameBufferSetUser

Syntax
int FrameBufferSetUser(struct FrameBuffer *ptr, int (*pixel)(int wdt,int hgt,char *img,char *msk, int x,int y,int depth,int off,int sze, unsigned char r,unsigned char g,unsigned char b, unsigned char a,void *data),void *data);
Header
base/rfbuffer.h
Library
rfbuf
Description

The FrameBufferSetUser function sets the pixel renderer of a frame buffer to a user supplied function.

The argument ptr is a pointer to the frame buffer. The argument pixel is a pointer to a function of the form:

int pixel(int wdt,int hgt,char *img,char *msk, int x,int y,int depth,int off,int sze, unsigned char r,unsigned char g,unsigned char b, unsigned char a,void *dptr);

The arguments wdt and hgt give the size of the frame buffer. The arguments img and msk point to the image data and the alpha channel mask.

The coordinates of the point to render are given by the arguments x and y. The bit depth of the frame buffer is given by the argument depth.

The offset into the image data of the point to render is given by the argument off and the size in bytes of one channel in the frame buffer is given by the argument sze.

The red, green, blue and alpha components of the color to use for the point are given by the arguments r, g, b and a.

The data argument of the FrameBufferSetUser function is passed directly as the dptr argument and allows extra parameters to be passed to the function.

Returns
Returns zero on success. On error, (-1) is returned.
Errors
On error, (-1) is returned.
Example
None