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 85eda14c378b6a2acce26d19fa7073ac509ee386 (commit)
from 14374d9981a9e1c76d6f83287ca3d71612c8d659 (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/85eda14c378b6a2acce26d19fa7073ac509e…
commit 85eda14c378b6a2acce26d19fa7073ac509ee386
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Mar 29 11:59:58 2013 +0100
backeds: Make use of GP_FATAL().
Use GP_FATAL() when backend in not compiled in.
diff --git a/libs/backends/GP_SDL.c b/libs/backends/GP_SDL.c
index c54bc19..2312564 100644
--- a/libs/backends/GP_SDL.c
+++ b/libs/backends/GP_SDL.c
@@ -251,7 +251,7 @@ GP_Backend *GP_BackendSDLInit(GP_Size w __attribute__((unused)),
uint8_t flags __attribute__((unused)),
const char *caption __attribute__((unused)))
{
- GP_WARN("SDL support not compiled in.");
+ GP_FATAL("SDL support not compiled in.");
return NULL;
}
diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c
index 59b28ae..c81f0dd 100644
--- a/libs/backends/GP_X11.c
+++ b/libs/backends/GP_X11.c
@@ -609,7 +609,7 @@ GP_Backend *GP_BackendX11Init(const char *GP_UNUSED(display),
unsigned int GP_UNUSED(h),
const char *GP_UNUSED(caption))
{
- GP_WARN("FATAL: X11 support not compiled in");
+ GP_FATAL("X11 support not compiled in");
return NULL;
}
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_SDL.c | 2 +-
libs/backends/GP_X11.c | 2 +-
2 files changed, 2 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 14374d9981a9e1c76d6f83287ca3d71612c8d659 (commit)
via 58de8652bc7329e9307ddca14ea8e28775d328ec (commit)
from 1c86bf51648b295323c49f14f63c14fee0f33dcf (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/14374d9981a9e1c76d6f83287ca3d71612c8…
commit 14374d9981a9e1c76d6f83287ca3d71612c8d659
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Mar 23 20:21:56 2013 +0100
doc: Update X11 backend docs.
diff --git a/doc/backends.txt b/doc/backends.txt
index 8cfb010..2d1398a 100644
--- a/doc/backends.txt
+++ b/doc/backends.txt
@@ -118,7 +118,12 @@ time).
This backend feeds key events into global input queue.
-TODO: X11 backend will be changed to support more windows at a time.
+This backends supports multiple windows. Each time you call the initialization
+rutine new backend structure is returned. All backend instances share the xlib
+connection so you need to wait or poll only on one of them. Each backend, on
+the other hand, has its own input queue.
+
+TIP: See mutliple windows link:example_x11_windows.html[example].
[source,c]
-------------------------------------------------------------------------------
diff --git a/doc/example_x11_windows.txt b/doc/example_x11_windows.txt
new file mode 100644
index 0000000..4e4bb31
--- /dev/null
+++ b/doc/example_x11_windows.txt
@@ -0,0 +1,8 @@
+Graphics Backend Example
+------------------------
+.An example how to create and manage two windows using the X11 backend
+
+[source,c]
+------------------------------------------------------------------
+include::../demos/c_simple/x11_windows.c[]
+------------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/58de8652bc7329e9307ddca14ea8e28775d3…
commit 58de8652bc7329e9307ddca14ea8e28775d328ec
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Mar 23 20:06:37 2013 +0100
doc: pywrap: Starts python loaders docs.
diff --git a/doc/Makefile b/doc/Makefile
index 4537bf9..840ea66 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,7 +5,7 @@ SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt get_put_pixel.txt blits.txt progress_callback.txt text_api.txt event_queue.txt
-SOURCES+=core_python.txt gfx_python.txt
+SOURCES+=core_python.txt gfx_python.txt loaders_python.txt
EXAMPLE_SOURCES=$(wildcard example_*.txt)
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
index 8ce8d85..af20f91 100644
--- a/doc/asciidoc.conf
+++ b/doc/asciidoc.conf
@@ -60,6 +60,7 @@ endif::disable-javascript[]
<ul>
<li><a href="core_python.html">Core</a></li>
<li><a href="gfx_python.html">Gfx</a></li>
+ <li><a href="loaders_python.html">Loaders</a></li>
</ul>
</div>
diff --git a/doc/loaders_python.txt b/doc/loaders_python.txt
new file mode 100644
index 0000000..4ac158b
--- /dev/null
+++ b/doc/loaders_python.txt
@@ -0,0 +1,28 @@
+Python Loaders module
+---------------------
+
+The python binding maps mostly to the C API with the 'GP_' prefix stripped.
+
+Loaders adds support for loading and storing contexts into/from various image
+fomats.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.loaders as loaders
+
+ img = loaders.Load(path, callback=None)
+
+-------------------------------------------------------------------------------
+
+Loads an image from a file.
+
+May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT' or any other
+'errno' set by 'open(2)', 'read(2)', 'seek(2)'.
+
+May raise 'OSError' with errno set to 'ENOSYS' on unsupported or not recognized
+format.
+
+May raise 'OSError' with errno set to 'EIO' when file is damaged.
+
+May raise 'OSError' with errno set to 'ECANCELED' when action was interrupted
+by callback.
-----------------------------------------------------------------------
Summary of changes:
doc/Makefile | 2 +-
doc/asciidoc.conf | 1 +
doc/backends.txt | 7 ++++-
...ogress_callback.txt => example_x11_windows.txt} | 3 +-
doc/loaders_python.txt | 28 ++++++++++++++++++++
5 files changed, 38 insertions(+), 3 deletions(-)
copy doc/{example_loaders_progress_callback.txt => example_x11_windows.txt} (63%)
create mode 100644 doc/loaders_python.txt
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 1c86bf51648b295323c49f14f63c14fee0f33dcf (commit)
from eef84fa42d26341f4dd66b35672957fa35e23b8e (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/1c86bf51648b295323c49f14f63c14fee0f3…
commit 1c86bf51648b295323c49f14f63c14fee0f33dcf
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Mar 23 19:49:13 2013 +0100
doc: pywrap: Finish gfx docs.
diff --git a/doc/gfx_python.txt b/doc/gfx_python.txt
index 3644358..941b1f8 100644
--- a/doc/gfx_python.txt
+++ b/doc/gfx_python.txt
@@ -21,15 +21,8 @@ WARNING: Drawing functions takes strictly integer coordinates, make sure that
all divisions are integer divisions (i.e. use // instead of /) to
ensure portability with Python 3.X.
-[source,python]
--------------------------------------------------------------------------------
-import gfxprim.gfx as gfx
-
- context.gfx.Fill(pixel)
-
--------------------------------------------------------------------------------
-
-Fills context with particualr 'pixel' value.
+Line Based Primitives
+^^^^^^^^^^^^^^^^^^^^^
[source,python]
-------------------------------------------------------------------------------
@@ -105,5 +98,120 @@ import gfxprim.gfx as gfx
Draws a polygon defined by points, points can be either flat list of 2N
integers or list of N tuples.
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.Circle(x, y, r, pixel)
+
+-------------------------------------------------------------------------------
+
+Draws a circle.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.Ellipse(x, y, a, b, pixel)
+
+-------------------------------------------------------------------------------
+
+Draws an ellipse.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.Ring(x, y, r1, r2, pixel)
+
+-------------------------------------------------------------------------------
+
+Draws a ring.
+
+Filled Primitives
+^^^^^^^^^^^^^^^^^
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.Fill(pixel)
+
+-------------------------------------------------------------------------------
+
+Fills context with particular 'pixel' value.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillRect(x0, y0, x1, y1, pixel)
+
+-------------------------------------------------------------------------------
+
+Fills a rectangle defined by two points.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillTriangle(x0, y0, x1, y1, x1, y2, pixel)
+
+-------------------------------------------------------------------------------
+
+Draws a filled triangle defined by three points.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillTetragon(x0, y0, x1, y1, x1, y2, x3, y3, pixel)
+
+-------------------------------------------------------------------------------
+
+Draws a filled tetragon defined by four points.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillPolygon([x0, y0, x1, y1, ...], pixel)
+
+ context.gfx.FillPolygon([(x0, y0), (x1, y1), ...], pixel)
+
+-------------------------------------------------------------------------------
+
+Fills a polygon defined by points, points can be either flat list of 2N
+integers or list of N tuples.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillCircle(x, y, r, pixel)
+
+-------------------------------------------------------------------------------
+
+Fills a circle.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillEllipse(x, y, a, b, pixel)
+
+-------------------------------------------------------------------------------
+
+Fills an ellipse.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.FillRing(x, y, r1, r2, pixel)
+
+-------------------------------------------------------------------------------
+
+Fills a ring, i.e. area enclosed between two circles.
TIP: See gfx module link:example_py_gfx.html[example].
-----------------------------------------------------------------------
Summary of changes:
doc/gfx_python.txt | 126 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 117 insertions(+), 9 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 93aea6a4e0d920f60743fdb89fa102595d6b0d76 (commit)
via c5d16d66f47d38078fefc539ed8d2b478ecb5039 (commit)
from 0489beeb9e8eb9c66e5700a6d998003440219087 (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/93aea6a4e0d920f60743fdb89fa102595d6b…
commit 93aea6a4e0d920f60743fdb89fa102595d6b0d76
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Mar 23 13:47:28 2013 +0100
doc: pywrap: Start gfx documentation.
diff --git a/doc/Makefile b/doc/Makefile
index cb892bf..4537bf9 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,7 +5,7 @@ SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt get_put_pixel.txt blits.txt progress_callback.txt text_api.txt event_queue.txt
-SOURCES+=core_python.txt
+SOURCES+=core_python.txt gfx_python.txt
EXAMPLE_SOURCES=$(wildcard example_*.txt)
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
index 72418b7..8ce8d85 100644
--- a/doc/asciidoc.conf
+++ b/doc/asciidoc.conf
@@ -59,6 +59,7 @@ endif::disable-javascript[]
<h4>Python bindings</h4>
<ul>
<li><a href="core_python.html">Core</a></li>
+ <li><a href="gfx_python.html">Gfx</a></li>
</ul>
</div>
diff --git a/doc/core_python.txt b/doc/core_python.txt
index fe295cb..3e7256f 100644
--- a/doc/core_python.txt
+++ b/doc/core_python.txt
@@ -95,6 +95,7 @@ Blit is clipped.
TIP: See link:example_py_showimage.html[example] Blit usage.
+[[Colors_and_Pixels]]
Colors and Pixels
~~~~~~~~~~~~~~~~~
diff --git a/doc/gfx_python.txt b/doc/gfx_python.txt
new file mode 100644
index 0000000..28f8899
--- /dev/null
+++ b/doc/gfx_python.txt
@@ -0,0 +1,48 @@
+Python GFX module
+-----------------
+
+The python binding maps mostly to the C API with the 'GP_' prefix stripped.
+
+The gfx module adds methods to the gfx context submodule.
+
+NOTE: You may want to see the link:coordinate_system.html[coordinate system]
+ first.
+
+Drawing functions
+~~~~~~~~~~~~~~~~~
+
+All drawing functions takes a 'pixel' value (to describe color) which
+link:core_python.html#Colors_and_Pixels[can be obtained], for a particular
+pixel type (context), from a RGB triplet.
+
+All drawing functions are clipped. Drawing outside of a context is no-op.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.Fill(pixel)
+
+-------------------------------------------------------------------------------
+
+Fills context with particualr 'pixel' value.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.HLine(x0, x1, y, pixel)
+-------------------------------------------------------------------------------
+
+Draws a horizontal line from 'x0' to 'x1' at 'y'.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.gfx as gfx
+
+ context.gfx.VLine(x, y0, y1, pixel)
+-------------------------------------------------------------------------------
+
+Draws a vertical line from 'y0' to 'y1' at 'x'.
+
+
http://repo.or.cz/w/gfxprim.git/commit/c5d16d66f47d38078fefc539ed8d2b478ecb…
commit c5d16d66f47d38078fefc539ed8d2b478ecb5039
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Mar 23 12:30:37 2013 +0100
doc: pywrap: More python docs.
diff --git a/doc/core_python.txt b/doc/core_python.txt
index 57a51e6..fe295cb 100644
--- a/doc/core_python.txt
+++ b/doc/core_python.txt
@@ -53,9 +53,6 @@ import gfxprim.core as core
Puts a pixel at specified coordinates. If coordinates are outside of the
image nothing is done.
-These are basic 'Context' methods from core module. Importing other modules
-will add some other (for example gfx module adds all drawing functions).
-
NOTE: You may want to see link:coordinate_system.html[coordinate system]
description.
@@ -77,14 +74,26 @@ The conversion is naive i.e. the values are just divided/multiplied.
-------------------------------------------------------------------------------
import gfxprim.core as core
-Blit(self, sx, sy, target, tx, ty, w=None, h=None, sx2=None, sy2=None,
- tx2=None, ty2=None)
+ # Blits context to target starting at
+ # sx and sy in the source context
+ # tx and ty in in the target
+ context.Blit(sx, sy, target, tx, ty, w, h)
+
+ # Alternatively the size can be described by
+ # coordinates in the source or target
+ context.Blit(sx, sy, target, tx, ty, sx2=, sy2=)
+ context.Blit(sx, sy, target, tx, ty, tx2=, ty2=)
-------------------------------------------------------------------------------
-Copy a rectangle from self to target. (sx,sy) and (tx,ty) define upper-left
-corners, rectangle size is given by (width, height), lower-right corner in
-source or lower-right corner in the target. Blit is clipped.
+Copy a rectangle from self to target.
+
+The blits can do simple conversions same as the 'Convert' functions however
+such blits are slower.
+
+Blit is clipped.
+
+TIP: See link:example_py_showimage.html[example] Blit usage.
Colors and Pixels
~~~~~~~~~~~~~~~~~
@@ -94,7 +103,7 @@ passed as a parameter to all drawing functions.
Color is a more abstract representation for example RGB triplet.
-There are several functions to create a pixel value for a particualr pixel
+There are several functions to create a pixel value for a particular pixel
type from color.
[source,python]
@@ -141,3 +150,7 @@ Sets and gets the GFXprim debug level. See link:debug.html[debug messages]
description for more details.
+
+
+These are basic 'Context' methods from core module. Importing other modules
+will add some other (for example gfx module adds all drawing functions).
diff --git a/doc/example_py_showimage.txt b/doc/example_py_showimage.txt
new file mode 100644
index 0000000..10e6e51
--- /dev/null
+++ b/doc/example_py_showimage.txt
@@ -0,0 +1,8 @@
+Showimage
+---------
+.A simple program to load and show image
+
+[source,python]
+------------------------------------------------------------------
+include::../demos/py_simple/showimage.py[]
+------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
doc/Makefile | 2 +-
doc/asciidoc.conf | 1 +
doc/core_python.txt | 32 +++++++++----
...{example_input.txt => example_py_showimage.txt} | 9 ++--
doc/gfx_python.txt | 48 ++++++++++++++++++++
5 files changed, 78 insertions(+), 14 deletions(-)
copy doc/{example_input.txt => example_py_showimage.txt} (52%)
create mode 100644 doc/gfx_python.txt
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.")