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 1969d4407b36047206e4e846594570086f4d5dde (commit)
from 4e298cb7cb11a0e161a4522d4f5a8496baac8f3c (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/1969d4407b36047206e4e846594570086f4d…
commit 1969d4407b36047206e4e846594570086f4d5dde
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Jun 16 11:56:09 2013 +0200
loaders: Add forgotten PNM header.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/include/loaders/GP_PNM.h b/include/loaders/GP_PNM.h
new file mode 100644
index 0000000..917a10d
--- /dev/null
+++ b/include/loaders/GP_PNM.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * 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-2013 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
+#ifndef LOADERS_GP_PNM_H
+#define LOADERS_GP_PNM_H
+
+#include "core/GP_Context.h"
+#include "core/GP_ProgressCallback.h"
+
+/*
+ * PBM Bitmap
+ */
+GP_Context *GP_LoadPBM(const char *src_path, GP_ProgressCallback *callback);
+
+int GP_SavePBM(const GP_Context *src, const char *dst_path,
+ GP_ProgressCallback *callback);
+
+/*
+ * PGM Graymap
+ */
+GP_Context *GP_LoadPGM(const char *src_path,
+ GP_ProgressCallback *callback);
+
+int GP_SavePGM(const GP_Context *src, const char *dst_path,
+ GP_ProgressCallback *callback);
+
+/*
+ * PPM Pixmap
+ */
+GP_Context *GP_LoadPPM(const char *src_path, GP_ProgressCallback *callback);
+
+int GP_SavePPM(GP_Context *src, const char *dst_path,
+ GP_ProgressCallback *callback);
+
+/*
+ * PNM Anymap (All of above)
+ */
+GP_Context *GP_LoadPNM(const char *src_path, GP_ProgressCallback *callback);
+
+int GP_SavePNM(const GP_Context *src, const char *dst_path,
+ GP_ProgressCallback *callback);
+
+/*
+ * ASCII or rawbits Bitmap.
+ */
+int GP_MatchPBM(const void *buf);
+
+/*
+ * ASCII or rawbits Graymap.
+ */
+int GP_MatchPGM(const void *buf);
+
+/*
+ * ASCII or rawbits Pixmap.
+ */
+int GP_MatchPPM(const void *buf);
+
+/*
+ * All of above.
+ */
+int GP_MatchPNM(const void *buf);
+
+#endif /* LOADERS_GP_PNM_H */
-----------------------------------------------------------------------
Summary of changes:
include/loaders/{GP_JPG.h => GP_PNM.h} | 64 +++++++++++++++++++-------------
1 files changed, 38 insertions(+), 26 deletions(-)
copy include/loaders/{GP_JPG.h => GP_PNM.h} (60%)
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 bb3d38ce1cc2b6877b7bc70344a91a01fcbfdbb5 (commit)
from 050cbfbf2c0d6aec3c941a20c6ea16d467a72751 (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/bb3d38ce1cc2b6877b7bc70344a91a01fcbf…
commit bb3d38ce1cc2b6877b7bc70344a91a01fcbfdbb5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Jun 14 19:37:50 2013 +0200
backends: Linux FB: Fix div by zero.
This backend wasn't converted to the new InputQueue().
(The GP_EventQueueInit() was not added)
Which caused div by zero in put_event() in InputQueue code.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/backends/GP_LinuxFB.c b/libs/backends/GP_LinuxFB.c
index 54516d9..b203109 100644
--- a/libs/backends/GP_LinuxFB.c
+++ b/libs/backends/GP_LinuxFB.c
@@ -314,6 +314,8 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flag)
backend->Wait = flag ? fb_wait : NULL;
backend->fd = fb->con_fd;
+ GP_EventQueueInit(&backend->event_queue, vscri.xres, vscri.yres, 0);
+
return backend;
err3:
close(fd);
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_LinuxFB.c | 2 ++
1 files changed, 2 insertions(+), 0 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 050cbfbf2c0d6aec3c941a20c6ea16d467a72751 (commit)
via 75e84dc25b607438e0141db5710fd678a6e0c4a8 (commit)
via 1528b95aef19ee5bb49272d83c3ac7d91f6ce727 (commit)
via c02f7e5b2c18615e370b15581cd1b29c18a4bc79 (commit)
from 0c37dfaea46213d3c1564499de0849c451e1f326 (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/050cbfbf2c0d6aec3c941a20c6ea16d467a7…
commit 050cbfbf2c0d6aec3c941a20c6ea16d467a72751
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Jun 12 22:57:44 2013 +0200
doc: general: Update BMP implementation state.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/general.txt b/doc/general.txt
index a8b6438..23de40d 100644
--- a/doc/general.txt
+++ b/doc/general.txt
@@ -88,7 +88,7 @@ images into various standard formats (PNG, JPEG, GIF, BMP, PNM, etc...).
| BMP | |
[green]*Yes* |
- [green]#RLE and RGB Bitfields not implemented# |
+ [green]#RLE4 and some less common bitfiels not supported# |
[green]#RGB888 only#
| TIFF |
http://repo.or.cz/w/gfxprim.git/commit/75e84dc25b607438e0141db5710fd678a6e0…
commit 75e84dc25b607438e0141db5710fd678a6e0c4a8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Jun 12 22:57:32 2013 +0200
doc: Update core docs.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/core.txt b/doc/core.txt
index eb38437..ec172a2 100644
--- a/doc/core.txt
+++ b/doc/core.txt
@@ -17,12 +17,18 @@ GP_MIN(a, b);
GP_MAX(a, b);
+GP_MAX3(a, b, c);
+
GP_ABS(a);
GP_SWAP(a, b);
GP_SIGN(a);
+GP_ARRAY_SIZE(arr);
+
+GP_CONTAINER_OF(ptr, structure, member);
+
-------------------------------------------------------------------------------
These common macros implements basic functions such as minimum, maximum,
@@ -30,6 +36,12 @@ absolute value, swap and sign.
All macros use 'typeof()' in order to evaluate their arguments exactly once.
+The 'GP_ARRAY_SIZE()' macro computes size of statically defined array (i.e.
+returns +sizeof(array) / sizeof(elem)+).
+
+The 'GP_CONTAINER_OF()' macro computes pointer to a structure given pointer to
+its member.
+
[source,c]
-------------------------------------------------------------------------------
#include <core/GP_Clamp.h>
http://repo.or.cz/w/gfxprim.git/commit/1528b95aef19ee5bb49272d83c3ac7d91f6c…
commit 1528b95aef19ee5bb49272d83c3ac7d91f6ce727
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Jun 12 22:50:58 2013 +0200
doc: Update pixels docs.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/pixels.txt b/doc/pixels.txt
index b226453..d6c18e8 100644
--- a/doc/pixels.txt
+++ b/doc/pixels.txt
@@ -1,15 +1,11 @@
Pixel Description
-----------------
-This pages describes library core functions for handling pixels.
+This pages describes library core functions for handling pixel types.
Pixel Type
~~~~~~~~~~
-Pixels are described by a pixel type, which is enumeration type. The enum is
-defined at the generated 'GP_Pixel.gen.h' header and must contain at least
-following members:
-
[source,c]
-------------------------------------------------------------------------------
#include <GP.h>
@@ -26,13 +22,28 @@ typedef enum GP_PixelType {
GP_PIXEL_G2,
GP_PIXEL_G4,
GP_PIXEL_G8,
+ ...
GP_PIXEL_MAX,
} GP_PixelType;
+/*
+ * The same values are also defined as macros so it's possible to
+ * use them with ifdef as follows.
+ */
+#ifdef GP_PIXEL_RGB555
+
+...
+
+#endif /* GP_PIXEL_RGB555 */
+
-------------------------------------------------------------------------------
-Each pixel type has accompanying record in global array of pixel types
-declared as follows:
+Pixels are described by a pixel type, which is enumeration type. The enum is
+defined in the generated 'GP_Pixel.gen.h' header and must contain at least the
+members listed above.
+
+The same names as are the enum values are also defined (to themselves) as
+macros so that it's possible to use them with 'ifdef'.
[source,c]
-------------------------------------------------------------------------------
@@ -46,12 +57,21 @@ typedef struct {
uint8_t size; /* Bit-size */
} GP_PixelTypeChannel;
+typedef enum GP_PixelFlags {
+ GP_PIXEL_HAS_ALPHA = 0x01,
+ GP_PIXEL_IS_RGB = 0x02,
+ GP_PIXEL_IS_PALETTE = 0x04,
+ GP_PIXEL_IS_CMYK = 0x08,
+ GP_PIXEL_IS_GRAYSCALE = 0x10,
+} GP_PixelFlags;
+
typedef struct {
GP_PixelType type; /* Number of the type */
const char name[16]; /* Name */
uint8_t size; /* Size in bits */
GP_BIT_ENDIAN bit_endian; /* Order of pixels in a byte */
uint8_t numchannels; /* Number of channels */
+ GP_PixelFlags flags;
/* String describing the bit-representaton (as in "RRRRRGGGGGGBBBBB")*/
const char bitmap[GP_PIXEL_BITS + 1];
/* Individual channels */
@@ -60,13 +80,44 @@ typedef struct {
extern const GP_PixelTypeDescription const GP_PixelTypes[];
+const GP_PixelTypeDescription *GP_PixelTypeDesc(GP_PixelType type);
+
const char *GP_PixelTypeName(GP_PixelType type);
uint32_t GP_PixelSize(GP_PixelType type);
+
+int GP_PixelHasFlags(GP_PixelType pixel_type, GP_PixelFlags flags);
-------------------------------------------------------------------------------
-There are also pixel matching functions that returns pixel type given RGB
-channel masks or sizes and offsets:
+Each pixel type has accompanying record in global array describing pixel types.
+
+You should not use this array directly, use the 'GP_PixelTypeDesc()' function
+to query the pixel type description.
+
+The 'GP_PixelTypeName()' function returns static string with pixel type name.
+
+The 'GP_PixelSize()' returns pixel size in bits.
+
+The 'GP_PixelHasFlags()' function returns true if particular pixel type
+contains the bitmask of pixel flags.
+
+[source,c]
+-------------------------------------------------------------------------------
+#include <GP.h>
+/* or */
+#include <core/GP_Pixel.h>
+
+void GP_PixelPrint(GP_Pixel pixel, GP_PixelType type);
+
+void GP_PixelSNPrint(char *buf, size_t len, GP_Pixel pixel, GP_PixelType type);
+-------------------------------------------------------------------------------
+
+Pretty print pixel value given the pixel type.
+
+.Sample output from the functions
+-------------------------------------------------------------------------------
+RGB888 0xffffff R=255 G=255 B=255
+-------------------------------------------------------------------------------
[source,c]
-------------------------------------------------------------------------------
@@ -85,3 +136,5 @@ GP_PixelType GP_PixelRGBLookup(uint32_t rsize, uint32_t roff,
uint8_t bits_per_pixel);
-------------------------------------------------------------------------------
+Returns pixel type given either RGB masks or RGB sizes and offsets. If no
+matching pixel was found 'GP_PIXEL_UNKNOWN' is returned.
http://repo.or.cz/w/gfxprim.git/commit/c02f7e5b2c18615e370b15581cd1b29c18a4…
commit c02f7e5b2c18615e370b15581cd1b29c18a4bc79
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Jun 12 22:15:16 2013 +0200
demos: c_simple: Add pretty print example.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/c_simple/Makefile b/demos/c_simple/Makefile
index 3202c84..e086f75 100644
--- a/demos/c_simple/Makefile
+++ b/demos/c_simple/Makefile
@@ -18,7 +18,7 @@ APPS=backend_example loaders_example loaders filters_symmetry gfx_koch v4l2_show v4l2_grab convolution weighted_median shapetest koch input_example fileview linetest randomshapetest fonttest loaders_register blittest textaligntest abort sin_AA x11_windows- debug_handler gaussian_noise byte_utils version
+ debug_handler gaussian_noise byte_utils version pretty_print
ifeq ($(HAVE_LIBSDL),yes)
APPS+=SDL_glue
diff --git a/demos/c_simple/pretty_print.c b/demos/c_simple/pretty_print.c
new file mode 100644
index 0000000..ef010da
--- /dev/null
+++ b/demos/c_simple/pretty_print.c
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * 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-2013 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
+/*
+
+ Pretty print function for pixel and context.
+
+ */
+
+#include <GP.h>
+
+int main(void)
+{
+ GP_Context *ctx = GP_ContextAlloc(100, 100, GP_PIXEL_RGB888);
+ GP_Pixel pix = ~(GP_Pixel)0;
+
+ /* Pretty prints pixel values */
+ GP_PixelPrint(pix, GP_PIXEL_RGB888);
+
+ /* Pretty prints context info */
+ GP_ContextPrintInfo(ctx);
+
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/Makefile | 2 +-
demos/c_simple/{version.c => pretty_print.c} | 12 +++-
doc/core.txt | 12 ++++
doc/general.txt | 2 +-
doc/pixels.txt | 71 ++++++++++++++++++++++---
5 files changed, 85 insertions(+), 14 deletions(-)
copy demos/c_simple/{version.c => pretty_print.c} (86%)
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 71f52a5f96a206b5aeb9562de37143a731d6bbc4 (commit)
via aab22729cba114c6be378df856d356d3d1bd4ea8 (commit)
from c70943a639eabdf53615fb48e6206ed4ed020d1b (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/71f52a5f96a206b5aeb9562de37143a731d6…
commit 71f52a5f96a206b5aeb9562de37143a731d6bbc4
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri May 31 23:56:16 2013 +0200
loaders: BMP: Fix progress callback percentage.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/loaders/GP_BMP.c b/libs/loaders/GP_BMP.c
index 70f701d..7530794 100644
--- a/libs/loaders/GP_BMP.c
+++ b/libs/loaders/GP_BMP.c
@@ -526,7 +526,7 @@ static int read_palette(FILE *f, struct bitmap_info_header *header,
GP_PutPixel_Raw_24BPP(context, x, ry, p);
}
- if (GP_ProgressCallbackReport(callback, header->h - y -1,
+ if (GP_ProgressCallbackReport(callback, y,
context->h, context->w)) {
GP_DEBUG(1, "Operation aborted");
return ECANCELED;
@@ -575,7 +575,7 @@ static int read_bitfields_or_rgb(FILE *f, struct bitmap_info_header *header,
break;
}
- if (GP_ProgressCallbackReport(callback, header->h - y -1,
+ if (GP_ProgressCallbackReport(callback, y,
context->h, context->w)) {
GP_DEBUG(1, "Operation aborted");
return ECANCELED;
http://repo.or.cz/w/gfxprim.git/commit/aab22729cba114c6be378df856d356d3d1bd…
commit aab22729cba114c6be378df856d356d3d1bd4ea8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri May 31 16:49:43 2013 +0200
core: Remove now unused GP_WritePixel.gen.c.t
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/core/GP_WritePixel.gen.c.t b/libs/core/GP_WritePixel.gen.c.t
deleted file mode 100644
index 89ecc1f..0000000
--- a/libs/core/GP_WritePixel.gen.c.t
+++ /dev/null
@@ -1,59 +0,0 @@
-/*****************************************************************************
- * 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-2013 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-%% extends 'base.h.t'
-
-{% block description %}Write pixel{% endblock %}
-
-{% block body %}
-
-#include "core/GP_GetSetBits.h"
-#include "core/GP_GetPutPixel.h"
-#include "core/GP_WritePixel.gen.h"
-#include "core/GP_Debug.h"
-
-{# Some pixel types has hand written optimized functions #}
-%% set hand_optimized = ['1BPP_LE', '1BPP_BE',
- '2BPP_LE', '2BPP_BE',
- '4BPP_LE', '4BPP_BE',
- '8BPP', '16BPP',
- '24BPP', '32BPP']
-
-%% for ps in pixelsizes
-%% if ps.suffix not in hand_optimized
-%% if ps.needs_bit_endian()
-void GP_WritePixels_{{ ps.suffix }}(void *start, uint8_t off,
- size_t cnt, unsigned int val)
-{
- GP_TODO("Unimplemented");
-}
-%% else
-void GP_WritePixels_{{ ps.suffix }}(void *start, size_t cnt, unsigned int val)
-{
- GP_TODO("Unimplemented");
-}
-%% endif
-
-%% endif
-%% endfor
-
-{% endblock body %}
diff --git a/libs/core/Makefile b/libs/core/Makefile
index 46a46d3..c392a2b 100644
--- a/libs/core/Makefile
+++ b/libs/core/Makefile
@@ -2,7 +2,7 @@ TOPDIR=../..
include $(TOPDIR)/pre.mk
GENSOURCES=GP_Pixel.gen.c GP_Blit.gen.c GP_Convert.gen.c - GP_GammaCorrection.gen.c GP_WritePixel.gen.c
+ GP_GammaCorrection.gen.c
CSOURCES=$(filter-out $(wildcard *.gen.c),$(wildcard *.c))
LIBNAME=core
-----------------------------------------------------------------------
Summary of changes:
libs/core/GP_WritePixel.gen.c.t | 59 ---------------------------------------
libs/core/Makefile | 2 +-
libs/loaders/GP_BMP.c | 4 +-
3 files changed, 3 insertions(+), 62 deletions(-)
delete mode 100644 libs/core/GP_WritePixel.gen.c.t
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.")