|
MoSync 3.2.1
|
Pixel format conversion, scaling, orientation change for palletized surfaces. More...
#include <ma.h>Defines | |
| #define | FLAG_4BPP 1 |
| #define | FLAG_RGB666 2 |
| #define | ORIENTATION_0 0 |
| #define | ORIENTATION_90 1 |
| #define | ORIENTATION_180 2 |
| #define | ORIENTATION_270 3 |
Functions | |
| void | FrameBuffer_init (int w, int h, int orientation, int flags) |
| void | FrameBuffer_setOrientation (int orientation) |
| int | FrameBuffer_getOrientation (void) |
| void | FrameBuffer_close (void) |
| void | FrameBuffer_setPalette (int startDst, int startSrc, int num, const byte *src, int flags) |
| void | FrameBuffer_setPaletteEntry (int i, int r, int g, int b, int flags) |
| void | FrameBuffer_getPaletteEntry (int i, byte *dst, int flags) |
| void | FrameBuffer_copyRect (short x, short y, short w, short h, int dstx, int dsty, const byte *buf, int pitch) |
| int | FrameBuffer_getArrowKeyForOrientation (int mak) |
| int | FrameBuffer_getArrowKeyForOrientationInitial (int mak, int initial) |
Pixel format conversion, scaling, orientation change for palletized surfaces.
| #define FLAG_4BPP 1 |
| #define FLAG_RGB666 2 |
| #define ORIENTATION_0 0 |
| #define ORIENTATION_90 1 |
| #define ORIENTATION_180 2 |
| #define ORIENTATION_270 3 |
| void FrameBuffer_init | ( | int | w, |
| int | h, | ||
| int | orientation, | ||
| int | flags | ||
| ) |
Initializes the FrameBuffer system. This system sets up the native MoSync framebuffer, so make sure that it isn't in use while using this system.
| w | The width in pixels of the framebuffer. |
| h | The height in pixels of the framebuffer. |
| orientation | The orientation of the the screen. |
| flags | Flags for setting bits per pixel. |
| void FrameBuffer_setOrientation | ( | int | orientation | ) |
Sets the orientation of the framebuffer.
| orientation | The new orientation of the framebuffer. |
| int FrameBuffer_getOrientation | ( | void | ) |
Gets the orientation of the framebuffer.
| void FrameBuffer_close | ( | void | ) |
Closes the framebuffer.
| void FrameBuffer_setPalette | ( | int | startDst, |
| int | startSrc, | ||
| int | num, | ||
| const byte * | src, | ||
| int | flags | ||
| ) |
Sets a part of the palette.
| startDst | Where to start in the destination palette (offset in color elements). |
| startSrc | Where to start in the src palette (offset in bytes); |
| num | How many colors should be set. |
| src | The source palette on the format, in bytes, RGBRGB... (note that if FLAG_RGB666 is set then each color component is only 6 bits). |
| flags | If FLAG_RGB666 then 6 bits will be used per component. |
| void FrameBuffer_setPaletteEntry | ( | int | i, |
| int | r, | ||
| int | g, | ||
| int | b, | ||
| int | flags | ||
| ) |
Sets a single palette entry.
| i | The index of the color to be set. |
| r | The red color component. |
| g | The green color component. |
| b | The blue color component. |
| flags | If FLAG_RGB666 then 6 bits will be used per component. |
| void FrameBuffer_getPaletteEntry | ( | int | i, |
| byte * | dst, | ||
| int | flags | ||
| ) |
Gets a single palette entry.
| i | The index of the color to be recieved. |
| dst | A pointer to the destination memory. (3 bytes) |
| flags | If FLAG_RGB666 then 6 bits will be used per component. |
| void FrameBuffer_copyRect | ( | short | x, |
| short | y, | ||
| short | w, | ||
| short | h, | ||
| int | dstx, | ||
| int | dsty, | ||
| const byte * | buf, | ||
| int | pitch | ||
| ) |
Blits a part of the the framebuffer to the screen.
| x | The topleft x-coordinate of the rectangle to be copied to screen. |
| y | The topleft y-coordinate of the rectangle to be copied to screen. |
| w | The width of the rectangle to be copied to screen. |
| h | The height of the rectangle to be copied to screen. |
| dstx | The topleft x-coordinate of the destination (in the same coordinate system as x and y). |
| dsty | The topleft y-coordinate of the destination (in the same coordinate system as x and y). |
| buf | Pointer to the source framebuffer. |
| pitch | The pitch of the source framebuffer. |
| int FrameBuffer_getArrowKeyForOrientation | ( | int | mak | ) |
Function to rotate the arrow keys depending on the orientation.
| mak | The mak keycode of the arrow key. |
| int FrameBuffer_getArrowKeyForOrientationInitial | ( | int | mak, |
| int | initial | ||
| ) |