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/93aea6a4e0d920f60743fdb89fa102595d6b0...
commit 93aea6a4e0d920f60743fdb89fa102595d6b0d76 Author: Cyril Hrubis metan@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/c5d16d66f47d38078fefc539ed8d2b478ecb5...
commit c5d16d66f47d38078fefc539ed8d2b478ecb5039 Author: Cyril Hrubis metan@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@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.