Gfxprim
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- 929 discussions
[repo.or.cz] gfxprim.git branch master updated: 582174a303ed68281404b7f09beeba72d8d80a17
by bluebear 01 May '11
by bluebear 01 May '11
01 May '11
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 582174a303ed68281404b7f09beeba72d8d80a17 (commit)
from 16a50bf6b0c956641c452653bd38621d668aef66 (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/582174a303ed68281404b7f09beeba72d8d8…
commit 582174a303ed68281404b7f09beeba72d8d80a17
Author: BlueBear <jiri.bluebear.dluhos(a)gmail.com>
Date: Sun May 1 23:14:42 2011 +0200
Initial implementation of convex polygon drawing.
diff --git a/core/GP.h b/core/GP.h
index 29be3f5..1be9710 100644
--- a/core/GP.h
+++ b/core/GP.h
@@ -58,6 +58,7 @@
#include "GP_FillCircle.h"
#include "GP_Ellipse.h"
#include "GP_FillEllipse.h"
+#include "GP_Polygon.h"
#include "GP_Symbol.h"
/* fonts */
diff --git a/core/GP_Polygon.c b/core/GP_Polygon.c
new file mode 100644
index 0000000..845825b
--- /dev/null
+++ b/core/GP_Polygon.c
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * This file is part of gfxprim library. *
+ * *
+ * Gfxprim is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2.1 of the License, or (at your option) any later version. *
+ * *
+ * Gfxprim is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with gfxprim; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
+ * <jiri.bluebear.dluhos(a)gmail.com> *
+ * *
+ * Copyright (C) 2009-2010 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
+#include "GP.h"
+
+#include <limits.h>
+
+struct GP_PolygonEdge {
+ int startx, starty;
+ int endx, endy;
+ int dx, dy, sx;
+ struct GP_PolygonEdge *next;
+};
+
+struct GP_Polygon {
+ struct GP_PolygonEdge *edges;
+ int ymin, ymax;
+};
+
+static struct GP_PolygonEdge *GP_NewEdge(int x1, int y1, int x2, int y2)
+{
+ struct GP_PolygonEdge *edge = malloc(sizeof(*edge));
+ if (y1 < y2) { /* coords are top-down, correct */
+ edge->startx = x1;
+ edge->starty = y1;
+ edge->endx = x2;
+ edge->endy = y2;
+ } else { /* coords are bottom-up, flip them */
+ edge->startx = x2;
+ edge->starty = y2;
+ edge->endx = x1;
+ edge->endy = y1;
+ }
+
+ edge->dx = abs(edge->endx - edge->startx);
+ edge->dy = edge->endy - edge->starty;
+ edge->sx = (edge->endx >= edge->startx) ? 1 : -1;
+
+ return edge;
+}
+
+static void GP_InsertEdge(struct GP_Polygon *poly, struct GP_PolygonEdge *new_edge)
+{
+ struct GP_PolygonEdge *cur_edge = poly->edges;
+
+ poly->ymin = GP_MIN(poly->ymin, new_edge->starty);
+ poly->ymax = GP_MAX(poly->ymax, new_edge->endy);
+
+ if (cur_edge == NULL || cur_edge->starty > new_edge->starty) {
+ new_edge->next = cur_edge;
+ poly->edges = new_edge;
+ return;
+ }
+
+ for (;;) {
+ if (cur_edge->next == NULL || cur_edge->next->starty > new_edge->starty) {
+ new_edge->next = cur_edge->next;
+ cur_edge->next = new_edge;
+ return;
+ }
+ cur_edge = cur_edge->next;
+ }
+}
+
+static struct GP_Polygon *GP_NewPolygon(void)
+{
+ struct GP_Polygon *poly = malloc(sizeof(struct GP_Polygon));
+ poly->edges = NULL;
+ poly->ymin = INT_MAX;
+ poly->ymax = 0;
+ return poly;
+}
+
+static void GP_LoadPolygon(struct GP_Polygon *poly, int vertex_count, int *xy)
+{
+ int i;
+ int coord_count = 2*vertex_count - 2;
+ for (i = 0; i < coord_count; i+=2) {
+
+
+ if (xy[i+1] == xy[i+3]) {
+ continue; /* skip horizontal edges */
+ }
+
+ struct GP_PolygonEdge *edge = GP_NewEdge(xy[i],
+ xy[i+1], xy[i+2], xy[i+3]);
+
+ GP_InsertEdge(poly, edge);
+ }
+
+ /* add the closing edge */
+ if (xy[1] != xy[i+1]) {
+ struct GP_PolygonEdge *edge = GP_NewEdge(xy[i], xy[i+1],
+ xy[0], xy[1]);
+ GP_InsertEdge(poly, edge);
+ }
+}
+
+static void GP_FreePolygon(struct GP_Polygon *poly)
+{
+ struct GP_PolygonEdge *edge = poly->edges;
+ for (;;) {
+ struct GP_PolygonEdge *next_edge = edge->next;
+ free(edge);
+ if (next_edge == NULL)
+ break;
+ edge = next_edge;
+ }
+ free(poly);
+}
+
+void GP_FillPolygon(GP_Context *context, int vertex_count, int *xy, GP_Pixel pixel)
+{
+ struct GP_Polygon *poly = GP_NewPolygon();
+ GP_LoadPolygon(poly, vertex_count, xy);
+
+ int y;
+ for (y = poly->ymin; y <= poly->ymax; y++) {
+ int startx = INT_MAX;
+ int endx = 0;
+
+ struct GP_PolygonEdge *edge;
+ for (edge = poly->edges; edge; edge = edge->next) {
+ if (y >= edge->starty && y <= edge->endy) {
+ int edge_y = y - edge->starty;
+ int edge_x;
+ for (edge_x = edge->sx > 0 ? edge->startx: edge->endx;
+ edge->startx*edge->dy + edge->sx*edge_y*edge->dx - edge_x*edge->dy > 0;
+ edge_x++);
+ startx = GP_MIN(startx, edge_x);
+ endx = GP_MAX(endx, edge_x);
+ }
+ }
+
+ GP_HLine(context, startx, endx, y, pixel);
+ }
+
+ GP_FreePolygon(poly);
+}
diff --git a/core/GP.h b/core/GP_Polygon.h
similarity index 69%
copy from core/GP.h
copy to core/GP_Polygon.h
index 29be3f5..49c11ab 100644
--- a/core/GP.h
+++ b/core/GP_Polygon.h
@@ -23,47 +23,11 @@
* *
*****************************************************************************/
-#ifndef GP_H
-#define GP_H
+#ifndef GP_FILL_POLYGON_H
+#define GP_FILL_POLYGON_H
-#include <stdint.h>
-
-/* basic definitions and structures */
-#include "GP_Common.h"
-#include "GP_Transform.h"
#include "GP_Context.h"
-/* semi-public, low-level drawing API */
-#include "GP_WritePixel.h"
-
-/* colors */
-#include "GP_Color.h"
-#include "GP_Palette.h"
-
-/* public drawing API */
-#include "GP_Fill.h"
-#include "GP_GetPixel.h"
-#include "GP_PutPixel.h"
-#include "GP_HLine.h"
-#include "GP_VLine.h"
-#include "GP_Line.h"
-#include "GP_LineTrack.h"
-#include "GP_Rect.h"
-#include "GP_FillRect.h"
-#include "GP_Triangle.h"
-#include "GP_FillTriangle.h"
-#include "GP_Tetragon.h"
-#include "GP_FillTetragon.h"
-#include "GP_Circle.h"
-#include "GP_FillCircle.h"
-#include "GP_Ellipse.h"
-#include "GP_FillEllipse.h"
-#include "GP_Symbol.h"
-
-/* fonts */
-#include "GP_Font.h"
-#include "GP_TextStyle.h"
-#include "GP_TextMetric.h"
-#include "GP_Text.h"
+void GP_FillPolygon(GP_Context *context, int vertex_count, int *xy, GP_Pixel pixel);
-#endif /* GP_H */
+#endif /* GP_RECT_H */
-----------------------------------------------------------------------
Summary of changes:
core/GP.h | 1 +
core/GP_Polygon.c | 161 ++++++++++++++++++++++++++++++++++++++
core/{GP_Fill.h => GP_Polygon.h} | 8 +-
3 files changed, 166 insertions(+), 4 deletions(-)
create mode 100644 core/GP_Polygon.c
copy core/{GP_Fill.h => GP_Polygon.h} (92%)
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.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 16a50bf6b0c956641c452653bd38621d668aef66
by bluebear 01 May '11
by bluebear 01 May '11
01 May '11
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 16a50bf6b0c956641c452653bd38621d668aef66 (commit)
via 1ee71956ba9e5ca2cd298fa3702e4036bbf59225 (commit)
from 4fd5560abf4f40f8436fd4af18d604ceff3d64b8 (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/16a50bf6b0c956641c452653bd38621d668a…
commit 16a50bf6b0c956641c452653bd38621d668aef66
Merge: 1ee7195 4fd5560
Author: BlueBear <jiri.bluebear.dluhos(a)gmail.com>
Date: Sun May 1 20:15:19 2011 +0200
Merge ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/1ee71956ba9e5ca2cd298fa3702e4036bbf5…
commit 1ee71956ba9e5ca2cd298fa3702e4036bbf59225
Author: BlueBear <jiri.bluebear.dluhos(a)gmail.com>
Date: Sun May 1 20:14:18 2011 +0200
Clarified comments and added TOP and BOTTOM.
diff --git a/core/GP_Text.h b/core/GP_Text.h
index e4645ec..35fc68e 100644
--- a/core/GP_Text.h
+++ b/core/GP_Text.h
@@ -28,15 +28,27 @@
#include "GP_Context.h"
-/* Where the text should be drawn relatively to the specified point */
+/* How the rendered text should be aligned.
+ * For GP_Text(), the alignment is relative to the specified point:
+ *
+ * - GP_ALIGN_LEFT draws the text to the left of the point,
+ * - GP_ALIGN_CENTER centers it at the point horizontally,
+ * - GP_ALIGN_RIGHT draws the text to the right of the point
+ * - GP_VALIGN_ABOVE (or TOP) draws the text above the point
+ * - GP_VALIGN_CENTER centers the text vertically at the point
+ * - GP_VALIGN_BASELINE places the text baseline at the point
+ * - GP_VALIGN_BELOW (or BOTTOM) draws the text below the point
+ */
typedef enum GP_TextAlign {
- GP_ALIGN_LEFT = 0x01, /* to the left from the point */
- GP_ALIGN_CENTER = 0x02, /* centered on the point */
- GP_ALIGN_RIGHT = 0x03, /* to the right from the point */
- GP_VALIGN_ABOVE = 0x10, /* above the point */
- GP_VALIGN_CENTER = 0x20, /* centered on the point */
- GP_VALIGN_BASELINE = 0x30, /* baseline is on the point */
- GP_VALIGN_BELOW = 0x40 /* below the point */
+ GP_ALIGN_LEFT = 0x01,
+ GP_ALIGN_CENTER = 0x02,
+ GP_ALIGN_RIGHT = 0x03,
+ GP_VALIGN_ABOVE = 0x10,
+ GP_VALIGN_TOP = GP_VALIGN_ABOVE,
+ GP_VALIGN_CENTER = 0x20,
+ GP_VALIGN_BASELINE = 0x30,
+ GP_VALIGN_BELOW = 0x40,
+ GP_VALIGN_BOTTOM = GP_VALIGN_BELOW,
} GP_TextAlign;
GP_RetCode GP_Text(GP_Context *context, const GP_TextStyle *style,
-----------------------------------------------------------------------
Summary of changes:
core/GP_Text.h | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 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.")
1
0
Hi,
the discussion about Few renames seems to get off-topic. However, the
discussion on suppotred transformations and their purpose is highly
relevant. My view of the problem:
My understanding is that transformations are intended for weird HW
with (0,0) bottom-left and such. Mixing these "fixes" for unusual HW
properties with convenience applications such as horizontal flip of
coordinates of drawn line is ... not wise, has limited usefulness and
will lead to confusion. (Note that there can be "real" matrix
transformations for drawing rotated/shifted/... primitives)
What is the (intended) purpose of transformation flags on bitmaps?
Note that a general blit() that would support conversion between all
pairs of pixeltypes (including palettes), bpp's (including
bit-endian), axes_swap (goodbye caches if different), flip_y (easy)
and flip_x (RtL vs LtR), including any combination of the last three
(set all differently on src and dst ... ) is going to be ...
challenging to code, optimize, debug and maintain. Most of these
(almost all except same pixeltype and orientation) are going to be
very expensive + hard to optimize.
My idea of the most common use-case would be to have a "global/common"
setting (based on HW) of transformations and really transforming only
when loading images or fonts.
Most other libraries do only simple blit, perhaps with simple format
conversion. Flips are then special functions. Rotation is declared to
be slow and it is easy to see when is it applied.
Best,
Tomas
2
1
Hi all,
First question first: Budeme psat do listu jen anglicky, nebo je cestina OK?
Before going to the individual ideas, I would like to ask you for your
opinions and for help with refactoring the current code (including
names), thinking about the people that will use the library, frequent
use cases and "most-expected" behaviour.
****
I would like to propose few renames in GfxPrim, mostly to improve readability:
GP_Context: x_swap, y_swap -> flip_x, flip_y
It is called "vertical/horizontal flip", meaningful-sentence-like
identifiers are easier to remember and read (flip_x vs x_flip)
GP_Context: axes_swap -> swap_axes
Readability, consistency with flip_*
GP_Context: clip_(w|h)_(min|max) -> clip_x_min etc.
clipping coordinate, not width
The argument-modifying macros do not indicate which arguments are
modified (even worse than C++ refs).
I propose to at least consistently document this in macro defs and/or
change the argument names from "x" to "x_mod" or similar (i.e. in
GP_Transform.h". Is there a LKML convention for that?
******
While we are at it, we might unify GP_IS_CONTEXT_VALID and
GP_CHECK_CONTEXT. Is the distinction intentional?
*****
Please see GfxPrim dev wiki at
http://atrey.karlin.mff.cuni.cz/~gavento/GfxPrimWiki/ (will be moved
to gfxprim.ucw.cz)
In particular http://atrey.karlin.mff.cuni.cz/~gavento/GfxPrimWiki/dev/naming
with some sketches of naming scheme.
******
It definitely makes sense to have transforming+clipping versions of
operations as well as "bare" unsafe variants.
I would propose to remove the "T" prefix from transforming variants,
as most users will want the transforming behavior and to modify the
names of the "bare" functions. I would propose "GP_Line_" or
"GP_Line_Bare". What do you think?
******
Next proposal/question is about declaring public vs. private APIs.
Most of it is public by default, but then we have accessors for
GP_Context and others. What is the goal there?
Do we want GP_Context to be (partially) public, or do we want to
provide accessors for everything?
I would propose to make it public (to simplify things) and to solve
transformation problems by having different fields for
"user" w/h and "real" w/h. We need to somehow fix the context behavior
anyway, and the freedom we will retain by using accessors will be
probably very small.
If we want to keep non-transforming functions public, then we have to
provide access to GP_Context transformations (more accessors).
Tralala!
Tomas
3
12
[repo.or.cz] gfxprim.git branch master updated: 4fd5560abf4f40f8436fd4af18d604ceff3d64b8
by metan 25 Apr '11
by metan 25 Apr '11
25 Apr '11
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 4fd5560abf4f40f8436fd4af18d604ceff3d64b8 (commit)
from 4d97054a669a9060142863a6004144d993270c13 (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/4fd5560abf4f40f8436fd4af18d604ceff3d…
commit 4fd5560abf4f40f8436fd4af18d604ceff3d64b8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Apr 25 17:34:38 2011 +0200
Updated documentation.
diff --git a/doc/drawing_api.txt b/doc/drawing_api.txt
index 01b4480..707ad71 100644
--- a/doc/drawing_api.txt
+++ b/doc/drawing_api.txt
@@ -6,7 +6,7 @@ Fill
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Fill(GP_Context *context, GP_Pixel pixel);
+void GP_Fill(GP_Context *context, GP_Pixel pixel);
--------------------------------------------------------------------------------
Fills the context bitmap, respecting the clipping rect. This has the same effect
@@ -19,36 +19,32 @@ Lines
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_HLineXXY(GP_Context *context, int x0, int x1, int y,
- GP_Pixel pixel);
+void GP_HLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
-GP_RetCode GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
- GP_Pixel pixel);
+void GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
+ GP_Pixel pixel);
-GP_RetCode GP_HLine(GP_Context *context, int x0, int x1, int y,
- GP_Pixel pixel);
+void GP_HLine(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a horizontal line. The 'GP_HLine()' function is an alias for 'GP_HLineXXY()'.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_VLineXYY(GP_Context *context, int x, int y0, int y1,
- GP_Pixel pixel);
+void GP_VLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel);
-GP_RetCode GP_VLineXYH(GP_Context *context, int x, int y,
- unsigned int height, GP_Pixel pixel);
+void GP_VLineXYH(GP_Context *context, int x, int y,
+ unsigned int height, GP_Pixel pixel);
-GP_RetCode GP_VLine(GP_Context *context, int x, int y0, int y1,
- GP_Pixel pixel);
+void GP_VLine(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a vertical line. The 'GP_VLine()' function is an alias for 'GP_VLineXYY()'.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a line from (x0, y0) to (x1, y1), inclusive.
@@ -58,16 +54,16 @@ Circles
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Circle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_Circle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a circle.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a filled circle.
@@ -77,16 +73,16 @@ Ellipses
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws an ellipse.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a filled ellipse.
@@ -96,16 +92,16 @@ Triangles
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel);
+void GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a triangle.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_FillTriangle(GP_Context *context, int x0, int y0, int x1,
- int y1, int x2, int y2, GP_Pixel pixel);
+void GP_FillTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a filled triangle.
@@ -115,14 +111,14 @@ Rects
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_RectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_RectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
-GP_RetCode GP_Rect(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_Rect(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a rectangle.
@@ -132,14 +128,14 @@ The 'GP_Rect()' function is an alias for 'GP_RectXYXY()'.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_FillRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_FillRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
-GP_RetCode GP_FillRect(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_FillRect(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a filled rectangle.
@@ -154,16 +150,16 @@ Tetragons
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel);
+void GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a tetragon.
[source,c]
--------------------------------------------------------------------------------
-GP_RetCode GP_FillTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel);
+void GP_FillTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
--------------------------------------------------------------------------------
Draws a filled tetragon.
-----------------------------------------------------------------------
Summary of changes:
doc/drawing_api.txt | 82 ++++++++++++++++++++++++--------------------------
1 files changed, 39 insertions(+), 43 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.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 4d97054a669a9060142863a6004144d993270c13
by metan 25 Apr '11
by metan 25 Apr '11
25 Apr '11
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 4d97054a669a9060142863a6004144d993270c13 (commit)
via 4df5151ae9400f76567697fd5c88917d9ee79229 (commit)
via 31bfb14e08456f70a7823efa3832ad4e3ffbb9d3 (commit)
from 5815d26c3a7e2a3be30f5d075c4ca064092734a3 (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/4d97054a669a9060142863a6004144d99327…
commit 4d97054a669a9060142863a6004144d993270c13
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Apr 25 15:45:19 2011 +0200
Simplified drawing API and unified context check.
* The API now returns void (where it makes sense)
* Now we use GP_CHECK_CONTEXT() before we touch
the context itself
However the GP_CHECK_CONTEXT() as it is now is not
as good as it should be. That is left for future now.
diff --git a/core/GP_Circle.c b/core/GP_Circle.c
index 19718bb..354405e 100644
--- a/core/GP_Circle.c
+++ b/core/GP_Circle.c
@@ -36,26 +36,21 @@ DEF_CIRCLE_FN(GP_Circle16bpp, GP_Context *, GP_Pixel, GP_PutPixel16bpp)
DEF_CIRCLE_FN(GP_Circle24bpp, GP_Context *, GP_Pixel, GP_PutPixel24bpp)
DEF_CIRCLE_FN(GP_Circle32bpp, GP_Context *, GP_Pixel, GP_PutPixel32bpp)
-GP_RetCode GP_Circle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel)
+void GP_Circle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_Circle, context, xcenter, ycenter, r, pixel);
}
-GP_RetCode GP_TCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel)
+void GP_TCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
/* Just recalculate center point */
GP_TRANSFORM_POINT(context, xcenter, ycenter);
- return GP_Circle(context, xcenter, ycenter, r, pixel);
+
+ GP_Circle(context, xcenter, ycenter, r, pixel);
}
diff --git a/core/GP_Circle.h b/core/GP_Circle.h
index 7c4bdbe..9c2d4ea 100644
--- a/core/GP_Circle.h
+++ b/core/GP_Circle.h
@@ -28,10 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_Circle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_Circle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
-GP_RetCode GP_TCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_TCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
#endif /* GP_CIRCLE_H */
diff --git a/core/GP_Context.h b/core/GP_Context.h
index f9f8155..65c14d0 100644
--- a/core/GP_Context.h
+++ b/core/GP_Context.h
@@ -71,15 +71,6 @@ inline GP_PixelType GP_GetContextPixelType(const GP_Context *context);
((GP_PixelSize(pixel_type) * width) / 8 + !!((GP_PixelSize(pixel_type) * width) % 8))
-/* Evaluates to true if the context is valid (sane), false otherwise. */
-#define GP_IS_CONTEXT_VALID(context) ( - context->w > 0 && context->h > 0 - && context->clip_w_min <= context->clip_w_max - && context->clip_w_max < context->w - && context->clip_h_min <= context->clip_h_max - && context->clip_h_max < context->h - )
-
/* Performs a series of sanity checks on context, aborting if any fails. */
#define GP_CHECK_CONTEXT(context) do { GP_CHECK(context != NULL); diff --git a/core/GP_Ellipse.c b/core/GP_Ellipse.c
index cf89cc6..d499501 100644
--- a/core/GP_Ellipse.c
+++ b/core/GP_Ellipse.c
@@ -36,27 +36,22 @@ DEF_ELLIPSE_FN(GP_Ellipse16bpp, GP_Context *, GP_Pixel, GP_PutPixel16bpp);
DEF_ELLIPSE_FN(GP_Ellipse24bpp, GP_Context *, GP_Pixel, GP_PutPixel24bpp);
DEF_ELLIPSE_FN(GP_Ellipse32bpp, GP_Context *, GP_Pixel, GP_PutPixel32bpp);
-GP_RetCode GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel)
+void GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_Ellipse, context, xcenter, ycenter, a, b, pixel);
}
-GP_RetCode GP_TEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel)
+void GP_TEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
/* recalculate center point and swap a and b when axes are swapped */
GP_TRANSFORM_POINT(context, xcenter, ycenter);
GP_TRANSFORM_SWAP(context, a, b);
- return GP_Ellipse(context, xcenter, ycenter, a, b, pixel);
+
+ GP_Ellipse(context, xcenter, ycenter, a, b, pixel);
}
diff --git a/core/GP_Ellipse.h b/core/GP_Ellipse.h
index 73b68fa..5f29458 100644
--- a/core/GP_Ellipse.h
+++ b/core/GP_Ellipse.h
@@ -28,10 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_Ellipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
-GP_RetCode GP_TEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_TEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
#endif /* GP_ELLIPSE_H */
diff --git a/core/GP_Fill.c b/core/GP_Fill.c
index 94316cb..65065cc 100644
--- a/core/GP_Fill.c
+++ b/core/GP_Fill.c
@@ -28,9 +28,11 @@
#include "GP.h"
-GP_RetCode GP_Fill(GP_Context *context, GP_Pixel pixel)
+void GP_Fill(GP_Context *context, GP_Pixel pixel)
{
- return GP_FillRect(context, 0, 0, context->w, context->h, pixel);
+ GP_CHECK_CONTEXT(context);
+
+ GP_FillRect(context, 0, 0, context->w, context->h, pixel);
}
#endif /* GP_FILL_H */
diff --git a/core/GP_Fill.h b/core/GP_Fill.h
index aac358b..87af0d4 100644
--- a/core/GP_Fill.h
+++ b/core/GP_Fill.h
@@ -28,6 +28,6 @@
#include "GP_Context.h"
-GP_RetCode GP_Fill(GP_Context *context, GP_Pixel pixel);
+void GP_Fill(GP_Context *context, GP_Pixel pixel);
#endif /* GP_FILL_H */
diff --git a/core/GP_FillCircle.c b/core/GP_FillCircle.c
index df58838..e2a0f1f 100644
--- a/core/GP_FillCircle.c
+++ b/core/GP_FillCircle.c
@@ -36,25 +36,20 @@ DEF_FILLCIRCLE_FN(GP_FillCircle16bpp, GP_Context *, GP_Pixel, GP_HLine16bpp)
DEF_FILLCIRCLE_FN(GP_FillCircle24bpp, GP_Context *, GP_Pixel, GP_HLine24bpp)
DEF_FILLCIRCLE_FN(GP_FillCircle32bpp, GP_Context *, GP_Pixel, GP_HLine32bpp)
-GP_RetCode GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel)
+void GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_FillCircle, context, xcenter, ycenter, r, pixel);
}
-GP_RetCode GP_TFillCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel)
+void GP_TFillCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, xcenter, ycenter);
- return GP_FillCircle(context, xcenter, ycenter, r, pixel);
+
+ GP_FillCircle(context, xcenter, ycenter, r, pixel);
}
diff --git a/core/GP_FillCircle.h b/core/GP_FillCircle.h
index 802eba6..208a6b8 100644
--- a/core/GP_FillCircle.h
+++ b/core/GP_FillCircle.h
@@ -28,10 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_FillCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
-GP_RetCode GP_TFillCircle(GP_Context *context, int xcenter, int ycenter,
- unsigned int r, GP_Pixel pixel);
+void GP_TFillCircle(GP_Context *context, int xcenter, int ycenter,
+ unsigned int r, GP_Pixel pixel);
#endif /* GP_FILLCIRCLE_H */
diff --git a/core/GP_FillEllipse.c b/core/GP_FillEllipse.c
index c781e70..79df163 100644
--- a/core/GP_FillEllipse.c
+++ b/core/GP_FillEllipse.c
@@ -36,26 +36,21 @@ DEF_FILLELLIPSE_FN(GP_FillEllipse16bpp, GP_Context *, GP_Pixel, GP_HLine16bpp)
DEF_FILLELLIPSE_FN(GP_FillEllipse24bpp, GP_Context *, GP_Pixel, GP_HLine24bpp)
DEF_FILLELLIPSE_FN(GP_FillEllipse32bpp, GP_Context *, GP_Pixel, GP_HLine32bpp)
-GP_RetCode GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel)
+void GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_FillEllipse, context, xcenter, ycenter, a, b, pixel);
}
-GP_RetCode GP_TFillEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel)
+void GP_TFillEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, xcenter, ycenter);
GP_TRANSFORM_SWAP(context, a, b);
- return GP_FillEllipse(context, xcenter, ycenter, a, b, pixel);
+
+ GP_FillEllipse(context, xcenter, ycenter, a, b, pixel);
}
diff --git a/core/GP_FillEllipse.h b/core/GP_FillEllipse.h
index d35e39f..cf0c7c5 100644
--- a/core/GP_FillEllipse.h
+++ b/core/GP_FillEllipse.h
@@ -30,10 +30,10 @@
#include <stdint.h>
-GP_RetCode GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_FillEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
-GP_RetCode GP_TFillEllipse(GP_Context *context, int xcenter, int ycenter,
- unsigned int a, unsigned int b, GP_Pixel pixel);
+void GP_TFillEllipse(GP_Context *context, int xcenter, int ycenter,
+ unsigned int a, unsigned int b, GP_Pixel pixel);
#endif /* GP_FILLELLIPSE_H */
diff --git a/core/GP_FillRect.c b/core/GP_FillRect.c
index aab4bd4..05f7c65 100644
--- a/core/GP_FillRect.c
+++ b/core/GP_FillRect.c
@@ -25,15 +25,10 @@
#include "GP.h"
-#include <stdint.h>
-
-GP_RetCode GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel)
+void GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
if (y0 > y1)
GP_SWAP(y0, y1);
@@ -41,37 +36,35 @@ GP_RetCode GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
int y;
for (y = y0; y <= y1; y++)
GP_HLine(context, x0, x1, y, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_FillRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel)
+void GP_FillRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel)
{
+ /* zero width/height: draw nothing */
if (w == 0 || h == 0)
- return GP_ESUCCESS; /* zero width/height: draw nothing */
+ return;
return GP_FillRectXYXY(context, x, y, x + w - 1, y + h - 1, pixel);
}
-GP_RetCode GP_TFillRectXYXY(GP_Context *context, int x0, int y0,
- int x1, int y1, GP_Pixel pixel)
+void GP_TFillRectXYXY(GP_Context *context, int x0, int y0,
+ int x1, int y1, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
- return GP_FillRect(context, x0, y0, x1, y1, pixel);
+
+ GP_FillRect(context, x0, y0, x1, y1, pixel);
}
-GP_RetCode GP_TFillRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel)
+void GP_TFillRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel)
{
+ /* zero width/height: draw nothing */
if (w == 0 || h == 0)
- return GP_ESUCCESS; /* zero width/height: draw nothing */
+ return;
- return GP_TFillRectXYXY(context, x, y, x + w - 1, y + h - 1, pixel);
+ GP_TFillRectXYXY(context, x, y, x + w - 1, y + h - 1, pixel);
}
diff --git a/core/GP_FillRect.h b/core/GP_FillRect.h
index 2740bd0..c12f57e 100644
--- a/core/GP_FillRect.h
+++ b/core/GP_FillRect.h
@@ -28,17 +28,17 @@
#include "GP_Context.h"
-GP_RetCode GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_FillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_FillRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_FillRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
-GP_RetCode GP_TFillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_TFillRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_TFillRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_TFillRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
#define GP_FillRect GP_FillRectXYXY
#define GP_TFillRect GP_TFillRectXYXY
diff --git a/core/GP_FillTetragon.c b/core/GP_FillTetragon.c
index 1b29b49..9f7e36a 100644
--- a/core/GP_FillTetragon.c
+++ b/core/GP_FillTetragon.c
@@ -25,33 +25,25 @@
#include "GP.h"
-GP_RetCode GP_FillTetragon(GP_Context * context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel)
+void GP_FillTetragon(GP_Context * context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
//TODO: fix this!
GP_FillTriangle(context, x0, y0, x1, y1, x2, y2, pixel);
GP_FillTriangle(context, x3, y3, x1, y1, x2, y2, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_TFillTetragon(GP_Context* context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel)
+void GP_TFillTetragon(GP_Context* context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
GP_TRANSFORM_POINT(context, x2, y2);
GP_TRANSFORM_POINT(context, x3, y3);
- return GP_FillTetragon(context, x0, y0, x1, y1, x2, y2, x3, y3, pixel);
+ GP_FillTetragon(context, x0, y0, x1, y1, x2, y2, x3, y3, pixel);
}
diff --git a/core/GP_FillTetragon.h b/core/GP_FillTetragon.h
index b8ff2d3..0335648 100644
--- a/core/GP_FillTetragon.h
+++ b/core/GP_FillTetragon.h
@@ -28,11 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_FillTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel);
+void GP_FillTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
-GP_RetCode GP_TFillTetragon(GP_Context *context, int x0, int y0,
- int x1, int y1, int x2, int y2, int x3, int y3,
- GP_Pixel pixel);
+void GP_TFillTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
#endif /* GP_FILLTETRAGON_H */
diff --git a/core/GP_FillTriangle.c b/core/GP_FillTriangle.c
index ea196dc..3b483d6 100644
--- a/core/GP_FillTriangle.c
+++ b/core/GP_FillTriangle.c
@@ -39,27 +39,22 @@ DEF_FILLTRIANGLE_FN(GP_FillTriangle16bpp, GP_Context *, GP_Pixel, GP_HLine16bpp,
DEF_FILLTRIANGLE_FN(GP_FillTriangle24bpp, GP_Context *, GP_Pixel, GP_HLine24bpp, GP_PutPixel24bpp)
DEF_FILLTRIANGLE_FN(GP_FillTriangle32bpp, GP_Context *, GP_Pixel, GP_HLine32bpp, GP_PutPixel32bpp)
-GP_RetCode GP_FillTriangle(GP_Context * context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel)
+void GP_FillTriangle(GP_Context * context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_FillTriangle, context, x0, y0, x1, y1, x2, y2, pixel);
}
-GP_RetCode GP_TFillTriangle(GP_Context* context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel)
+void GP_TFillTriangle(GP_Context* context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
GP_TRANSFORM_POINT(context, x2, y2);
- return GP_FillTriangle(context, x0, y0, x1, y1, x2, y2, pixel);
+
+ GP_FillTriangle(context, x0, y0, x1, y1, x2, y2, pixel);
}
diff --git a/core/GP_FillTriangle.h b/core/GP_FillTriangle.h
index c6a31e5..11e0b4f 100644
--- a/core/GP_FillTriangle.h
+++ b/core/GP_FillTriangle.h
@@ -29,10 +29,10 @@
#include "GP_Context.h"
#include "GP_Common.h"
-GP_RetCode GP_FillTriangle(GP_Context *context, int x0, int y0, int x1,
- int y1, int x2, int y2, GP_Pixel pixel);
+void GP_FillTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
-GP_RetCode GP_TFillTriangle(GP_Context *context, int x0, int y0, int x1,
- int y1, int x2, int y2, GP_Pixel pixel);
+void GP_TFillTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
#endif /* GP_FILLTRIANGLE_H */
diff --git a/core/GP_FnPerBpp.h b/core/GP_FnPerBpp.h
index 4b5a6e8..712d3b0 100644
--- a/core/GP_FnPerBpp.h
+++ b/core/GP_FnPerBpp.h
@@ -61,10 +61,8 @@
FN_NAME##32bpp(__VA_ARGS__); break; default: - return GP_ENOIMPL; + break; } -- return GP_ESUCCESS;
#define GP_FN_RET_PER_BPP(FN_NAME, ...) diff --git a/core/GP_HLine.c b/core/GP_HLine.c
index 16a2df1..9e14052 100644
--- a/core/GP_HLine.c
+++ b/core/GP_HLine.c
@@ -36,50 +36,46 @@ DEF_HLINE_FN(GP_HLine16bpp, GP_Context *, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixel
DEF_HLINE_FN(GP_HLine24bpp, GP_Context *, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels24bpp)
DEF_HLINE_FN(GP_HLine32bpp, GP_Context *, GP_Pixel, GP_PIXEL_ADDR, GP_WritePixels32bpp)
-GP_RetCode GP_HLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel)
+void GP_HLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_FN_PER_BPP(GP_HLine, context, x0, x1, y, pixel);
}
-GP_RetCode GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
- GP_Pixel pixel)
+void GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
+ GP_Pixel pixel)
{
+ /* zero width: do not draw anything */
if (w == 0)
- return GP_ESUCCESS; /* zero width: do not draw anything */
+ return;
- return GP_HLineXXY(context, x, x + w - 1, y, pixel);
+ GP_HLineXXY(context, x, x + w - 1, y, pixel);
}
-GP_RetCode GP_THLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel)
+void GP_THLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
if (context->axes_swap) {
GP_TRANSFORM_Y(context, x0);
GP_TRANSFORM_Y(context, x1);
GP_TRANSFORM_X(context, y);
- return GP_VLine(context, y, x0, x1, pixel);
+ GP_VLine(context, y, x0, x1, pixel);
+ } else {
+ GP_TRANSFORM_X(context, x0);
+ GP_TRANSFORM_X(context, x1);
+ GP_TRANSFORM_Y(context, y);
+ GP_HLine(context, x0, x1, y, pixel);
}
-
- GP_TRANSFORM_X(context, x0);
- GP_TRANSFORM_X(context, x1);
- GP_TRANSFORM_Y(context, y);
- return GP_HLine(context, x0, x1, y, pixel);
}
-GP_RetCode GP_THLineXYW(GP_Context *context, int x, int y, unsigned int w,
- GP_Pixel pixel)
+void GP_THLineXYW(GP_Context *context, int x, int y, unsigned int w,
+ GP_Pixel pixel)
{
+ /* zero width: do not draw anything */
if (w == 0)
- return GP_ESUCCESS; /* zero width: do not draw anything */
+ return;
- return GP_THLineXXY(context, x, x + w - 1, y, pixel);
+ GP_THLineXXY(context, x, x + w - 1, y, pixel);
}
diff --git a/core/GP_HLine.h b/core/GP_HLine.h
index b625b84..7cdd11c 100644
--- a/core/GP_HLine.h
+++ b/core/GP_HLine.h
@@ -38,17 +38,15 @@ void GP_HLine16bpp(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
void GP_HLine24bpp(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
void GP_HLine32bpp(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
-GP_RetCode GP_HLineXXY(GP_Context *context, int x0, int x1, int y,
- GP_Pixel pixel);
+void GP_HLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
-GP_RetCode GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
- GP_Pixel pixel);
+void GP_HLineXYW(GP_Context *context, int x, int y, unsigned int w,
+ GP_Pixel pixel);
-GP_RetCode GP_THLineXXY(GP_Context *context, int x0, int x1, int y,
- GP_Pixel pixel);
+void GP_THLineXXY(GP_Context *context, int x0, int x1, int y, GP_Pixel pixel);
-GP_RetCode GP_THLineXYW(GP_Context *context, int x, int y, unsigned int w,
- GP_Pixel pixel);
+void GP_THLineXYW(GP_Context *context, int x, int y, unsigned int w,
+ GP_Pixel pixel);
/* default argument set is XXY */
#define GP_HLine GP_HLineXXY
diff --git a/core/GP_Line.c b/core/GP_Line.c
index dd6af18..d8f495f 100644
--- a/core/GP_Line.c
+++ b/core/GP_Line.c
@@ -36,26 +36,21 @@ DEF_LINE_FN(GP_Line16bpp, GP_Context *, GP_Pixel, GP_PutPixel16bpp)
DEF_LINE_FN(GP_Line24bpp, GP_Context *, GP_Pixel, GP_PutPixel24bpp)
DEF_LINE_FN(GP_Line32bpp, GP_Context *, GP_Pixel, GP_PutPixel32bpp)
-GP_RetCode GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel)
+void GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_Line, context, x0, y0, x1, y1, pixel);
}
-GP_RetCode GP_TLine(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel)
+void GP_TLine(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
- return GP_Line(context, x0, y0, x1, y1, pixel);
+
+ GP_Line(context, x0, y0, x1, y1, pixel);
}
diff --git a/core/GP_Line.h b/core/GP_Line.h
index 2c72f29..38c0290 100644
--- a/core/GP_Line.h
+++ b/core/GP_Line.h
@@ -39,10 +39,10 @@ void GP_Line24bpp(GP_Context *context, int x0, int y0, int x1, int y1,
void GP_Line32bpp(GP_Context *context, int x0, int y0, int x1, int y1,
GP_Pixel pixel);
-GP_RetCode GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_Line(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_TLine(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_TLine(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
#endif /* GP_LINE_H */
diff --git a/core/GP_PutPixel.c b/core/GP_PutPixel.c
index 32108da..5e62a5b 100644
--- a/core/GP_PutPixel.c
+++ b/core/GP_PutPixel.c
@@ -28,14 +28,12 @@
#include "GP_FnPerBpp.h"
#define DO_PUTPIXEL(bits) -GP_RetCode GP_PutPixel##bits##bpp(GP_Context *context, int x, int y, GP_Pixel pixel) +void GP_PutPixel##bits##bpp(GP_Context *context, int x, int y, GP_Pixel pixel) { if (GP_PIXEL_IS_CLIPPED(context, x, y)) - return GP_ESUCCESS; + return; GP_PUTPIXEL_##bits##BPP(context, x, y, pixel); -- return GP_ESUCCESS; }
DO_PUTPIXEL(1)
@@ -50,23 +48,18 @@ DO_PUTPIXEL(32)
* A generic PutPixel call that automatically determines the number of
* bits per pixel.
*/
-GP_RetCode GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel pixel)
+void GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_PutPixel, context, x, y, pixel);
}
-GP_RetCode GP_TPutPixel(GP_Context *context, int x, int y, GP_Pixel pixel)
+void GP_TPutPixel(GP_Context *context, int x, int y, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_TRANSFORM_POINT(context, x, y);
- return GP_PutPixel(context, x, y, pixel);
+
+ GP_PutPixel(context, x, y, pixel);
}
diff --git a/core/GP_PutPixel.h b/core/GP_PutPixel.h
index c0be692..fe5b219 100644
--- a/core/GP_PutPixel.h
+++ b/core/GP_PutPixel.h
@@ -88,22 +88,22 @@
/*
* Safe functions, that checks clipping.
*/
-GP_RetCode GP_PutPixel1bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel2bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel4bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel8bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel16bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel24bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
-GP_RetCode GP_PutPixel32bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel1bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel2bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel4bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel8bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel16bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel24bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel32bpp(GP_Context *context, int x, int y, GP_Pixel pixel);
/*
* General putpixel.
*/
-GP_RetCode GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_PutPixel(GP_Context *context, int x, int y, GP_Pixel pixel);
/*
* General rotated putpixel.
*/
-GP_RetCode GP_TPutPixel(GP_Context *context, int x, int y, GP_Pixel pixel);
+void GP_TPutPixel(GP_Context *context, int x, int y, GP_Pixel pixel);
#endif /* GP_PUTPIXEL_H */
diff --git a/core/GP_Rect.c b/core/GP_Rect.c
index ffeb886..08cecc1 100644
--- a/core/GP_Rect.c
+++ b/core/GP_Rect.c
@@ -25,51 +25,41 @@
#include "GP.h"
-GP_RetCode GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel)
+void GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_HLine(context, x0, x1, y0, pixel);
GP_HLine(context, x0, x1, y1, pixel);
GP_VLine(context, x0, y0, y1, pixel);
GP_VLine(context, x1, y0, y1, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_RectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel)
+void GP_RectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_HLine(context, x, x + w, y, pixel);
GP_HLine(context, x, x + w, y + h, pixel);
GP_VLine(context, x, y, y + h, pixel);
GP_VLine(context, x + w, y, y + h, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_TRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel)
+void GP_TRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel)
{
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
- return GP_Rect(context, x0, y0, x1, y1, pixel);
+
+ GP_RectXYXY(context, x0, y0, x1, y1, pixel);
}
-GP_RetCode GP_TRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel)
+void GP_TRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel)
{
- int x1 = x + w;
- int y1 = y + h;
- return GP_TRect(context, x, y, x1, y1, pixel);
+ GP_TRectXYXY(context, x, y, x + w, y + h, pixel);
}
-
diff --git a/core/GP_Rect.h b/core/GP_Rect.h
index 4e97a90..63ef486 100644
--- a/core/GP_Rect.h
+++ b/core/GP_Rect.h
@@ -28,17 +28,17 @@
#include "GP_Context.h"
-GP_RetCode GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_RectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_RectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_RectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
-GP_RetCode GP_TRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
- GP_Pixel pixel);
+void GP_TRectXYXY(GP_Context *context, int x0, int y0, int x1, int y1,
+ GP_Pixel pixel);
-GP_RetCode GP_TRectXYWH(GP_Context *context, int x, int y,
- unsigned int w, unsigned int h, GP_Pixel pixel);
+void GP_TRectXYWH(GP_Context *context, int x, int y,
+ unsigned int w, unsigned int h, GP_Pixel pixel);
/* The XYXY argument set is the default */
#define GP_Rect GP_RectXYXY
diff --git a/core/GP_Symbol.c b/core/GP_Symbol.c
index 4b35c6e..95bd3b8 100644
--- a/core/GP_Symbol.c
+++ b/core/GP_Symbol.c
@@ -53,31 +53,23 @@
#define DO_DECREMENT(a) do { if ((a) == 0) - return GP_ESUCCESS; + return; (a)--; } while (0)
/*
* Generate code for triangle
*/
-#define TRIANGLE(context, base, x, y, w, h, fn_pref, - TRIANGLE_PARAMS, TETRAGON_PARAMS, pixel) do { - if (base % 2) - return fn_pref##Tetragon(context, - TETRAGON_PARAMS(x, y, w, h), - pixel); - else - return fn_pref##Triangle(context, - TRIANGLE_PARAMS(x, y, w, h), - pixel); +#define TRIANGLE(context, base, x, y, w, h, fn_pref, + TRIANGLE_PARAMS, TETRAGON_PARAMS, pixel) do { + if (base % 2) + fn_pref##Tetragon(context, TETRAGON_PARAMS(x, y, w, h), pixel)
;+ else + fn_pref##Triangle(context, TRIANGLE_PARAMS(x, y, w, h), pixel); } while (0)
-/*
- * TODO: even sizes should have two pixes at the top to became symetrical
- */
-GP_RetCode GP_Symbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel)
+void GP_Symbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel)
{
DO_DECREMENT(w);
DO_DECREMENT(h);
@@ -86,23 +78,26 @@ GP_RetCode GP_Symbol(GP_Context *context, GP_SymbolType sym,
case GP_SYM_TRIANGLE_UP:
TRIANGLE(context, w, x, y, w, h, GP_,
DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel);
+ break;
case GP_SYM_TRIANGLE_DOWN:
TRIANGLE(context, w, x, y, w, h, GP_,
DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel);
+ break;
case GP_SYM_TRIANGLE_LEFT:
TRIANGLE(context, h, x, y, w, h, GP_,
DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel);
+ break;
case GP_SYM_TRIANGLE_RIGHT:
TRIANGLE(context, h, x, y, w, h, GP_,
DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel);
+ break;
default:
- return GP_ENOIMPL;
+ break;
}
}
-GP_RetCode GP_FillSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel)
+void GP_FillSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel)
{
DO_DECREMENT(w);
DO_DECREMENT(h);
@@ -111,23 +106,26 @@ GP_RetCode GP_FillSymbol(GP_Context *context, GP_SymbolType sym,
case GP_SYM_TRIANGLE_UP:
TRIANGLE(context, w, x, y, w, h, GP_Fill,
DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel);
+ break;
case GP_SYM_TRIANGLE_DOWN:
TRIANGLE(context, w, x, y, w, h, GP_Fill,
DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel);
+ break;
case GP_SYM_TRIANGLE_LEFT:
TRIANGLE(context, h, x, y, w, h, GP_Fill,
DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel);
+ break;
case GP_SYM_TRIANGLE_RIGHT:
TRIANGLE(context, h, x, y, w, h, GP_Fill,
DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel);
+ break;
default:
- return GP_ENOIMPL;
+ break;
}
}
-GP_RetCode GP_TSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel)
+void GP_TSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel)
{
DO_DECREMENT(w);
DO_DECREMENT(h);
@@ -136,23 +134,26 @@ GP_RetCode GP_TSymbol(GP_Context *context, GP_SymbolType sym,
case GP_SYM_TRIANGLE_UP:
TRIANGLE(context, w, x, y, w, h, GP_T,
DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel);
+ break;
case GP_SYM_TRIANGLE_DOWN:
TRIANGLE(context, w, x, y, w, h, GP_T,
DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel);
+ break;
case GP_SYM_TRIANGLE_LEFT:
TRIANGLE(context, h, x, y, w, h, GP_T,
DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel);
+ break;
case GP_SYM_TRIANGLE_RIGHT:
TRIANGLE(context, h, x, y, w, h, GP_T,
DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel);
+ break;
default:
- return GP_ENOIMPL;
+ break;
}
}
-GP_RetCode GP_TFillSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel)
+void GP_TFillSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel)
{
DO_DECREMENT(w);
DO_DECREMENT(h);
@@ -161,16 +162,20 @@ GP_RetCode GP_TFillSymbol(GP_Context *context, GP_SymbolType sym,
case GP_SYM_TRIANGLE_UP:
TRIANGLE(context, w, x, y, w, h, GP_TFill,
DO_TRIANGLE_UP, DO_TETRAGON_UP, pixel);
+ break;
case GP_SYM_TRIANGLE_DOWN:
TRIANGLE(context, w, x, y, w, h, GP_TFill,
DO_TRIANGLE_DOWN, DO_TETRAGON_DOWN, pixel);
+ break;
case GP_SYM_TRIANGLE_LEFT:
TRIANGLE(context, h, x, y, w, h, GP_TFill,
DO_TRIANGLE_LEFT, DO_TETRAGON_LEFT, pixel);
+ break;
case GP_SYM_TRIANGLE_RIGHT:
TRIANGLE(context, h, x, y, w, h, GP_TFill,
DO_TRIANGLE_RIGHT, DO_TETRAGON_RIGHT, pixel);
+ break;
default:
- return GP_ENOIMPL;
+ break;
}
}
diff --git a/core/GP_Symbol.h b/core/GP_Symbol.h
index 606ccc3..259bddb 100644
--- a/core/GP_Symbol.h
+++ b/core/GP_Symbol.h
@@ -42,20 +42,16 @@ typedef enum GP_SymbolType {
GP_SYM_MAX,
} GP_SymbolType;
-GP_RetCode GP_Symbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel);
+void GP_Symbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel);
-GP_RetCode GP_TSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel);
+void GP_TSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel);
-GP_RetCode GP_FillSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel);
+void GP_FillSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel);
-GP_RetCode GP_TFillSymbol(GP_Context *context, GP_SymbolType sym,
- int x, int y, int w, int h,
- GP_Pixel pixel);
+void GP_TFillSymbol(GP_Context *context, GP_SymbolType sym,
+ int x, int y, int w, int h, GP_Pixel pixel);
#endif /* GP_SYMBOL_H */
diff --git a/core/GP_Tetragon.c b/core/GP_Tetragon.c
index d85e862..4618002 100644
--- a/core/GP_Tetragon.c
+++ b/core/GP_Tetragon.c
@@ -25,34 +25,26 @@
#include "GP.h"
-GP_RetCode GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel)
+void GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_Line(context, x0, y0, x1, y1, pixel);
GP_Line(context, x1, y1, x2, y2, pixel);
GP_Line(context, x2, y2, x3, y3, pixel);
GP_Line(context, x3, y3, x0, y0, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_TTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel)
+void GP_TTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
GP_TRANSFORM_POINT(context, x2, y2);
GP_TRANSFORM_POINT(context, x3, y3);
- return GP_Tetragon(context, x0, y0, x1, y1, x2, y2, x3, y3, pixel);
+ GP_Tetragon(context, x0, y0, x1, y1, x2, y2, x3, y3, pixel);
}
diff --git a/core/GP_Tetragon.h b/core/GP_Tetragon.h
index e5e380f..5ed30d0 100644
--- a/core/GP_Tetragon.h
+++ b/core/GP_Tetragon.h
@@ -28,10 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel);
+void GP_Tetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
-GP_RetCode GP_TTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, int x3, int y3, GP_Pixel pixel);
+void GP_TTetragon(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, int x3, int y3, GP_Pixel pixel);
#endif /* GP_TETRAGON_H */
diff --git a/core/GP_Text.c b/core/GP_Text.c
index a057b45..e3bcbb2 100644
--- a/core/GP_Text.c
+++ b/core/GP_Text.c
@@ -42,12 +42,13 @@ DEF_TEXT_FN(GP_TText_internal, GP_Context *, GP_Pixel, GP_THLine)
GP_RetCode GP_Text(GP_Context *context, const GP_TextStyle *style,
int x, int y, int align, const char *str, GP_Pixel pixel)
{
+ GP_CHECK_CONTEXT(context);
+
if (style != NULL && style->font == NULL)
return GP_ENULLPTR;
- if (!context || !str)
+ if (str == NULL)
return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+
if (style == NULL)
style = &DefaultStyle;
@@ -87,18 +88,20 @@ GP_RetCode GP_Text(GP_Context *context, const GP_TextStyle *style,
}
GP_FN_PER_BPP(GP_Text, context, style, topleft_x, topleft_y, str, pixel);
+
+ return GP_ESUCCESS;
}
GP_RetCode GP_TText(GP_Context *context, const GP_TextStyle *style,
int x, int y, int align, const char *str, GP_Pixel pixel)
{
+ GP_CHECK_CONTEXT(context);
+
if (style != NULL && style->font == NULL)
return GP_ENULLPTR;
- if (!context || !str)
+ if (str == NULL)
return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+
if (style == NULL)
style = &DefaultStyle;
@@ -143,13 +146,12 @@ GP_RetCode GP_TText(GP_Context *context, const GP_TextStyle *style,
GP_RetCode GP_BoxCenteredText(GP_Context *context, const GP_TextStyle *style,
int x, int y, int w, int h, const char *str, GP_Pixel pixel)
{
+ GP_CHECK_CONTEXT(context);
if (style != NULL && style->font == NULL)
return GP_ENULLPTR;
- if (!context || !str)
+ if (str == NULL)
return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
if (style == NULL)
style = &DefaultStyle;
@@ -167,13 +169,12 @@ GP_RetCode GP_BoxCenteredText(GP_Context *context, const GP_TextStyle *style,
GP_RetCode GP_TBoxCenteredText(GP_Context *context, const GP_TextStyle *style,
int x, int y, int w, int h, const char *str, GP_Pixel pixel)
{
+ GP_CHECK_CONTEXT(context);
if (style != NULL && style->font == NULL)
return GP_ENULLPTR;
- if (!context || !str)
+ if (str == NULL)
return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
if (style == NULL)
style = &DefaultStyle;
diff --git a/core/GP_TextStyle.c b/core/GP_TextStyle.c
index 5149c01..3c7fc00 100644
--- a/core/GP_TextStyle.c
+++ b/core/GP_TextStyle.c
@@ -25,16 +25,12 @@
#include "GP.h"
-GP_RetCode GP_DefaultTextStyle(GP_TextStyle *style)
+void GP_DefaultTextStyle(GP_TextStyle *style)
{
- if (!style)
- return GP_ENULLPTR;
-
style->font = &GP_default_console_font;
style->pixel_xspace = 0;
style->pixel_yspace = 0;
style->pixel_xmul = 1;
style->pixel_ymul = 1;
style->char_xspace = 0;
- return GP_ESUCCESS;
}
diff --git a/core/GP_TextStyle.h b/core/GP_TextStyle.h
index 75c8719..7327ae4 100644
--- a/core/GP_TextStyle.h
+++ b/core/GP_TextStyle.h
@@ -60,6 +60,6 @@ typedef struct {
/*
* Initalize text style to the default values.
*/
-GP_RetCode GP_DefaultTextStyle(GP_TextStyle *style);
+void GP_DefaultTextStyle(GP_TextStyle *style);
#endif /* GP_TEXTSTYLE_H */
diff --git a/core/GP_Triangle.c b/core/GP_Triangle.c
index 041d35d..82caa55 100644
--- a/core/GP_Triangle.c
+++ b/core/GP_Triangle.c
@@ -25,32 +25,24 @@
#include "GP.h"
-GP_RetCode GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel)
+void GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_Line(context, x0, y0, x1, y1, pixel);
GP_Line(context, x0, y0, x2, y2, pixel);
GP_Line(context, x1, y1, x2, y2, pixel);
-
- return GP_ESUCCESS;
}
-GP_RetCode GP_TTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel)
+void GP_TTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
GP_TRANSFORM_POINT(context, x0, y0);
GP_TRANSFORM_POINT(context, x1, y1);
GP_TRANSFORM_POINT(context, x2, y2);
- return GP_Triangle(context, x0, y0, x1, y1, x2, y2, pixel);
+ GP_Triangle(context, x0, y0, x1, y1, x2, y2, pixel);
}
diff --git a/core/GP_Triangle.h b/core/GP_Triangle.h
index c44294a..3684b11 100644
--- a/core/GP_Triangle.h
+++ b/core/GP_Triangle.h
@@ -28,10 +28,10 @@
#include "GP_Context.h"
-GP_RetCode GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel);
+void GP_Triangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
-GP_RetCode GP_TTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
- int x2, int y2, GP_Pixel pixel);
+void GP_TTriangle(GP_Context *context, int x0, int y0, int x1, int y1,
+ int x2, int y2, GP_Pixel pixel);
#endif /* GP_TRIANGLE_H */
diff --git a/core/GP_VLine.c b/core/GP_VLine.c
index 73aab05..91e59b3 100644
--- a/core/GP_VLine.c
+++ b/core/GP_VLine.c
@@ -36,50 +36,46 @@ DEF_VLINE_FN(GP_VLine16bpp, GP_Context *, GP_Pixel, GP_PutPixel16bpp)
DEF_VLINE_FN(GP_VLine24bpp, GP_Context *, GP_Pixel, GP_PutPixel24bpp)
DEF_VLINE_FN(GP_VLine32bpp, GP_Context *, GP_Pixel, GP_PutPixel32bpp)
-GP_RetCode GP_VLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel)
+void GP_VLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
+ GP_CHECK_CONTEXT(context);
GP_FN_PER_BPP(GP_VLine, context, x, y0, y1, pixel);
}
-GP_RetCode GP_VLineXYH(GP_Context *context, int x, int y, unsigned int height,
- GP_Pixel pixel)
+void GP_VLineXYH(GP_Context *context, int x, int y, unsigned int height,
+ GP_Pixel pixel)
{
+ /* zero height: do not draw anything */
if (height == 0)
- return GP_ESUCCESS; /* zero height: do not draw anything */
+ return;
- return GP_VLineXYY(context, x, y, y + height - 1, pixel);
+ GP_VLineXYY(context, x, y, y + height - 1, pixel);
}
-GP_RetCode GP_TVLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel)
+void GP_TVLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel)
{
- if (!context)
- return GP_ENULLPTR;
- if (!GP_IS_CONTEXT_VALID(context))
- return GP_EBADCONTEXT;
-
+ GP_CHECK_CONTEXT(context);
+
if (context->axes_swap) {
GP_TRANSFORM_Y(context, x);
GP_TRANSFORM_X(context, y0);
GP_TRANSFORM_X(context, y1);
- return GP_HLine(context, y0, y1, x, pixel);
+ GP_HLine(context, y0, y1, x, pixel);
+ } else {
+ GP_TRANSFORM_X(context, x);
+ GP_TRANSFORM_Y(context, y0);
+ GP_TRANSFORM_Y(context, y1);
+ GP_VLine(context, x, y0, y1, pixel);
}
-
- GP_TRANSFORM_X(context, x);
- GP_TRANSFORM_Y(context, y0);
- GP_TRANSFORM_Y(context, y1);
- return GP_VLine(context, x, y0, y1, pixel);
}
-GP_RetCode GP_TVLineXYH(GP_Context *context, int x, int y, unsigned int height,
- GP_Pixel pixel)
+void GP_TVLineXYH(GP_Context *context, int x, int y, unsigned int height,
+ GP_Pixel pixel)
{
+ /* zero height: do not draw anything */
if (height == 0)
- return GP_ESUCCESS; /* zero height: do not draw anything */
+ return;
- return GP_TVLineXYY(context, x, y, y + height - 1, pixel);
+ GP_TVLineXYY(context, x, y, y + height - 1, pixel);
}
diff --git a/core/GP_VLine.h b/core/GP_VLine.h
index f5458d6..3f943ec 100644
--- a/core/GP_VLine.h
+++ b/core/GP_VLine.h
@@ -28,17 +28,15 @@
#include "GP_Context.h"
-GP_RetCode GP_VLineXYY(GP_Context *context, int x, int y0, int y1,
- GP_Pixel pixel);
+void GP_VLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel);
-GP_RetCode GP_VLineXYH(GP_Context *context, int x, int y,
- unsigned int height, GP_Pixel pixel);
+void GP_VLineXYH(GP_Context *context, int x, int y,
+ unsigned int height, GP_Pixel pixel);
-GP_RetCode GP_TVLineXYY(GP_Context *context, int x, int y0, int y1,
- GP_Pixel pixel);
+void GP_TVLineXYY(GP_Context *context, int x, int y0, int y1, GP_Pixel pixel);
-GP_RetCode GP_TVLineXYH(GP_Context *context, int x, int y,
- unsigned int height, GP_Pixel pixel);
+void GP_TVLineXYH(GP_Context *context, int x, int y,
+ unsigned int height, GP_Pixel pixel);
/* default argument set is XYY */
#define GP_VLine GP_VLineXYY
diff --git a/filters/GP_Rotate.c b/filters/GP_Rotate.c
index 7586cc3..0d46a9c 100644
--- a/filters/GP_Rotate.c
+++ b/filters/GP_Rotate.c
@@ -78,6 +78,8 @@ GP_RetCode GP_MirrorV(GP_Context *context)
return GP_ENULLPTR;
GP_FN_PER_BPP(GP_MirrorV, context);
+
+ return GP_ESUCCESS;
}
DEF_ROTATECW_FN(GP_RotateCW1bpp, GP_Context *, GP_PUTPIXEL_1BPP, GP_GETPIXEL_1BPP)
http://repo.or.cz/w/gfxprim.git/commit/4df5151ae9400f76567697fd5c88917d9ee7…
commit 4df5151ae9400f76567697fd5c88917d9ee79229
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Apr 25 15:31:22 2011 +0200
The filled triangle should use GP_TPutPixel() not GP_PutPixel().
diff --git a/targets/sdl/tests/shapetest.c b/targets/sdl/tests/shapetest.c
index 806135f..6e17cc1 100644
--- a/targets/sdl/tests/shapetest.c
+++ b/targets/sdl/tests/shapetest.c
@@ -129,9 +129,9 @@ void draw_testing_triangle(int x, int y, int xradius, int yradius)
/* draw the three vertices green; they should never be visible
* because the red triangle should cover them; if they are visible,
* it means we don't draw to the end */
- GP_PutPixel(&context, x0, y0, green);
- GP_PutPixel(&context, x1, y1, green);
- GP_PutPixel(&context, x2, y2, green);
+ GP_TPutPixel(&context, x0, y0, green);
+ GP_TPutPixel(&context, x1, y1, green);
+ GP_TPutPixel(&context, x2, y2, green);
if (outline == 1)
GP_TTriangle(&context, x0, y0, x1, y1, x2, y2, yellow);
http://repo.or.cz/w/gfxprim.git/commit/31bfb14e08456f70a7823efa3832ad4e3ffb…
commit 31bfb14e08456f70a7823efa3832ad4e3ffbb9d3
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Apr 25 14:53:40 2011 +0200
Remove unused macros.
diff --git a/core/GP_WritePixel.h b/core/GP_WritePixel.h
index 292e05f..2910111 100644
--- a/core/GP_WritePixel.h
+++ b/core/GP_WritePixel.h
@@ -31,43 +31,6 @@
#include <unistd.h>
/*
- * Macros for writing a single pixel value to the specified address,
- * provided that the target buffer has 8, 16, 24, or 32 bytes per pixel.
- */
-
-#define GP_WritePixel8bpp(ptr, pixel) { - *((uint8_t *) ptr) = (uint8_t) pixel; -}
-
-#define GP_WritePixel16bpp(ptr, pixel) { - *((uint16_t *) ptr) = (uint16_t) pixel; -}
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-
-#define GP_WritePixel24bpp(ptr, pixel) { - ((uint8_t *) ptr)[0] = (pixel >> 16) & 0xff; - ((uint8_t *) ptr)[1] = (pixel >> 8) & 0xff; - ((uint8_t *) ptr)[2] = pixel & 0xff; -}
-
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
-
-#define GP_WritePixel24bpp(ptr, pixel) { - ((uint8_t *) ptr)[0] = pixel & 0xff; - ((uint8_t *) ptr)[1] = (pixel >> 8) & 0xff; - ((uint8_t *) ptr)[2] = (pixel >> 16) & 0xff; -}
-
-#else
-#error "Could not detect machine endianity"
-#endif
-
-#define GP_WritePixel32bpp(ptr, pixel) { - *((uint32_t *) ptr) = (uint32_t) pixel; -}
-
-/*
* Calls for writing a linear block of pixels.
*/
-----------------------------------------------------------------------
Summary of changes:
core/GP_Circle.c | 23 ++++++---------
core/GP_Circle.h | 8 ++--
core/GP_Context.h | 9 ------
core/GP_Ellipse.c | 23 ++++++---------
core/GP_Ellipse.h | 8 ++--
core/GP_Fill.c | 6 ++-
core/GP_Fill.h | 2 +-
core/GP_FillCircle.c | 23 ++++++---------
core/GP_FillCircle.h | 8 ++--
core/GP_FillEllipse.c | 23 ++++++---------
core/GP_FillEllipse.h | 8 ++--
core/GP_FillRect.c | 43 +++++++++++----------------
core/GP_FillRect.h | 16 +++++-----
core/GP_FillTetragon.c | 24 +++++----------
core/GP_FillTetragon.h | 9 ++---
core/GP_FillTriangle.c | 23 ++++++---------
core/GP_FillTriangle.h | 8 ++--
core/GP_FnPerBpp.h | 4 +--
core/GP_HLine.c | 48 ++++++++++++++----------------
core/GP_HLine.h | 14 ++++-----
core/GP_Line.c | 23 ++++++---------
core/GP_Line.h | 8 ++--
core/GP_PutPixel.c | 23 +++++---------
core/GP_PutPixel.h | 18 ++++++------
core/GP_Rect.c | 40 +++++++++----------------
core/GP_Rect.h | 16 +++++-----
core/GP_Symbol.c | 65 ++++++++++++++++++++++-------------------
core/GP_Symbol.h | 20 +++++-------
core/GP_Tetragon.c | 24 +++++----------
core/GP_Tetragon.h | 8 ++--
core/GP_Text.c | 27 +++++++++--------
core/GP_TextStyle.c | 6 +---
core/GP_TextStyle.h | 2 +-
core/GP_Triangle.c | 24 +++++----------
core/GP_Triangle.h | 8 ++--
core/GP_VLine.c | 46 +++++++++++++----------------
core/GP_VLine.h | 14 ++++-----
core/GP_WritePixel.h | 37 -----------------------
filters/GP_Rotate.c | 2 +
targets/sdl/tests/shapetest.c | 6 ++--
40 files changed, 305 insertions(+), 442 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.")
1
0
Hi!
While going trough the headers I found that GP_LineTrack() is not used for
anything. And I would like to get rid of it. Or should we keep it?
--
metan
2
1
Hi!
I've added 'Crazy Ideas' page to our Wiki and wrote some of my development
ideas there. Feel free (and moreover be encouraged) to read/edit/ehance it.
* http://atrey.karlin.mff.cuni.cz/~gavento/GfxPrimWiki/dev/crazy_ideas/
Also feel free to take and implement any of them ;).
--
metan
1
0
Hi!
This is so called 'testing' mail.
If you can read it, you were able to
subscribe to gfxprim mailing list,
good for you!
Okay that's all for today.
Your friendly mailing list owner/overlord
--
metan
1
0