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 87668c03813dbb86473d1080c58810a60e56f8f8 (commit) via 73686098d636fbfd72a4ae5b3bb8d2e0c241ba80 (commit) from 025f1bba56285d57ebab61325415cd2c07a0073c (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/87668c03813dbb86473d1080c58810a60e56f...
commit 87668c03813dbb86473d1080c58810a60e56f8f8 Author: Cyril Hrubis metan@ucw.cz Date: Sun Nov 6 14:24:12 2011 +0100
doc: Fixed basic types and moved progress callback docs.
diff --git a/doc/basic_types.txt b/doc/basic_types.txt index efc9c7b..8f7283c 100644 --- a/doc/basic_types.txt +++ b/doc/basic_types.txt @@ -19,7 +19,8 @@ typedef enum GP_RetCode { GP_EBADFILE, /* error in file, or bad file format */ GP_ENOENT, /* no such file or another object */ GP_ENOMEM, /* not enough memory */ - GP_EMAX, + GP_EINTR, /* interrupted by a callback */ + GP_EMAX, } GP_RetCode; --------------------------------------------------------------------------------
@@ -35,7 +36,6 @@ Coord and Size For drawing API there are two integer types defined the 'GP_Coord' for coordinates and 'GP_Size' for size, length or so.
- Color and pixel types ~~~~~~~~~~~~~~~~~~~~~
@@ -58,6 +58,7 @@ typedef enum GP_Color { GP_COL_INVALID = -1, GP_COL_BLACK, ... + GP_COL_MAX, } GP_Color; --------------------------------------------------------------------------------
@@ -66,15 +67,62 @@ successful match and conversion and false otherwise.
[source,c] -------------------------------------------------------------------------------- -#include <core/GP_Color.h> +#include <GP_Color.h>
-GP_Pixel GP_ColorToPixel(GP_Context *context, GP_Color color); +GP_Pixel GP_ColorToPixel(GP_Color color, GP_PixelType pixel_type); +GP_Pixel GP_ColorToContextPixel(GP_Color color, GP_Context *context);
GP_Color GP_ColorNameToColor(const char *color_name); - const char *GP_ColorToColorName(GP_Color color);
-bool GP_ColorNameToPixel(GP_Context *context, const char *color_name, +bool GP_ColorNameToPixel(const char *color_name, GP_PixelType pixel_type, GP_Pixel *pixel); +bool GP_ColorNameToContextPixel(const char *color_name, GP_Context *context, + GP_Pixel *pixel); +-------------------------------------------------------------------------------- + +Functions to convert color to pixel and color to context pixel. The last two +returns true if color with such name was found. + +[source,c] +-------------------------------------------------------------------------------- +#include <GP_Color.h> + +void GP_ColorLoadPixels(GP_Pixel pixels[], GP_PixelType pixel_type); +void GP_ColorLoadContextPixels(GP_Pixel pixels[], GP_Context *context); --------------------------------------------------------------------------------
+Loads array of 'GP_Pixel' of size 'GP_COL_MAX', the array is then used with +the GP_Color enum as 'pixels[GP_COL_BLACK]'. + +Progress Callback +~~~~~~~~~~~~~~~~~ + +Progress callback is a structure that stores user-defined callback function, +pointer to store location of user data and percentage. + +It is passed as last parameter to functions that could take some time to +complete and adds capability to track the operation progress as well as to +abort the operation. + +Currently it's used for filters and loaders. + +[source,c] +------------------------------------------------------------------------------- +typdedef struct GP_ProgressCallback { + float percentage; + int (*callback)(struct GP_ProgressCallback *self); + void *priv; +} GP_ProgressCallback; +------------------------------------------------------------------------------- + +If non 'NULL' progress callback structure is passed to a function, the +callback function is periodically called and the percentage is updated. + +The return value from callback could abort the function execution. If non zero +value is returned the filter is aborted, all memory freed etc. and the +function either returns 'NULL' if pointer is returned or 'GP_EINTR' in case +filter returns 'GP_RetCode'. + +The callback, if supported, is the last parameter of a function. + diff --git a/doc/filters.txt b/doc/filters.txt index c189599..af8e467 100644 --- a/doc/filters.txt +++ b/doc/filters.txt @@ -8,31 +8,6 @@ The result may be stored into a new bitmap or placed to bitmap passed as argument or, in some cases, the filter could be used 'in place' so the result is stored into the same context as the one passed as filter source.
-Progress Callback -~~~~~~~~~~~~~~~~~ - -Progress callback is a structure that stores user-defined callback function, -pointer to store location of user data and percentage. - -[source,c] -------------------------------------------------------------------------------- -typdedef struct GP_ProgressCallback { - float percentage; - int (*callback)(struct GP_ProgressCallback *self); - void *priv; -} GP_ProgressCallback; -------------------------------------------------------------------------------- - -If non 'NULL' progress callback structure is passed to a filter function, the -callback function is periodically called and the percentage is updated. - -The return value from callback could abort the filter execution. If non zero -value is returned the filter is aborted, all memory freed etc. and the filter -either returns 'NULL' if pointer is returned or 'GP_EINTR' in case filter -returns 'GP_RetCode'. - -The callback, if supported, is the last parameter of the filter function. - Common filter API ~~~~~~~~~~~~~~~~~
http://repo.or.cz/w/gfxprim.git/commit/73686098d636fbfd72a4ae5b3bb8d2e0c241b...
commit 73686098d636fbfd72a4ae5b3bb8d2e0c241ba80 Author: Cyril Hrubis metan@ucw.cz Date: Sun Nov 6 14:17:31 2011 +0100
core: Fix typo in color API.
diff --git a/include/core/GP_Color.h b/include/core/GP_Color.h index 4e39e07..514fe82 100644 --- a/include/core/GP_Color.h +++ b/include/core/GP_Color.h @@ -94,11 +94,11 @@ bool GP_ColorNameToPixel(const char *color_name, GP_PixelType pixel_type, * * Returns true if conversion was successful false otherwise. */ -static inline bool GP_ColorNameContextToPixel(const char *color_name, - GP_PixelType pixel_type, - GP_Pixel *pixel) +static inline bool GP_ColorNameToContextPixel(const char *color_name, + GP_Context *context, + GP_Pixel *pixel) { - return GP_ColorNameToPixel(color_name, pixel_type, pixel); + return GP_ColorNameToPixel(color_name, context->pixel_type, pixel); }
/*
-----------------------------------------------------------------------
Summary of changes: doc/basic_types.txt | 60 ++++++++++++++++++++++++++++++++++++++++++---- doc/filters.txt | 25 ------------------- include/core/GP_Color.h | 8 +++--- 3 files changed, 58 insertions(+), 35 deletions(-)
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.