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 9800d72f27df325aa25aaa5b35851551ef010921 (commit)
from ee7841b92486c22488a2efcb8fe29ea8642f863c (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/9800d72f27df325aa25aaa5b35851551ef01…
commit 9800d72f27df325aa25aaa5b35851551ef010921
Author: BlueBear <jiri.bluebear.dluhos(a)gmail.com>
Date: Sun Nov 27 21:30:48 2011 +0100
Slightly refined documentation for circles and ellipses.
diff --git a/doc/drawing_api.txt b/doc/drawing_api.txt
index 75a67e4..e73a07c 100644
--- a/doc/drawing_api.txt
+++ b/doc/drawing_api.txt
@@ -79,7 +79,10 @@ void GP_Circle(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter,
GP_Size r, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a circle.
+Draws a circle centered at (xcenter, ycenter) with radius 'r' (in pixels).
+
+The circle is drawn so that all affected pixels will fit into a square
+specified by points (xcenter-r, ycenter-r, xcenter+r, ycenter+r), inclusive.
[source,c]
--------------------------------------------------------------------------------
@@ -89,6 +92,10 @@ void GP_FillCircle(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter,
Draws a filled circle.
+The set of pixels affected by 'GP_FillCircle()' is exactly the same as if
+drawing the circle boundary using GP_Circle() and then filling all pixels
+within the boundary with the same color.
+
Rings
~~~~~
[source,c]
@@ -97,7 +104,10 @@ void GP_Ring(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter,
GP_Size r1, GP_Size r2, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a ring.
+Draws a ring (two circles centered at (xcenter, ycenter) with radii 'r1' and 'r2').
+
+The result is exactly the same as calling 'GP_Circle()' with the same center
+and appropriate radii.
[source,c]
--------------------------------------------------------------------------------
@@ -119,7 +129,10 @@ void GP_Ellipse(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter,
GP_Size a, GP_Size b, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws an ellipse.
+Draws an axis-aligned ellipse.
+
+The ellipse is drawn so that all affected pixels will fit into a rectangle
+specified by points (xcenter-a, ycenter-b, xcenter+a, ycenter+b), inclusive.
[source,c]
--------------------------------------------------------------------------------
@@ -127,7 +140,7 @@ void GP_FillEllipse(GP_Context *context, GP_Coord xcenter, GP_Coord ycenter,
GP_Size a, GP_Size b, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a filled ellipse.
+Draws a filled axis-aligned ellipse.
Triangles
~~~~~~~~~
-----------------------------------------------------------------------
Summary of changes:
doc/drawing_api.txt | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 ee7841b92486c22488a2efcb8fe29ea8642f863c (commit)
from c2d53d78b138cc441a28c025b8899f6d3b80f29e (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/ee7841b92486c22488a2efcb8fe29ea8642f…
commit ee7841b92486c22488a2efcb8fe29ea8642f863c
Author: BlueBear <jiri.bluebear.dluhos(a)gmail.com>
Date: Sun Nov 27 20:23:07 2011 +0100
More precise documentation of line drawing functions and subcontexts.
diff --git a/doc/context.txt b/doc/context.txt
index a98d21a..38a8efb 100644
--- a/doc/context.txt
+++ b/doc/context.txt
@@ -99,8 +99,9 @@ void GP_ContextFree(GP_Context *context);
The 'GP_ContextAlloc()' allocates context and initalizes the context
structure. The orientation flags are all set to 0 and the rest of the metadata
-are calculated accordingly to width, height and pixel_type. The bitmap
-(context->pixels) is not initalized.
+are calculated accordingly to width, height and pixel_type. A bitmap with
+appropriate size is allocated and stored in context->pixels; the initial
+contents of the bitmap are undefined.
The 'GP_ContextCopy()' allocates and initalizes a copy of the context passed
as argument. If 'flag' is not zero, the bitmap (context->pixels) is copied
@@ -112,12 +113,12 @@ In both cases the resulting context should later be freed with
Subcontext
~~~~~~~~~~
-Given a rectangular area inside of any context subcontext could be created.
-The resulting context could be used for all context operations (including
-subcontext creation). The only difference between allocated context and
-subcontext of such context is that the 'GP_ContextFree()' doesn't call
-'free()' on subcontext pixels (which as a matter of a fact is a pointer that
-points somewhere into to allocated area).
+A subcontext is a context that refers to a rectangular area within another
+context. Subcontexts can be used as any other context (including creating
+another subcontexts).
+
+Calling GP_ContextFree() on a subcontext is safe; the bitmap is not freed as
+it belongs to another context; it will be freed with the hosting context.
[source,c]
-------------------------------------------------------------------------------
@@ -129,12 +130,12 @@ GP_Context *GP_ContextSubContext(GP_Context *context, GP_Context *subcontext,
Creates subcontext of a context. The rectangular area must fit into the context.
-If subcontext pointer is 'NULL' the context structure is allocated otherwise
+If subcontext pointer is 'NULL', the context structure is allocated; otherwise
the metadata are filled into the context structure pointed by subcontext
pointer.
-In both cases pointer to subcontext or NULL (in case of 'malloc(2)' failure) is
-returned.
+In both cases, the call returns either a pointer to the new subcontext,
+or NULL on failure (when there is not enough memory).
Conversions
~~~~~~~~~~~
diff --git a/doc/drawing_api.txt b/doc/drawing_api.txt
index 6cfd7e8..75a67e4 100644
--- a/doc/drawing_api.txt
+++ b/doc/drawing_api.txt
@@ -9,8 +9,8 @@ Fill
void GP_Fill(GP_Context *context, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Fills the context bitmap. This has the same effect as calling
-'GP_FillRect(context, 0, 0, context->w, context->h, pixel)'.
+Fills the whole context bitmap with the specified pixel value. This has the
+same effect as calling 'GP_FillRect(context, 0, 0, context->w, context->h, pixel)'.
Lines
~~~~~
@@ -20,30 +20,45 @@ Lines
void GP_HLineXXY(GP_Context *context, GP_Coord x0, GP_Coord x1, GP_Coord y,
GP_Pixel pixel);
-void GP_HLineXYW(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w,
- GP_Pixel pixel);
-
void GP_HLine(GP_Context *context, GP_Coord x0, GP_Coord x1, GP_Coord y,
GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a horizontal line. The 'GP_HLine()' function is an alias for
-'GP_HLineXXY()'.
+Draws a horizontal line from (x0, y) to (x1, y), inclusive. The coordinates
+x0, x1 can be specified in any order.
+
+'GP_HLine()' is an alias for 'GP_HLineXXY()'.
[source,c]
--------------------------------------------------------------------------------
-void GP_VLineXYY(GP_Context *context, GP_Coord x, GP_Coord y0, GP_Coord y1,
+void GP_HLineXYW(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size w,
GP_Pixel pixel);
+--------------------------------------------------------------------------------
-void GP_VLineXYH(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size h,
+Draws a horizontal line from (x, y) to (x+w-1, y), inclusive.
+
+
+[source,c]
+--------------------------------------------------------------------------------
+void GP_VLineXYY(GP_Context *context, GP_Coord x, GP_Coord y0, GP_Coord y1,
GP_Pixel pixel);
void GP_VLine(GP_Context *context, GP_Coord x, GP_Coord y0, GP_Coord y1,
GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a vertical line. The 'GP_VLine()' function is an alias for
-'GP_VLineXYY()'.
+Draws a vertical line from (x, y0) to (x, y1), inclusive. The coordinates
+y0, y1 can be specified in any order.
+
+'GP_VLine()' is an alias for 'GP_VLineXYY()'.
+
+--------------------------------------------------------------------------------
+void GP_VLineXYH(GP_Context *context, GP_Coord x, GP_Coord y, GP_Size h,
+ GP_Pixel pixel);
+
+--------------------------------------------------------------------------------
+
+Draws a vertical line from (x, y) to (x, y+h-1), inclusive.
[source,c]
--------------------------------------------------------------------------------
@@ -51,7 +66,9 @@ void GP_Line(GP_Context *context, GP_Coord x0, GP_Coord y0,
GP_Coord x1, GP_Coord y1, GP_Pixel pixel);
--------------------------------------------------------------------------------
-Draws a line from (x0, y0) to (x1, y1), inclusive.
+Draws a line from (x0, y0) to (x1, y1), inclusive. The starting and ending
+point can be specified in any order (the implementation guarantees that
+exactly the same set of pixels will be drawn in both cases).
Circles
~~~~~~~
-----------------------------------------------------------------------
Summary of changes:
doc/context.txt | 23 ++++++++++++-----------
doc/drawing_api.txt | 41 +++++++++++++++++++++++++++++------------
2 files changed, 41 insertions(+), 23 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 5cdba1dbc960776f21bdd7e9a07a4546ad918ea3 (commit)
via 86f0ef66d88f47ebb9ac8b9a1a30a83e3b449d2b (commit)
from eb0fe417461ded37e79ffa76e90cedf1b39af555 (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/5cdba1dbc960776f21bdd7e9a07a4546ad91…
commit 5cdba1dbc960776f21bdd7e9a07a4546ad918ea3
Merge: 86f0ef6 eb0fe41
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Sat Nov 26 23:31:25 2011 +0100
Merge branch 'master' of git://repo.or.cz/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/86f0ef66d88f47ebb9ac8b9a1a30a83e3b44…
commit 86f0ef66d88f47ebb9ac8b9a1a30a83e3b449d2b
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Sat Nov 26 23:24:11 2011 +0100
Fix GP_ContextConvert
... a little, still not ideal, but IMO not worth it
diff --git a/libs/core/GP_Context.c b/libs/core/GP_Context.c
index 7079901..73e926e 100644
--- a/libs/core/GP_Context.c
+++ b/libs/core/GP_Context.c
@@ -110,11 +110,13 @@ GP_Context *GP_ContextAlloc(GP_Size w, GP_Size h, GP_PixelType type)
GP_Context *GP_ContextConvert(const GP_Context *src,
GP_PixelType dst_pixel_type)
{
- GP_Context *ret = GP_ContextAlloc(src->w, src->h, dst_pixel_type);
+ int w = GP_ContextW(src);
+ int h = GP_ContextH(src);
+ GP_Context *ret = GP_ContextAlloc(w, h, dst_pixel_type);
if (ret == NULL)
return NULL;
- GP_Blit_Naive(src, 0, 0, src->w, src->h, ret, 0, 0);
+ GP_Blit(src, 0, 0, w, h, ret, 0, 0);
return ret;
}
-----------------------------------------------------------------------
Summary of changes:
libs/core/GP_Context.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 eb0fe417461ded37e79ffa76e90cedf1b39af555 (commit)
from cc5f16de4ff693a60f55a5b335367b3a8ffd3a40 (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/eb0fe417461ded37e79ffa76e90cedf1b39a…
commit eb0fe417461ded37e79ffa76e90cedf1b39af555
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Nov 26 23:23:35 2011 +0100
fbshow: Switch to bicubic integer implementation.
diff --git a/demos/fbshow/fbshow.c b/demos/fbshow/fbshow.c
index 4510312..3943ffc 100644
--- a/demos/fbshow/fbshow.c
+++ b/demos/fbshow/fbshow.c
@@ -155,12 +155,12 @@ static void *image_loader(void *ptr)
GP_Context *ret;
- callback.priv = "Blurring Image";
- if (GP_FilterGaussianBlur(img, img, 0.3/rat, 0.3/rat, &callback) == NULL)
- return NULL;
+// callback.priv = "Blurring Image";
+// if (GP_FilterGaussianBlur(img, img, 0.3/rat, 0.3/rat, &callback) == NULL)
+// return NULL;
callback.priv = "Resampling Image";
- ret = GP_FilterResize(img, NULL, GP_INTERP_CUBIC, img->w * rat, img->h * rat, &callback);
+ ret = GP_FilterResize(img, NULL, GP_INTERP_CUBIC_INT, img->w * rat, img->h * rat, &callback);
GP_ContextFree(img);
if (ret == NULL)
-----------------------------------------------------------------------
Summary of changes:
demos/fbshow/fbshow.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")