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 ded09ff77c3cb7e8a5f0666434806f7be8aebf63 (commit)
from a9450959b372c0d3c47b09b1714c7563808756ee (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/ded09ff77c3cb7e8a5f0666434806f7be8ae…
commit ded09ff77c3cb7e8a5f0666434806f7be8aebf63
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Aug 10 22:43:02 2012 +0200
tests: Remove SDL based showimage.
Similar test already exists.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
index 6f83335..c11568d 100644
--- a/tests/SDL/Makefile
+++ b/tests/SDL/Makefile
@@ -8,7 +8,7 @@ ifeq ($(HAVE_LIBSDL),yes)
CSOURCES=$(shell echo *.c)
APPS=pixeltest fonttest linetest randomshapetest- symbolstest textaligntest trianglefps blittest subcontext showimage+ symbolstest textaligntest trianglefps blittest subcontext aatest mixpixeltest
endif
diff --git a/tests/SDL/showimage.c b/tests/SDL/showimage.c
deleted file mode 100644
index a63ba78..0000000
--- a/tests/SDL/showimage.c
+++ /dev/null
@@ -1,127 +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-2011 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-SDL_Surface *display = NULL;
-GP_Context context, *bitmap;
-
-int brightness = 0;
-
-void event_loop(void)
-{
- SDL_Event event;
- GP_Context *res;
-
- while (SDL_WaitEvent(&event) > 0) {
-
- switch (event.type) {
-
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym) {
- case SDLK_ESCAPE:
- return;
- case SDLK_UP:
- brightness+=2;
- case SDLK_DOWN: {
- brightness-=1;
-
- GP_FILTER_PARAMS(bitmap->pixel_type, param);
- GP_FilterParamSetIntAll(param, brightness);
- res = GP_FilterBrightness(bitmap, NULL, param, NULL);
-
- printf("brightness = %i %ux%un", brightness, res->w, res->h);
-
- GP_Blit(res, 0, 0, res->w, res->h, &context, 0, 0);
- SDL_Flip(display);
- GP_ContextFree(res);
- } break;
- default:
- break;
- }
- break;
- case SDL_QUIT:
- return;
- default:
- break;
- }
- }
-}
-
-int main(int argc, char *argv[])
-{
- /* Bits per pixel to be set for the display surface. */
- int display_bpp = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- }
- else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- }
- else if (strcmp(argv[i], "-32") == 0) {
- display_bpp = 32;
- }
- }
-
- GP_SetDebugLevel(10);
-
- if ((bitmap = GP_LoadImage(argv[1], NULL)) == NULL) {
- fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno));
- return 1;
- }
-
- /* Initialize SDL */
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- /* Create a window with a software back surface */
- display = SDL_SetVideoMode(bitmap->w, bitmap->h, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
- GP_SDL_ContextFromSurface(&context, display);
-
- GP_Blit(bitmap, 0, 0, bitmap->w, bitmap->h, &context, 0, 0);
- SDL_Flip(display);
-
- event_loop();
-
- SDL_Quit();
- return 0;
-fail:
- SDL_Quit();
- return 1;
-}
-
-----------------------------------------------------------------------
Summary of changes:
tests/SDL/Makefile | 2 +-
tests/SDL/showimage.c | 127 -------------------------------------------------
2 files changed, 1 insertions(+), 128 deletions(-)
delete mode 100644 tests/SDL/showimage.c
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 1cb6c5439748776bff0baa03e9be4d5ceea9dbbc (commit)
from 1b13c9d73865b69c4c52c27a5328fd7aea68b805 (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/1cb6c5439748776bff0baa03e9be4d5ceea9…
commit 1cb6c5439748776bff0baa03e9be4d5ceea9dbbc
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Aug 10 18:37:58 2012 +0200
pywrap: Add error checks for PXM loaders.
diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i
index 2e54d41..9561176 100644
--- a/pylib/gfxprim/loaders/loaders.i
+++ b/pylib/gfxprim/loaders/loaders.i
@@ -44,9 +44,14 @@ ERROR_ON_NONZERO(GP_SavePNG);
%include "GP_PNG.h"
-/* TODO: No error checking - legacy GP_RetCode form */
+ERROR_ON_NULL(GP_LoadPBM);
+ERROR_ON_NULL(GP_LoadPGM);
+ERROR_ON_NULL(GP_LoadPPM);
+ERROR_ON_NONZERO(GP_SavePBM);
+ERROR_ON_NONZERO(GP_SavePGM);
+ERROR_ON_NONZERO(GP_SavePPM);
+
%include "GP_PBM.h"
%include "GP_PGM.h"
%include "GP_PPM.h"
-
-----------------------------------------------------------------------
Summary of changes:
pylib/gfxprim/loaders/loaders.i | 9 +++++++--
1 files changed, 7 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 faaba1897920ea54344ca36ec8c6633d0a6ebf1d (commit)
from 14d0a7da4df6fac46b50da3afd0ab8fe35653e6f (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/faaba1897920ea54344ca36ec8c6633d0a6e…
commit faaba1897920ea54344ca36ec8c6633d0a6ebf1d
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Aug 1 00:10:28 2012 +0200
loaders: GIF: Add support for interlaced images.
diff --git a/libs/loaders/GP_GIF.c b/libs/loaders/GP_GIF.c
index aa999db..15e0c44 100644
--- a/libs/loaders/GP_GIF.c
+++ b/libs/loaders/GP_GIF.c
@@ -176,6 +176,44 @@ static int get_bg_color(GifFileType *gf, GP_Pixel *pixel)
return 1;
}
+/*
+ * The interlacing consists of 8 pixel high strips. Each pass adds some lines
+ * into each strip. This function maps y in the gif buffer to real y.
+ */
+static inline unsigned int interlace_real_y(GifFileType *gf, unsigned int y)
+{
+ const unsigned int h = gf->Image.Height;
+ unsigned int real_y;
+
+ /* Pass 1: Line 0 for each strip */
+ real_y = 8 * y;
+
+ if (real_y < h)
+ return real_y;
+
+ /* Pass 2: Line 4 for each strip */
+ real_y = 8 * (y - (h - 1)/8 - 1) + 4;
+
+ if (real_y < h)
+ return real_y;
+
+ /* Pass 3: Lines 2 and 6 */
+ real_y = 4 * (y - (h - 1)/4 - 1) + 2;
+
+ if (real_y < h)
+ return real_y;
+
+ /* Pass 4: Lines 1, 3, 5, and 7 */
+ real_y = 2 * (y - h/2 - h%2) + 1;
+
+ if (real_y < h)
+ return real_y;
+
+ GP_BUG("real_y > h");
+
+ return 0;
+}
+
GP_Context *GP_ReadGIF(void *f, GP_ProgressCallback *callback)
{
GifFileType *gf = f;
@@ -240,9 +278,16 @@ GP_Context *GP_ReadGIF(void *f, GP_ProgressCallback *callback)
DGifGetLine(gf, line, gf->Image.Width);
+ unsigned int real_y = y;
+
+ if (gf->Image.Interlace == 64) {
+ real_y = interlace_real_y(gf, y);
+ GP_DEBUG(3, "Interlace y -> real_y %u %u", y, real_y);
+ }
+
//TODO: just now we have only 8BPP
for (x = 0; x < gf->Image.Width; x++)
- GP_PutPixel_Raw_24BPP(res, x + gf->Image.Left, y, get_color(gf, line[x]));
+ GP_PutPixel_Raw_24BPP(res, x + gf->Image.Left, real_y, get_color(gf, line[x]));
if (GP_ProgressCallbackReport(callback, y - gf->Image.Top,
gf->Image.Height,
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_GIF.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 1 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.")