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, generate has been updated
via 4061392c7024e648dc2bcfde720ce11e0f70dedb (commit)
via f7f55767a6e8855d5e70a7220a5c9c1511251de5 (commit)
from a47b50d43100a1e3314a818f5bcdf37bf560d8d0 (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/4061392c7024e648dc2bcfde720ce11e0f70…
commit 4061392c7024e648dc2bcfde720ce11e0f70dedb
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Oct 31 13:42:26 2011 +0100
Update filters docs, more to come.
diff --git a/doc/filters.txt b/doc/filters.txt
index d741abb..0f54e7a 100644
--- a/doc/filters.txt
+++ b/doc/filters.txt
@@ -1,44 +1,202 @@
Context filters
---------------
-Pixel filters for 'GP_Context'. The context filter is basially an function that modifies context somehow (may even allocate new context to store result).
+Pixel filters for 'GP_Context'.
-Rotation
-~~~~~~~~
+The context filter is basially an function that operates on context pixels.
+The result may be stored into a new bitmap or placed to bitmap passed as
+argument or, in some cases, the filter could be used 'in place' so the result
+is stored into the same context as the one passed as filter source.
+
+Progress Callback
+~~~~~~~~~~~~~~~~~
+
+Progress callback is a structure that stores user-defined callback function,
+pointer to store location of user data and percentage.
+
+[source,c]
+-------------------------------------------------------------------------------
+typdedef struct GP_ProgressCallback {
+ float percentage;
+ void (*callback)(struct GP_ProgressCallback *self);
+ void *priv;
+} GP_ProgressCallback;
+-------------------------------------------------------------------------------
+
+If non 'NULL' progress callback structure is passed to a filter function, the
+callback function is periodically called and the percentage is updated.
+
+The callback is, if supported, the last parameter of the filter function.
+
+Common filter API
+~~~~~~~~~~~~~~~~~
+
+The filters have, for your convinience unified API.
+
+* Each filter returns pointer to destination context or 'NULL' on failure
+* The first two arguments are source and destination
+* The last argument is progress callback
+
+Each filter function could be used in two modes.
+
+By passing non 'NULL' argument as filter destination user requests result to
+be stored into the destination context. The context must have correct pixel
+type and the context size must be big enough to store the result.
+
+For filters that works 'in-place' (which is explicitly said for each filter)
+the source and the destination could be the same context. Note that this is
+not expected to work if you do several overlaping subcontextes and pass these
+as arguments.
+
+When 'NULL' is passed as destination new context for storing the result is
+allocated and returned.
+
+The return value is either pointer to destination context or 'NULL' either
+when malloc(2) has failed or if the filter is not implemented for such
+pixel_type, parameters, etc...
+
+[source,c]
+-------------------------------------------------------------------------------
+/*
+ * Filter common api.
+ */
+GP_Context *GP_FilterFoo(const GP_Context *src, GP_Context *dst,
+ foo params ...,
+ GP_ProgressCallback *callback);
+-------------------------------------------------------------------------------
+
+
+Filters also exists in _Raw variant (that just takes source context,
+destination context, filters parameters and progress callback). These filter
+APIs are used for internal implementation and shouldn't be called by user as
+the destination is expected to be crafted exactly for storing the filter
+result and there are 'NO' sanity checks in place.
+
+'You could use these at your own risk'
+
+[source,c]
+-------------------------------------------------------------------------------
+/*
+ * Raw filter common api.
+ */
+void GP_FilterFoo_Raw(const GP_Context *src, GP_Context *dst,
+ foo params ...,
+ GP_ProgressCallback *callback);
+-------------------------------------------------------------------------------
+
+Rotation and Symmetries
+~~~~~~~~~~~~~~~~~~~~~~~
+
+[source,c]
+-------------------------------------------------------------------------------
+#include <GP_Filters.h>
+
+GP_Context *GP_FilterMirrorH(const GP_Context *src, GP_Context *dst,
+ GP_ProgressCallback *callback);
+-------------------------------------------------------------------------------
+
+Mirrors context horizontally.
+
+Works 'in-place'.
+
+The destination has to have the same pixel type and the destination size must
+be at least as big as source.
[source,c]
-------------------------------------------------------------------------------
#include <GP_Filters.h>
-GP_RetCode GP_MirrorH(GP_Context *context);
+GP_Context *GP_FilterMirrorV(const GP_Context *src, GP_Context *dst,
+ GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Mirrors context pixels horizontaly and updates the context metadata.
+Mirrors context vertically.
+
+Works 'in-place'.
+
+the destination has to have the same pixel type and the destination size must
+be at least as big as source.
[source,c]
-------------------------------------------------------------------------------
#include <GP_Filters.h>
-GP_RetCode GP_MirrorV(GP_Context *context);
+GP_Context *GP_FilterRotate90(const GP_Context *src, GP_Context *dst,
+ GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Mirrors context pixels verticaly and updates the context metadata.
+Rotate context by 90 degrees.
+
+Doesn't work 'in-place' (yet).
+
+The destinatoin has to have the same pixel type and destination size must be
+big enough to fit rotated context (eg. W and H are swapped).
[source,c]
-------------------------------------------------------------------------------
#include <GP_Filters.h>
-GP_RetCode GP_RotateCW(GP_Context *context);
+GP_Context *GP_FilterRotate180(const GP_Context *src, GP_Context *dst,
+ GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Rotates context clock wise and updates the context metadata.
+Rotate context by 180 degrees.
+
+Doesn't work 'in-place' (yet).
+
+the destination has to have the same pixel type and the destination size must
+be at least as big as source.
[source,c]
-------------------------------------------------------------------------------
#include <GP_Filters.h>
-GP_RetCode GP_RotateCCW(GP_Context *context);
+GP_Context *GP_FilterRotate270(const GP_Context *src, GP_Context *dst,
+ GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Rotates context counter clock wise and updates the context metadata.
+Rotate context by 270 degrees.
+
+Doesn't work 'in-place' (yet).
+
+The destinatoin has to have the same pixel type and destination size must be
+big enough to fit rotated context (eg. W and H are swapped).
+
+[source,c]
+-------------------------------------------------------------------------------
+typedef enum GP_FilterSymmetries {
+ GP_ROTATE_90,
+ GP_ROTATE_CW = GP_ROTATE_90,
+ GP_ROTATE_180,
+ GP_ROTATE_270,
+ GP_ROTATE_CCW = GP_ROTATE_270,
+ GP_MIRROR_H,
+ GP_MIRROR_V,
+} GP_FilterSymmetries;
+
+GP_Context *GP_FilterSymmetry(const GP_Context *src, GP_Context *dst,
+ GP_FilterSymmetries symmetry,
+ GP_ProgressCallback *callback);
+-------------------------------------------------------------------------------
+
+Catch all function for symmetry filters.
+
+
+Linear filters
+~~~~~~~~~~~~~~
+
+[source,c]
+-------------------------------------------------------------------------------
+#include <GP_Filters.h>
+
+GP_Context *GP_FilterGaussianBlur(const GP_Context *src, GP_Context *dst,
+ float sigma_x, float sigma_y,
+ GP_ProgressCallback *callback);
+-------------------------------------------------------------------------------
+
+Gaussian blur filter.
+
+Works 'in-place'.
+
+'TODO:' this filter is implemented for RGB888 only.
http://repo.or.cz/w/gfxprim.git/commit/f7f55767a6e8855d5e70a7220a5c9c151125…
commit f7f55767a6e8855d5e70a7220a5c9c1511251de5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Oct 31 13:41:20 2011 +0100
Remove unused accessor.
diff --git a/include/core/GP_Context.h b/include/core/GP_Context.h
index 00138df..80794d9 100644
--- a/include/core/GP_Context.h
+++ b/include/core/GP_Context.h
@@ -23,8 +23,8 @@
* *
*****************************************************************************/
-#ifndef GP_CONTEXT_H
-#define GP_CONTEXT_H
+#ifndef CORE_GP_CONTEXT_H
+#define CORE_GP_CONTEXT_H
#include <stdint.h>
#include <unistd.h>
@@ -59,12 +59,6 @@ typedef struct GP_Context {
uint8_t free_pixels:1; /* If set pixels are freed on GP_ContextFree */
} GP_Context;
-/* Returns the pixel type used by the context. */
-static inline GP_PixelType GP_GetContextPixelType(const GP_Context *context)
-{
- return context->pixel_type;
-}
-
/* Determines the address of a pixel within the context's image.
* Rows and columns are specified in the image's orientation
* (i.e. they might not be XY if the image is rotated).
@@ -157,4 +151,4 @@ static inline uint32_t GP_ContextH(const GP_Context *context)
return context->h;
}
-#endif /* GP_CONTEXT_H */
+#endif /* CORE_GP_CONTEXT_H */
-----------------------------------------------------------------------
Summary of changes:
doc/filters.txt | 180 ++++++++++++++++++++++++++++++++++++++++++---
include/core/GP_Context.h | 12 +--
2 files changed, 172 insertions(+), 20 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, generate has been updated
via 71f1574977b03a901b7381fb3aca1c6d0c3ed33d (commit)
from b964f56ae4fe0a0a48f16fc18a8daec953acb3cc (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/71f1574977b03a901b7381fb3aca1c6d0c3e…
commit 71f1574977b03a901b7381fb3aca1c6d0c3ed33d
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Oct 30 17:48:04 2011 +0100
Proved myself wrong, we need to read last two bytes.
Still haven't tried the code, just proved, while
riding the train, that sometimes we need to get
last two bytes.
diff --git a/include/core/GP_GetSetBits.h b/include/core/GP_GetSetBits.h
index bd55fe2..d724828 100644
--- a/include/core/GP_GetSetBits.h
+++ b/include/core/GP_GetSetBits.h
@@ -27,8 +27,8 @@
*/
-#ifndef GP_GET_SET_BITS_H
-#define GP_GET_SET_BITS_H
+#ifndef CORE_GP_GET_SET_BITS_H
+#define CORE_GP_GET_SET_BITS_H
/*
* Helper macros to read/write parts of words
@@ -122,6 +122,7 @@
#define GP_SET_BITS3_ALIGNED(offset, len, dest, val) do { uint32_t v; v = ((uint8_t *)dest)[0]; + v |= ((uint8_t *)dest)[1]<<8; v |= ((uint8_t *)dest)[2]<<16; GP_SET_BITS(offset, len, v, val); @@ -134,6 +135,7 @@
#define GP_SET_BITS4_ALIGNED(offset, len, dest, val) do { uint32_t v; v = ((uint8_t *)dest)[0]; + v |= ((uint8_t *)dest)[2]<<16; v |= ((uint8_t *)dest)[3]<<24; GP_SET_BITS(offset, len, v, val); @@ -145,4 +147,4 @@
} while (0)
-#endif /* GP_GET_SET_BITS_H */
+#endif /* CORE_GP_GET_SET_BITS_H */
-----------------------------------------------------------------------
Summary of changes:
include/core/GP_GetSetBits.h | 8 +++++---
1 files changed, 5 insertions(+), 3 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, generate has been updated
via 7d1c1b2c4aeef95941109cbdc5707eff6ad0a36f (commit)
from c8554f3ed96486d4ef20838b260c369f61c61b3c (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/7d1c1b2c4aeef95941109cbdc5707eff6ad0…
commit 7d1c1b2c4aeef95941109cbdc5707eff6ad0a36f
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Oct 25 16:08:45 2011 +0000
fbshow: fix timeval reinitalization.
diff --git a/demos/fbshow/fbshow.c b/demos/fbshow/fbshow.c
index e6c6212..76dcb99 100644
--- a/demos/fbshow/fbshow.c
+++ b/demos/fbshow/fbshow.c
@@ -143,13 +143,16 @@ int main(int argc, char *argv[])
FD_ZERO(&rfds);
FD_SET(drv->fd, &rfds);
struct timeval tv = {.tv_sec = sleep_sec, .tv_usec = 0};
+ struct timeval *tvp = sleep_sec ? &tv : NULL;
for (;;) {
int ret;
if (drv != NULL) {
- ret = select(drv->fd + 1, &rfds, NULL, NULL, &tv);
-
+ ret = select(drv->fd + 1, &rfds, NULL, NULL, tvp);
+
+ tv.tv_sec = sleep_sec;
+
switch (ret) {
case -1:
GP_FramebufferExit(fb);
-----------------------------------------------------------------------
Summary of changes:
demos/fbshow/fbshow.c | 7 +++++--
1 files changed, 5 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.")