version 2.8
Pixmap

Detailed Description

Sub-Module for dynamic framebuffers.

Note
A Pixmap is an off-screen virtual display that can be drawn to just like any other display. It can then be copied to a real display using the standard gdispGBlitArea() call.
Precondition
GDISP_NEED_PIXMAP must be TRUE in your gfxconf.h

Functions

GDisplay * gdispPixmapCreate (coord_t width, coord_t height)
 Create an off-screen pixmap that can be drawn to just like a normal display. More...
 
void gdispPixmapDelete (GDisplay *g)
 Destroy an off-screen pixmap. More...
 
pixel_tgdispPixmapGetBits (GDisplay *g)
 Get a pointer to the pixels of the display surface. More...
 
void * gdispPixmapGetMemoryImage (GDisplay *g)
 Get a pointer to a native format gdispImage. More...
 

Function Documentation

GDisplay* gdispPixmapCreate ( coord_t  width,
coord_t  height 
)

Create an off-screen pixmap that can be drawn to just like a normal display.

Parameters
[in]widthThe width of the pixmap to be created
[in]heightThe height of the pixmap to be created
Returns
The created GDisplay representing the pixmap or 0 if the pixmap couldn't be created.
Note
Once created, an off-screen pixmap can be drawn on using the standard gdispGxxxx calls.
It must be destroyed using gdispDeleteOffscreenPixmap
Because the RAM for the display area is allocated, on small micros only very small pixmaps should be considered. For example a 100x100 at 16 bits per pixel would be 20K of RAM (plus some overheads).
void gdispPixmapDelete ( GDisplay *  g)

Destroy an off-screen pixmap.

Parameters
[in]gThe pixmap virtual display to delete
Note
If a normal display is passed to this routine, it will be ignored.
pixel_t* gdispPixmapGetBits ( GDisplay *  g)

Get a pointer to the pixels of the display surface.

Returns
The pointer to the pixmap display surface or NULL if this display is not a pixmap.
Parameters
[in]gThe pixmap virtual display
Note
The pointer returned can be used for calls to gdispGBlitArea() or can be read or written to directly by the application code. For any one particular pixmap the pointer will not change over the life of the pixmap (although different pixmaps will have different pixel pointers). Once a pixmap is deleted, the pixel pointer should not be used by the application.
void* gdispPixmapGetMemoryImage ( GDisplay *  g)

Get a pointer to a native format gdispImage.

Returns
A pointer to a NATIVE format gdispImage in memory or NULL if this display is not a pixmap.
Precondition
GDISP_NEED_PIXAMP_IMAGE must be TRUE in your gfxconf.h
Parameters
[in]gThe pixmap virtual display
Returns
The pointer to the native gdispImage
Note
The pointer returned can be passed to gdispImageOpenMemory() or to gfileOpenMemory().
If you are just wanting to copy to a real display it is more efficient to use gdispGetPixmapBits() and gdispGBlitArea().
Like gdispGetPixmapBits(), the pointer returned is valid for the life of the pixmap.