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 f1688be3cd5e34c596afc0027b9c07d2cfec4325 (commit)
via 4cc70c909eb0e232bee1263f970d3f2262e34d96 (commit)
via 49cc14c142e17b791edbcce2a3b6ad5eef503227 (commit)
via 160879734f14a7aa8f676660fdc1bee7a2b256bb (commit)
from e13f2d1266a1d8fd179ac4c1b7276dbd831b6436 (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/f1688be3cd5e34c596afc0027b9c07d2cfec…
commit f1688be3cd5e34c596afc0027b9c07d2cfec4325
Merge: 4cc70c9 e13f2d1
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Dec 28 11:46:53 2012 +0100
Merge ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/4cc70c909eb0e232bee1263f970d3f2262e3…
commit 4cc70c909eb0e232bee1263f970d3f2262e34d96
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Dec 28 11:46:01 2012 +0100
spiv: Filter out non image files in dir traversal.
diff --git a/demos/spiv/image_list.c b/demos/spiv/image_list.c
index 1376130..fd35669 100644
--- a/demos/spiv/image_list.c
+++ b/demos/spiv/image_list.c
@@ -28,6 +28,7 @@
#include <errno.h>
#include <string.h>
+#include <loaders/GP_Loader.h>
#include <core/GP_Debug.h>
#include "image_list.h"
@@ -64,8 +65,10 @@ static int dir_filter(const struct dirent *d)
if (!strcmp(d->d_name, ".."))
return 0;
- //TODO: filter out directories, non-image files?
-
+ //TODO: filter out directories
+
+ if (GP_MatchExtension(d->d_name) == NULL)
+ return 0;
GP_DEBUG(4, "Adding file '%s'", d->d_name);
http://repo.or.cz/w/gfxprim.git/commit/49cc14c142e17b791edbcce2a3b6ad5eef50…
commit 49cc14c142e17b791edbcce2a3b6ad5eef503227
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Dec 28 11:43:11 2012 +0100
loaders: Add function to match loader by filename.
diff --git a/build/syms/Loaders_symbols.txt b/build/syms/Loaders_symbols.txt
index 2de93ed..bce6650 100644
--- a/build/syms/Loaders_symbols.txt
+++ b/build/syms/Loaders_symbols.txt
@@ -53,6 +53,7 @@ GP_SaveTmpFile
GP_LoadTmpFile
GP_MatchSignature
+GP_MatchExtension
GP_LoadImage
GP_SaveImage
GP_LoadMetaData
diff --git a/doc/loaders.txt b/doc/loaders.txt
index aa16606..907a171 100644
--- a/doc/loaders.txt
+++ b/doc/loaders.txt
@@ -41,7 +41,7 @@ Image Loader
[source,c]
-------------------------------------------------------------------------------
-#include <loaders/GP_Loaders.h>
+#include <loaders/GP_Loader.h>
/* or */
#include <GP.h>
@@ -66,7 +66,7 @@ stdout.
[source,c]
-------------------------------------------------------------------------------
-#include <loaders/GP_Loaders.h>
+#include <loaders/GP_Loader.h>
/* or */
#include <GP.h>
@@ -164,7 +164,7 @@ link:example_loader_registration.html[example].
[source,c]
-------------------------------------------------------------------------------
-#include <loaders/GP_Loaders.h>
+#include <loaders/GP_Loader.h>
/* or */
#include <GP.h>
@@ -175,6 +175,19 @@ Returns pointer to image loader accordingly to image signature or 'NULL' if no
suitable loader was found. The buf pointer must point to a buffer at least 32
bytes long.
+[source,c]
+-------------------------------------------------------------------------------
+#include <loaders/GP_Loader.h>
+/* or */
+#include <GP.h>
+
+const GP_Loader *GP_MatchExtension(const char *path)
+-------------------------------------------------------------------------------
+
+Matches loader by the file extension. This function does not check that the
+file exists or that it could be opened it only looks at the extension (i.e.
+string after the dot) and matches it agains known extensions.
+
WARNING: If you attempt to modify the content of the strucutre the behavior is
undefined. Most likely the program will crash.
diff --git a/include/loaders/GP_Loader.h b/include/loaders/GP_Loader.h
index 6730613..f80cf58 100644
--- a/include/loaders/GP_Loader.h
+++ b/include/loaders/GP_Loader.h
@@ -108,6 +108,11 @@ typedef struct GP_Loader {
*/
const GP_Loader *GP_MatchSignature(const void *buf);
+/*
+ * Tries to match loader by extension. Returns NULL if no loader was found.
+ */
+const GP_Loader *GP_MatchExtension(const char *path);
+
void GP_LoaderRegister(GP_Loader *self);
void GP_LoaderUnregister(GP_Loader *self);
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c
index 1d15ec7..fdd2641 100644
--- a/libs/loaders/GP_Loader.c
+++ b/libs/loaders/GP_Loader.c
@@ -248,7 +248,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
ext_load = loader_by_filename(src_path);
- if (ext_load != NULL) {
+ if (ext_load != NULL && ext_load->Load != NULL) {
img = ext_load->Load(src_path, callback);
if (img)
@@ -259,7 +259,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
* Avoid further work if signature was correct but the loader issued
* ENOSYS.
*/
- if (errno == ENOSYS)
+ if (ext_load != NULL && errno == ENOSYS)
return NULL;
sig_load = loader_by_signature(src_path);
@@ -269,7 +269,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
src_path, ext_load->fmt_name, sig_load->fmt_name);
}
- if (sig_load)
+ if (sig_load && sig_load->Load != NULL)
return sig_load->Load(src_path, callback);
errno = ENOSYS;
@@ -445,3 +445,8 @@ const GP_Loader *GP_MatchSignature(const void *buf)
return NULL;
}
+
+const GP_Loader *GP_MatchExtension(const char *path)
+{
+ return loader_by_filename(path);
+}
http://repo.or.cz/w/gfxprim.git/commit/160879734f14a7aa8f676660fdc1bee7a2b2…
commit 160879734f14a7aa8f676660fdc1bee7a2b256bb
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Dec 27 11:45:47 2012 +0100
doc: Add more text formatting.
diff --git a/doc/api.txt b/doc/api.txt
index a03d282..7d4898a 100644
--- a/doc/api.txt
+++ b/doc/api.txt
@@ -70,6 +70,8 @@ GFXprim API
Video grabbers interface such as V4L2.
+
+TIP: There is also a nice page with code link:examples.html[examples].
+
GFXprim Internals
-----------------
@@ -78,5 +80,3 @@ GFXprim Internals
Describes structure and basic usage of the templating engine (C code
generator).
+
-
-There is also a nice page with code link:examples.html[examples].
diff --git a/doc/backends.txt b/doc/backends.txt
index 5ee7e78..a4fb226 100644
--- a/doc/backends.txt
+++ b/doc/backends.txt
@@ -9,7 +9,7 @@ controlling the drawing.
So far there are backends for Linux mmaped frame-buffer, libSDL and X11.
-For example usage see backend link:example_backend.html[example].
+TIP: For example usage see backend link:example_backend.html[example].
Initialization functions
------------------------
diff --git a/doc/core.txt b/doc/core.txt
index 3e20ee2..a59938d 100644
--- a/doc/core.txt
+++ b/doc/core.txt
@@ -86,7 +86,7 @@ bitmap loaders 'errno' is set to 'ECANCELED'.
The callback, if supported, is the last parameter of a function.
-For example usage see progress callback
+TIP: For example usage see progress callback
link:example_loaders_progress_callback.html[example].
Temporary Buffer Allocator
diff --git a/doc/grabbers.txt b/doc/grabbers.txt
index a794847..ce71654 100644
--- a/doc/grabbers.txt
+++ b/doc/grabbers.txt
@@ -8,7 +8,7 @@ There is currently V4L2 driver that implements a grabber.
To link against grabbers use +-lGP_grabbers+ or better
+`gfxprim-config --libs-grabbers`+ in your linker flags.
-For example usage see grabber link:example_v4l2.html[examples].
+TIP: For example usage see grabber link:example_v4l2.html[examples].
Grabber API
~~~~~~~~~~~
diff --git a/doc/input.txt b/doc/input.txt
index 35ff473..f48f24d 100644
--- a/doc/input.txt
+++ b/doc/input.txt
@@ -15,7 +15,7 @@ difference is that events that belongs together are delivered together (the
kernel input API sends one event for each value i.e. x or y coordinate and has
sync event that finalizes the changes in the values).
-For example usage see input events link:example_input.html[example].
+TIP: For example usage see input events link:example_input.html[example].
Event Structure Description
~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/loaders.txt b/doc/loaders.txt
index e12c6f8..aa16606 100644
--- a/doc/loaders.txt
+++ b/doc/loaders.txt
@@ -159,7 +159,7 @@ unregister your own loaders by 'GP_LoaderRegister()' and
'GP_LoaderUnregister()'. Once image loader is registered the generic loading
functions could use it to load and save images.
-For example usage see image loader registration
+TIP: For example usage see image loader registration
link:example_loader_registration.html[example].
[source,c]
-----------------------------------------------------------------------
Summary of changes:
build/syms/Loaders_symbols.txt | 1 +
demos/spiv/image_list.c | 7 +++++--
doc/api.txt | 4 ++--
doc/backends.txt | 2 +-
doc/core.txt | 2 +-
doc/grabbers.txt | 2 +-
doc/input.txt | 2 +-
doc/loaders.txt | 21 +++++++++++++++++----
include/loaders/GP_Loader.h | 5 +++++
libs/loaders/GP_Loader.c | 11 ++++++++---
10 files changed, 42 insertions(+), 15 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 df87777210da0ea03b70f5d8cf138050a5399e05 (commit)
from 57673b3b830b3d6434956c656d0cec95156314cc (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/df87777210da0ea03b70f5d8cf138050a539…
commit df87777210da0ea03b70f5d8cf138050a5399e05
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Dec 27 01:38:23 2012 +0100
demos: c_simple: Update backend example.
diff --git a/demos/c_simple/backend_example.c b/demos/c_simple/backend_example.c
index 063da75..3d565ef 100644
--- a/demos/c_simple/backend_example.c
+++ b/demos/c_simple/backend_example.c
@@ -71,10 +71,8 @@ int main(int argc, char *argv[])
GP_BackendFlip(backend);
for (;;) {
- if (backend->Poll)
- GP_BackendPoll(backend);
-
- usleep(1000);
+ /* Wait for backend event */
+ GP_BackendWait(backend);
/* Read and parse events */
GP_Event ev;
@@ -85,13 +83,20 @@ int main(int argc, char *argv[])
switch (ev.type) {
case GP_EV_KEY:
- switch (ev.val.key.key) {
+ switch (ev.val.val) {
case GP_KEY_ESC:
case GP_KEY_Q:
GP_BackendExit(backend);
return 0;
break;
}
+ break;
+ case GP_EV_SYS:
+ case GP_EV_SYS_QUIT:
+ GP_BackendExit(backend);
+ return 0;
+ break;
+ break;
}
}
}
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/backend_example.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 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 65cea9aefed176553293e6d5b18ad5eb24b9b704 (commit)
via 9405c62813a1cc0ce1584a512ca07384899244b2 (commit)
via e9931e042beccee51ddb1855ba2cecc22dc8d0ea (commit)
from 36422459f0fc8293fb52d4818dc94c8342615a1c (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/65cea9aefed176553293e6d5b18ad5eb24b9…
commit 65cea9aefed176553293e6d5b18ad5eb24b9b704
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 16:02:33 2012 +0100
build: pywrap: Fix the dependencies.
Make can't create rule that produces two
or more files so we use small trick with
with dummy rule to fix this.
diff --git a/pywrap.mk b/pywrap.mk
index d8b18f6..2b527b8 100644
--- a/pywrap.mk
+++ b/pywrap.mk
@@ -13,7 +13,11 @@ INCLUDES+=$(addprefix -I$(TOPDIR)/include/, $(INCLUDE))
ALL+=$(SWIG_LIB) $(SWIG_PY)
-$(SWIG_C) $(SWIG_PY): $(SWIG_SRC)
+# Empty rule to satisfy SWIG_PY
+$(SWIG_PY): $(SWIG_C)
+ @
+
+$(SWIG_C): $(SWIG_SRC)
ifdef VERBOSE
$(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
else # VERBOSE
http://repo.or.cz/w/gfxprim.git/commit/9405c62813a1cc0ce1584a512ca073848992…
commit 9405c62813a1cc0ce1584a512ca07384899244b2
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 15:55:35 2012 +0100
build: Fix dependencies for library build.
Now the library is rebuild only once after
the sources has been changed.
diff --git a/build/Makefile b/build/Makefile
index 7ac79b2..59afb71 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,7 +1,10 @@
LIB_OBJECTS=$(shell ./get_objs.sh)
all: libGP.a libGP.so libGP.so.0
-.PHONY: libGP.a libGP.so libGP.so.0
+
+libGP.a: $(LIB_OBJECTS)
+libGP.so: $(LIB_OBJECTS)
+libGP.so.0: $(LIB_OBJECTS)
rebuild: all
http://repo.or.cz/w/gfxprim.git/commit/e9931e042beccee51ddb1855ba2cecc22dc8…
commit e9931e042beccee51ddb1855ba2cecc22dc8d0ea
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 15:52:20 2012 +0100
Remove long obsolete TODO file.
diff --git a/TODO b/TODO
deleted file mode 100644
index 04e7bdc..0000000
--- a/TODO
+++ /dev/null
@@ -1,15 +0,0 @@
-What's not implemented (and should be)
---------------------------------------
-
-* Meditate about bit endians and why these aren't separate pixel types
- (which would make our lives a bit easier)
-
-Advanced features
------------------
-
-* bitmaps
- - alpha channel
-
-* gfx primitives
- - drawing with alpha channel
- - anti aliasing
-----------------------------------------------------------------------
Summary of changes:
TODO | 15 ---------------
build/Makefile | 5 ++++-
pywrap.mk | 6 +++++-
3 files changed, 9 insertions(+), 17 deletions(-)
delete mode 100644 TODO
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 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1 (commit)
via 55afb5fd376150afe14f6388749547e07fc02c42 (commit)
from 08e5a448761d5d3b25abcf1d42967458e8cdfa62 (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/8bfdadb7f739f7eb614d3c4f427a3d075a06…
commit 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1
Merge: 55afb5f 08e5a44
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Tue Dec 25 03:28:02 2012 +0100
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/55afb5fd376150afe14f6388749547e07fc0…
commit 55afb5fd376150afe14f6388749547e07fc02c42
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Tue Dec 25 03:26:45 2012 +0100
loaders: pylib: cleanup and Context submodule
diff --git a/pylib/gfxprim/loaders/__init__.py b/pylib/gfxprim/loaders/__init__.py
index 5dd476e..621099a 100644
--- a/pylib/gfxprim/loaders/__init__.py
+++ b/pylib/gfxprim/loaders/__init__.py
@@ -1,11 +1,31 @@
-from . import loaders_c
+from . import c_loaders
+
+
+def Load(filename, callback=None):
+ "Load image from given file, guessing the type."
+ c = c_loaders.GP_LoadImage(filename, callback)
+ return c
+
def _init(module):
+ "Extend Context with loaders submodule"
+
+ from ..utils import extend, add_swig_getmethod, add_swig_setmethod
+ from ..core import Context as _context
+
+ class LoadersSubmodule(object):
+ def __init__(self, ctx):
+ self.ctx = ctx
+
+ _context._submodules['loaders'] = LoadersSubmodule
+
+ @extend(LoadersSubmodule)
+ def Save(self, filename, callback=None):
+ """Save the image, guessing the type from the extension.
- # Extend Context with convenience methods
- from ._extend_context import extend_context
- from ..core import Context
- extend_context(Context)
+ Generally, not all pixel types work with all formats.
+ """
+ c_loaders.GP_SaveImage(self.ctx, filename, callback)
# Imports from the SWIG module
import re
@@ -14,11 +34,13 @@ def _init(module):
# Import functions from the SWIG module
from ..utils import import_members
- import_members(loaders_c, module, sub=strip_GP,
- exclude=[
- '^w+_swigregister$',
- '^gfxprim$',
- '^_w+$'])
+ import_members(c_loaders, module, sub=strip_GP,
+ include=[
+ '^GP_Load[A-Z]{3}.*',
+ '^GP_Save[A-Z]{3}.*',
+ '^GP_ListLoaders$',
+ '^GP_LoadMetaData$',
+ ])
_init(locals())
del _init
diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i
index 7c9d903..f72a3e8 100644
--- a/pylib/gfxprim/loaders/loaders.i
+++ b/pylib/gfxprim/loaders/loaders.i
@@ -1,5 +1,5 @@
%include "../common.i"
-%module(package="gfxprim.loaders") loaders_c
+%module(package="gfxprim.loaders") c_loaders
%{
#include "core/GP_Core.h"
@@ -14,7 +14,7 @@ ERROR_ON_NONZERO(GP_SaveImage);
%newobject GP_LoadImage;
-%include "GP_Loaders.h"
+%include "GP_Loader.h"
ERROR_ON_NONZERO(GP_OpenJPG);
ERROR_ON_NULL(GP_ReadJPG);
-----------------------------------------------------------------------
Summary of changes:
pylib/gfxprim/loaders/__init__.py | 42 ++++++++++++++++++++++++++++--------
pylib/gfxprim/loaders/loaders.i | 4 +-
2 files changed, 34 insertions(+), 12 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.")