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 cca1a95d0c61b096110045f796c86ab02703362f (commit)
from ed03e7bc0d0825a97e73887be30e768cc0f8aeec (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/cca1a95d0c61b096110045f796c86ab02703…
commit cca1a95d0c61b096110045f796c86ab02703362f
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon May 28 00:35:19 2012 +0200
loaders: PNG More work on metadata.
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 2cef50d..7602fe7 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -270,6 +270,17 @@ static void load_meta_data(png_structp png, png_infop png_info, GP_MetaData *dat
GP_MetaDataCreateString(data, "res_unit", unit_name, 0);
}
+ png_timep mod_time;
+
+ if (png_get_tIME(png, png_info, &mod_time)) {
+ GP_MetaDataCreateInt(data, "mod_sec", mod_time->second);
+ GP_MetaDataCreateInt(data, "mod_min", mod_time->minute);
+ GP_MetaDataCreateInt(data, "mod_hour", mod_time->hour);
+ GP_MetaDataCreateInt(data, "mod_day", mod_time->day);
+ GP_MetaDataCreateInt(data, "mod_mon", mod_time->month);
+ GP_MetaDataCreateInt(data, "mod_year", mod_time->year);
+ }
+
double width, height;
if (png_get_sCAL(png, png_info, &unit, &width, &height)) {
@@ -277,6 +288,23 @@ static void load_meta_data(png_structp png, png_infop png_info, GP_MetaData *dat
GP_MetaDataCreateInt(data, "height", height * 1000);
GP_MetaDataCreateInt(data, "unit", unit);
}
+
+ png_textp text_ptr;
+ int text_cnt;
+
+ if (png_get_text(png, png_info, &text_ptr, &text_cnt)) {
+ int i;
+
+ for (i = 0; i < text_cnt; i++) {
+
+ if (text_ptr[i].compression != PNG_TEXT_COMPRESSION_NONE)
+ continue;
+
+ char buf[GP_META_RECORD_ID_MAX];
+ snprintf(buf, GP_META_RECORD_ID_MAX, "text:%s", text_ptr[i].key);
+ GP_MetaDataCreateString(data, buf, text_ptr[i].text, 1);
+ }
+ }
}
int GP_ReadPNGMetaData(FILE *f, GP_MetaData *data)
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_PNG.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 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 8aab7a816e45ba2fcfd256ab48bb36aa350c98f9 (commit)
from 965a9237db419f83183eb4a59fc9bc741782093e (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/8aab7a816e45ba2fcfd256ab48bb36aa350c…
commit 8aab7a816e45ba2fcfd256ab48bb36aa350c98f9
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 27 15:34:52 2012 +0200
spiv: Resize backend to fit image on pressing 1.
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index 91b9f35..9862049 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -171,9 +171,10 @@ int load_image(struct loader_params *params)
* This function tries to resize spiv window
* and if succedes blits the image directly to the screen.
*/
-static int resize_backend_and_blit(GP_Context *img,
- struct loader_params *params)
+static int resize_backend_and_blit(struct loader_params *params)
{
+ GP_Context *img = params->img;
+
if (GP_BackendResize(backend, img->w, img->h))
return 1;
@@ -236,6 +237,7 @@ static void *image_loader(void *ptr)
if (rat < 1) {
cpu_timer_start(&timer, "Blur");
callback.priv = "Blurring Image";
+ //TODO: We can't blur saved image!
if (GP_FilterGaussianBlur(img, img, 0.4/rat, 0.4/rat,
&callback) == NULL)
return NULL;
@@ -587,6 +589,9 @@ int main(int argc, char *argv[])
params.show_progress_once = 1;
show_image(¶ms, argv[argn]);
break;
+ case GP_KEY_1:
+ resize_backend_and_blit(¶ms);
+ break;
}
break;
case GP_EV_SYS:
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/spiv.c | 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 965a9237db419f83183eb4a59fc9bc741782093e (commit)
from e403e7ee1b9adba8f821a623d862a03ac7afc941 (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/965a9237db419f83183eb4a59fc9bc741782…
commit 965a9237db419f83183eb4a59fc9bc741782093e
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 27 15:26:29 2012 +0200
loaders: Use png_set_packswap() (to reduce size of code).
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 2afb072..742cf46 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -200,7 +200,7 @@ GP_Context *GP_ReadPNG(FILE *f, GP_ProgressCallback *callback)
}
if (color_type == PNG_COLOR_TYPE_GRAY)
- res->bit_endian = 1;
+ png_set_packswap(png);
uint32_t y;
@@ -305,48 +305,23 @@ static int prepare_png_header(const GP_Context *src, png_structp png,
return 0;
}
-static int write_png_data_g_swap(const GP_Context *src, png_structp png,
- GP_ProgressCallback *callback)
+static int write_png_data(const GP_Context *src, png_structp png,
+ GP_ProgressCallback *callback, int bit_endian_flag)
{
- unsigned int y;
- uint8_t row[src->bytes_per_row];
-
- for (y = 0; y < src->h; y++) {
- memcpy(row, GP_PIXEL_ADDR(src, 0, y), src->bytes_per_row);
-
+ /* Look if we need to swap data when writing */
+ if (bit_endian_flag) {
switch (src->pixel_type) {
case GP_PIXEL_G1:
- GP_BitSwapRow_B1(row, src->bytes_per_row);
- break;
case GP_PIXEL_G2:
- GP_BitSwapRow_B4(row, src->bytes_per_row);
- break;
case GP_PIXEL_G4:
- GP_BitSwapRow_B4(row, src->bytes_per_row);
+ png_set_packswap(png);
break;
default:
return ENOSYS;
break;
}
-
- png_write_row(png, row);
-
- if (GP_ProgressCallbackReport(callback, y, src->h, src->w)) {
- GP_DEBUG(1, "Operation aborted");
- return ECANCELED;
- }
}
- return 0;
-}
-
-static int write_png_data(const GP_Context *src, png_structp png,
- GP_ProgressCallback *callback, int bit_endian_flag)
-{
- /* Look if we need to swap data when writing */
- if (bit_endian_flag)
- return write_png_data_g_swap(src, png, callback);
-
unsigned int y;
for (y = 0; y < src->h; y++) {
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_PNG.c | 37 ++++++-------------------------------
1 files changed, 6 insertions(+), 31 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 e403e7ee1b9adba8f821a623d862a03ac7afc941 (commit)
from adef520463dc58869ba1570a8d5cd05b7691091a (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/e403e7ee1b9adba8f821a623d862a03ac7af…
commit e403e7ee1b9adba8f821a623d862a03ac7afc941
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 27 14:51:17 2012 +0200
loaders: Set bit endian flag on grayscale PNG load.
* The 1BPP_BE 2BPP_BE and 4BPP_BE blits doesn't work yet, ugh :(
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 3e8d6de..2afb072 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -199,6 +199,9 @@ GP_Context *GP_ReadPNG(FILE *f, GP_ProgressCallback *callback)
goto err2;
}
+ if (color_type == PNG_COLOR_TYPE_GRAY)
+ res->bit_endian = 1;
+
uint32_t y;
/* start the actuall reading */
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_PNG.c | 3 +++
1 files changed, 3 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 adef520463dc58869ba1570a8d5cd05b7691091a (commit)
from f278f7d7683d97876757877353550e431700d180 (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/adef520463dc58869ba1570a8d5cd05b7691…
commit adef520463dc58869ba1570a8d5cd05b7691091a
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 27 14:40:52 2012 +0200
spiv: Move the resampling workaround to a correct place.
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index 77c3bc4..91b9f35 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -152,6 +152,14 @@ int load_image(struct loader_params *params)
GP_BackendFlip(backend);
return 1;
}
+
+ /* Workaround */
+ if (img->pixel_type != GP_PIXEL_RGB888) {
+ GP_Context *tmp = GP_ContextConvert(img, GP_PIXEL_RGB888);
+ GP_ContextFree(img);
+ img = tmp;
+ }
+
cpu_timer_stop(&timer);
params->img = img;
@@ -221,13 +229,6 @@ static void *image_loader(void *ptr)
w = img->w;
h = img->h;
- /* Workaround */
- if (img->pixel_type != GP_PIXEL_RGB888) {
- GP_Context *tmp = GP_ContextConvert(img, GP_PIXEL_RGB888);
- GP_ContextFree(img);
- img = tmp;
- }
-
GP_Context *ret;
/* Do low pass filter */
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/spiv.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 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.")