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 GFXON in your gfxconf.h
◆ gdispPixmapCreate()
Create an off-screen pixmap that can be drawn to just like a normal display.
- Parameters
-
[in] | width | The width of the pixmap to be created |
[in] | height | The 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).
◆ gdispPixmapDelete()
void gdispPixmapDelete |
( |
GDisplay * |
g | ) |
|
Destroy an off-screen pixmap.
- Parameters
-
[in] | g | The pixmap virtual display to delete |
- Note
- If a normal display is passed to this routine, it will be ignored.
◆ gdispPixmapGetBits()
gPixel* 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] | g | The 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.
◆ gdispPixmapGetMemoryImage()
void* gdispPixmapGetMemoryImage |
( |
GDisplay * |
g | ) |
|
Get a pointer to a native format gImage.
- Returns
- A pointer to a NATIVE format gImage in memory or NULL if this display is not a pixmap.
- Precondition
- GDISP_NEED_PIXAMP_IMAGE must be GFXON in your gfxconf.h
- Parameters
-
[in] | g | The pixmap virtual display |
- Returns
- The pointer to the native gImage
- 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.