This is an automated email generated because a ref change occurred in the
git repository for project gfxprim.git.
The branch, master has been updated
discards 302953014e10dcef71b369e495dfb91b0fed705e (commit)
discards afb3d2823c56ff76b757359c589c449252757303 (commit)
discards b10281ba4c6ef9ade39e86b8c3aa42878fdff59f (commit)
via 69d7c9ef5642dee09b76da64d79f5f5e474501e5 (commit)
via 500eb1a9b1bc02f690025bdbcc6bde1920146ed5 (commit)
via 8af53840ba1296b26bdfe86753ec1eb32ddfa1cd (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (302953014e10dcef71b369e495dfb91b0fed705e)
\
N -- N -- N (69d7c9ef5642dee09b76da64d79f5f5e474501e5)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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 -----------------------------------------------------------------
commit 69d7c9ef5642dee09b76da64d79f5f5e474501e5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon, 23 Oct 2017 18:26:46 +0200
URL: <http://repo.or.cz/gfxprim.git/69d7c9ef5642dee0>
spiv: Fix image list counter
We have to add cur_file only and only if we are inside of a directory,
otherwise we end up with random position.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
---
demos/spiv/image_list.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/demos/spiv/image_list.c b/demos/spiv/image_list.c
index be6532c0763e..cf1d18c09a21 100644
--- a/demos/spiv/image_list.c
+++ b/demos/spiv/image_list.c
@@ -360,6 +360,9 @@ unsigned int image_list_count(struct image_list *self)
unsigned int image_list_pos(struct image_list *self)
{
+ if (!self->in_dir)
+ return count_img_to(self, self->cur_arg);
+
return count_img_to(self, self->cur_arg) + self->cur_file;
}
commit 500eb1a9b1bc02f690025bdbcc6bde1920146ed5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon, 23 Oct 2017 14:15:48 +0200
URL: <http://repo.or.cz/gfxprim.git/500eb1a9b1bc02f6>
loaders: PNG: Wire up gamma tables.
Now the loader at least tries to set the gamma value for the pixmap,
which is later used by some of the resampling functions, etc.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
---
libs/loaders/GP_PNG.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index fa01db1c5939..d0191cf5f103 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -196,6 +196,9 @@ static int read_convert_bitmap(GP_Pixmap *res, GP_ProgressCallback *callback,
unsigned int y;
+ if (gamma < 0.01)
+ GP_PixmapSetGamma(res, 2.2);
+
for (y = 0; y < res->h; y++) {
png_read_row(png, (void*)row, NULL);
uint8_t *rrow = GP_PIXEL_ADDR(res, 0, y);
@@ -385,6 +388,9 @@ int GP_ReadPNGEx(GP_IO *io, GP_Pixmap **img,
goto err2;
}
+ if (gamma > 0.1)
+ GP_PixmapSetGamma(res, 1/gamma);
+
if (color_type == PNG_COLOR_TYPE_GRAY && depth < 8)
png_set_packswap(png);
commit 8af53840ba1296b26bdfe86753ec1eb32ddfa1cd
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon, 23 Oct 2017 13:52:39 +0200
URL: <http://repo.or.cz/gfxprim.git/8af53840ba1296b2>
core: GP_Pixmap: Add GP_PixmapSetGamma() function
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
---
build/syms/Core_symbols.txt | 1 +
include/core/GP_Pixmap.h | 5 +++++
libs/core/GP_Gamma.c | 7 ++++++-
libs/core/GP_Pixmap.c | 9 +++++++++
4 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/build/syms/Core_symbols.txt b/build/syms/Core_symbols.txt
index 7ee4ff213aff..b49ab7670191 100644
--- a/build/syms/Core_symbols.txt
+++ b/build/syms/Core_symbols.txt
@@ -2,6 +2,7 @@ GP_PixelTypes
GP_PixelHasFlags
GP_PixmapAlloc
+GP_PixmapSetGamma
GP_PixmapResize
GP_PixmapConvertAlloc
GP_PixmapPrintInfo
diff --git a/include/core/GP_Pixmap.h b/include/core/GP_Pixmap.h
index f67e6ec2f9d6..d599fbe792eb 100644
--- a/include/core/GP_Pixmap.h
+++ b/include/core/GP_Pixmap.h
@@ -111,6 +111,11 @@ typedef struct GP_Pixmap {
GP_Pixmap *GP_PixmapAlloc(GP_Size w, GP_Size h, GP_PixelType type);
/*
+ * Sets gamma for the pixmap.
+ */
+int GP_PixmapSetGamma(GP_Pixmap *self, float gamma);
+
+/*
* Free pixmap.
*
* If pixmap->free_pixels, also free pixel data.
diff --git a/libs/core/GP_Gamma.c b/libs/core/GP_Gamma.c
index 05500f9a0c36..26286b03f43a 100644
--- a/libs/core/GP_Gamma.c
+++ b/libs/core/GP_Gamma.c
@@ -186,7 +186,12 @@ GP_Gamma *GP_GammaCopy(GP_Gamma *self)
void GP_GammaRelease(GP_Gamma *self)
{
- int channels = GP_PixelTypes[self->pixel_type].numchannels, i;
+ int channels, i;
+
+ if (!self)
+ return;
+
+ channels = GP_PixelTypes[self->pixel_type].numchannels;
GP_DEBUG(1, "Releasing Gamma table %s gamma %f", GP_PixelTypeName(self->pixel_type), self->tables[0]->gamma);
diff --git a/libs/core/GP_Pixmap.c b/libs/core/GP_Pixmap.c
index 53c289e1c007..72dbae21fd13 100644
--- a/libs/core/GP_Pixmap.c
+++ b/libs/core/GP_Pixmap.c
@@ -114,6 +114,15 @@ GP_Pixmap *GP_PixmapAlloc(GP_Size w, GP_Size h, GP_PixelType type)
return pixmap;
}
+int GP_PixmapSetGamma(GP_Pixmap *self, float gamma)
+{
+ GP_GammaRelease(self->gamma);
+
+ self->gamma = GP_GammaAcquire(self->pixel_type, gamma);
+
+ return !self->gamma;
+}
+
void GP_PixmapFree(GP_Pixmap *pixmap)
{
GP_DEBUG(1, "Freeing pixmap (%p)", pixmap);
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/spiv.c | 2 +-
libs/core/GP_Gamma.c | 4 ++--
2 files changed, 3 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, master has been updated
via 9910a9b5e922bd0493e5c76efb27474c4310ca34 (commit)
from e9d8edec450a97a0b8741273bb5d5e90fb94c821 (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/gfxprim.git/commit/9910a9b5e922bd0493e5c76efb27474c4310ca…
commit 9910a9b5e922bd0493e5c76efb27474c4310ca34
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Dec 19 22:28:16 2015 +0100
demos: c_simple: v4l2_show: Handle SYS_RESIZE
Adds SYS_RESIZE event handling and centers the image in the window.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/c_simple/v4l2_show.c b/demos/c_simple/v4l2_show.c
index 97467b5..443d6d4 100644
--- a/demos/c_simple/v4l2_show.c
+++ b/demos/c_simple/v4l2_show.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
GP_Backend *backend;
GP_Grabber *grabber;
const char *v4l2_device = "/dev/video0";
- unsigned int w = 320, h = 240;
+ unsigned int w = 640, h = 480;
int mode = 0;
int opt;
@@ -113,7 +113,10 @@ int main(int argc, char *argv[])
break;
}
- GP_Blit_Clipped(res, 0, 0, res->w, res->h, backend->context, 0, 0);
+ unsigned int c_x = (backend->context->w - res->w) / 2;
+ unsigned int c_y = (backend->context->h - res->h) / 2;
+
+ GP_Blit_Clipped(res, 0, 0, res->w, res->h, backend->context, c_x, c_y);
GP_BackendFlip(backend);
if (mode)
@@ -150,6 +153,13 @@ int main(int argc, char *argv[])
mode = 0;
break;
}
+ break;
+ case GP_EV_SYS:
+ if (ev.code == GP_EV_SYS_RESIZE) {
+ GP_BackendResizeAck(backend);
+ GP_Fill(backend->context, 0);
+ }
+ break;
}
}
}
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/v4l2_show.c | 14 ++++++++++++--
1 file changed, 12 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 e9d8edec450a97a0b8741273bb5d5e90fb94c821 (commit)
via ffbfb62987085873f5996218fdf3fbb7ae0390e4 (commit)
from 01cb569b20ec2962ccb1f4b845d2f396ad8b08df (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/gfxprim.git/commit/e9d8edec450a97a0b8741273bb5d5e90fb94c8…
commit e9d8edec450a97a0b8741273bb5d5e90fb94c821
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 9 14:47:15 2015 +0100
loaders: JPG: Fix read callback
Apparently when I/O read callback returns buffer of size 0 the libjpeg
segfaults. So we now return FALSE from the callback even when read
returns 0, which means end of the file when the underlying I/O is file
based.
Special thanks to the american fuzzy lop (afl).
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/loaders/GP_JPG.c b/libs/loaders/GP_JPG.c
index 4921f24..9ac4630 100644
--- a/libs/loaders/GP_JPG.c
+++ b/libs/loaders/GP_JPG.c
@@ -156,8 +156,8 @@ static boolean fill_input_buffer(struct jpeg_decompress_struct *cinfo)
ret = GP_IORead(src->io, src->buffer, src->size);
- if (ret < 0) {
- GP_WARN("Failed to fill buffer");
+ if (ret <= 0) {
+ GP_WARN("Failed to fill buffer, IORead returned %i", ret);
return FALSE;
}
http://repo.or.cz/gfxprim.git/commit/ffbfb62987085873f5996218fdf3fbb7ae0390…
commit ffbfb62987085873f5996218fdf3fbb7ae0390e4
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 9 14:11:17 2015 +0100
loaders: PCX: Make sure w < bytes_per_line * 8 / bpp
Fixes crash on inconsistent header where w > bytes_per_line * 8 / bpp.
Special thanks to the american fuzzy lop (afl).
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/loaders/GP_PCX.c b/libs/loaders/GP_PCX.c
index 20c6b20..2304bbd 100644
--- a/libs/loaders/GP_PCX.c
+++ b/libs/loaders/GP_PCX.c
@@ -292,7 +292,7 @@ static int read_16_palette(GP_IO *io, struct pcx_header *header,
unsigned int i;
uint8_t b[header->bytes_per_line];
GP_Pixel palette[16];
- uint8_t idx=0, mask, mod;
+ uint8_t idx = 0, mask, mod;
for (i = 0; i < 16; i++) {
palette[i] = (GP_Pixel)header->palette[3*i] << 16;
@@ -543,6 +543,14 @@ int GP_ReadPCXEx(GP_IO *io, GP_Context **img, GP_DataStorage *storage,
w = header.xe - header.xs + 1;
h = header.ye - header.ys + 1;
+ uint32_t max_w = ((uint32_t)header.bytes_per_line * 8) / header.bpp;
+
+ if (w > max_w) {
+ GP_WARN("Truncating image width (%u) to "
+ "bytes_per_line * 8 / bpp (%"PRIu32")", w, max_w);
+ w = max_w;
+ }
+
res = GP_ContextAlloc(w, h, pixel_type);
if (!res) {
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_JPG.c | 4 ++--
libs/loaders/GP_PCX.c | 10 +++++++++-
2 files changed, 11 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.")