This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 57c57c59cd6ce43a4df21a9309cdbb7cd5e1bf16 (commit) via 78c4f27c1460b40d07c59ab79a5050601756cf40 (commit) from 6339f5f64899ddc8158072a7354703eb71ef2e49 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/57c57c59cd6ce43a4df21a9309cdbb7cd5e1b...
commit 57c57c59cd6ce43a4df21a9309cdbb7cd5e1bf16 Author: Cyril Hrubis metan@ucw.cz Date: Tue Dec 18 19:20:58 2012 +0100
doc: backends: Update X11 API.
diff --git a/doc/backends.txt b/doc/backends.txt index d760daf..5ee7e78 100644 --- a/doc/backends.txt +++ b/doc/backends.txt @@ -81,16 +81,27 @@ pixel type to match given surface).
For example usage see 'SDL' glue link:example_SDL_glue.html[example].
-X server +X Server ~~~~~~~~
[source,c] ------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <backends/GP_X11.h> + enum GP_BackendX11Flags { - /* - * When set, w and h is ignored and root window is used - */ - GP_X11_USE_ROOT_WIN = 0x01, + /* When set, w and h is ignored and root window is used */ + GP_X11_USE_ROOT_WIN = 0x01, + + /* Create new borderless window above the root window */ + GP_X11_CREATE_ROOT_WIN = 0x02, + + /* Start fullscreen */ + GP_X11_FULLSCREEN = 0x04, + + /* Do not use MIT SHM even if available */ + GP_X11_DISABLE_SHM = 0x08, };
GP_Backend *GP_BackendX11Init(const char *display, int x, int y, @@ -106,8 +117,33 @@ time).
This backend feeds key events into global input queue.
-Note this is experimental version of X11 backend and will be changed to support -more windows at a time. +TODO: X11 backend will be changed to support more windows at a time. + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <backends/GP_X11.h> + +/* + * Returns non-zero if backend is X11 backend + */ +int GP_BackendIsX11(GP_Backend *self); + +/* + * Changes full screen mode. + * + * 0 = off + * 1 = on + * 2 = toggle + */ +void GP_BackendX11RequestFullscreen(GP_Backend *self, int mode); +------------------------------------------------------------------------------- + +The 'GP_BackendIsX11' functions allows us to detect if we are running using +X11 backend. + +The 'GP_BackendX11RequestFullscreen' can toggle fullscreen mode at runtime.
Overall init function ~~~~~~~~~~~~~~~~~~~~~
http://repo.or.cz/w/gfxprim.git/commit/78c4f27c1460b40d07c59ab79a5050601756c...
commit 78c4f27c1460b40d07c59ab79a5050601756cf40 Author: Cyril Hrubis metan@ucw.cz Date: Tue Dec 18 19:11:04 2012 +0100
doc: pixels: Add basic docs for pixel.
diff --git a/doc/Makefile b/doc/Makefile index cc981fb..eef29cd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt drawing_api.txt backends.txt gamma.txt grabbers.txt environment_variables.txt debug.txt core.txt api.txt input.txt - gen.txt + gen.txt pixels.txt
EXAMPLE_SOURCES=$(wildcard example_*.txt)
diff --git a/doc/api.txt b/doc/api.txt index cee4d1a..69d460a 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -11,6 +11,10 @@ Cyril Hrubis metan@ucw.cz + Describes functions and macros in library core. + +. link:pixels.html[Pixel Types] + + + Describes pixel types. + + . link:debug.html[Debug Messages] + Interface to debug layer. diff --git a/doc/pixels.txt b/doc/pixels.txt new file mode 100644 index 0000000..b226453 --- /dev/null +++ b/doc/pixels.txt @@ -0,0 +1,87 @@ +Pixel Description +----------------- + +This pages describes library core functions for handling pixels. + +Pixel Type +~~~~~~~~~~ + +Pixels are described by a pixel type, which is enumeration type. The enum is +defined at the generated 'GP_Pixel.gen.h' header and must contain at least +following members: + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <core/GP_Pixel.h> + +typedef enum GP_PixelType { + GP_PIXEL_UNKNOWN, + GP_PIXEL_xRGB8888, + GP_PIXEL_RGBA8888, + GP_PIXEL_RGB888, + GP_PIXEL_BGR888, + GP_PIXEL_G1, + GP_PIXEL_G2, + GP_PIXEL_G4, + GP_PIXEL_G8, + GP_PIXEL_MAX, +} GP_PixelType; + +------------------------------------------------------------------------------- + +Each pixel type has accompanying record in global array of pixel types +declared as follows: + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <core/GP_Pixel.h> + +typedef struct { + char name[8]; /* Channel name */ + uint8_t offset; /* Offset in bits */ + uint8_t size; /* Bit-size */ +} GP_PixelTypeChannel; + +typedef struct { + GP_PixelType type; /* Number of the type */ + const char name[16]; /* Name */ + uint8_t size; /* Size in bits */ + GP_BIT_ENDIAN bit_endian; /* Order of pixels in a byte */ + uint8_t numchannels; /* Number of channels */ + /* String describing the bit-representaton (as in "RRRRRGGGGGGBBBBB")*/ + const char bitmap[GP_PIXEL_BITS + 1]; + /* Individual channels */ + const GP_PixelTypeChannel channels[GP_PIXELTYPE_MAX_CHANNELS]; +} GP_PixelTypeDescription; + +extern const GP_PixelTypeDescription const GP_PixelTypes[]; + +const char *GP_PixelTypeName(GP_PixelType type); + +uint32_t GP_PixelSize(GP_PixelType type); +------------------------------------------------------------------------------- + +There are also pixel matching functions that returns pixel type given RGB +channel masks or sizes and offsets: + +[source,c] +------------------------------------------------------------------------------- +#include <GP.h> +/* or */ +#include <core/GP_Pixel.h> + +GP_PixelType GP_PixelRGBMatch(GP_Pixel rmask, GP_Pixel gmask, + GP_Pixel bmask, GP_Pixel amask, + uint8_t bits_per_pixel); + +GP_PixelType GP_PixelRGBLookup(uint32_t rsize, uint32_t roff, + uint32_t gsize, uint32_t goff, + uint32_t bsize, uint32_t boff, + uint32_t asize, uint32_t aoff, + uint8_t bits_per_pixel); +------------------------------------------------------------------------------- +
-----------------------------------------------------------------------
Summary of changes: doc/Makefile | 2 +- doc/api.txt | 4 ++ doc/backends.txt | 50 ++++++++++++++++++++++++++---- doc/pixels.txt | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 8 deletions(-) create mode 100644 doc/pixels.txt
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.