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 93fe2dde68b7eb9a2d22c4006e5c9d03c4e2485c (commit)
via 5f991644977d8e9bda991e1b79efba06fc05adff (commit)
via 057139e9ba8617156f214005b143846b6110f28d (commit)
from f075f1935eff2f786cc3b481d1ec7037f6654a9a (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/93fe2dde68b7eb9a2d22c4006e5c9d03c4e2…
commit 93fe2dde68b7eb9a2d22c4006e5c9d03c4e2485c
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Apr 19 18:24:13 2013 +0200
doc: update python loaders docs.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/loaders_python.txt b/doc/loaders_python.txt
index 4ac158b..992cd07 100644
--- a/doc/loaders_python.txt
+++ b/doc/loaders_python.txt
@@ -16,6 +16,12 @@ import gfxprim.loaders as loaders
Loads an image from a file.
+This is a general purpose loader function that automatically detects the file
+format.
+
+The format is detected from file extension first and if this fails signature
+base method is used.
+
May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT' or any other
'errno' set by 'open(2)', 'read(2)', 'seek(2)'.
@@ -26,3 +32,42 @@ May raise 'OSError' with errno set to 'EIO' when file is damaged.
May raise 'OSError' with errno set to 'ECANCELED' when action was interrupted
by callback.
+
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.loaders as loaders
+
+ img.loaders.Save(path, callback=None)
+
+ img.loaders.SavePNG(path, callback=None)
+
+ img.loaders.SaveJPG(path, callback=None)
+
+ img.loaders.SaveBMP(path, callback=None)
+-------------------------------------------------------------------------------
+
+Save image to a file.
+
+For the Save() method the file format is derived from the extension.
+
+May raise 'OSError' with errno set to 'EPERM', 'EISDIR', 'ENOENT' or any other
+'errno' set by 'open(2)', 'write(2)', 'seek(2)'.
+
+May raise 'OSError' with errno set to 'ENOSYS' on unsupported pixel type for
+a given format.
+
+May raise 'OSError' with errno set to 'EIO' when file is damaged.
+
+May raise 'OSError' with errno set to 'ECANCELED' when action was interrupted
+by callback.
+
+[source,python]
+-------------------------------------------------------------------------------
+import gfxprim.loaders as loaders
+
+ loaders.ListLoaders()
+
+-------------------------------------------------------------------------------
+
+Prints all loaders and their capabilites into the 'stdout'.
http://repo.or.cz/w/gfxprim.git/commit/5f991644977d8e9bda991e1b79efba06fc05…
commit 5f991644977d8e9bda991e1b79efba06fc05adff
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Apr 19 18:20:57 2013 +0200
demos: py_simple: Make use of loaders submodule.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/py_simple/dither.py b/demos/py_simple/dither.py
index 470d601..e40221e 100755
--- a/demos/py_simple/dither.py
+++ b/demos/py_simple/dither.py
@@ -15,7 +15,7 @@ def main():
# Use Floyd-Steinberg dithering
res = filters.FilterFloydSteinberg_RGB888_Alloc(img, core.C.PIXEL_G1, None)
# Save result into grayscale png
- loaders.SavePNG(res, "out.png", None)
+ res.loaders.SavePNG("out.png")
if __name__ == '__main__':
main()
http://repo.or.cz/w/gfxprim.git/commit/057139e9ba8617156f214005b143846b6110…
commit 057139e9ba8617156f214005b143846b6110f28d
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Apr 19 18:20:12 2013 +0200
pywrap: loaders: Add SaveXXX functions to submodule.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/pylib/gfxprim/loaders/__init__.py b/pylib/gfxprim/loaders/__init__.py
index 621099a..a9878fa 100644
--- a/pylib/gfxprim/loaders/__init__.py
+++ b/pylib/gfxprim/loaders/__init__.py
@@ -1,12 +1,10 @@
from . import c_loaders
-
def Load(filename, callback=None):
"Load image from given file, guessing the type."
c = c_loaders.GP_LoadImage(filename, callback)
return c
-
def _init(module):
"Extend Context with loaders submodule"
@@ -26,6 +24,30 @@ def _init(module):
Generally, not all pixel types work with all formats.
"""
c_loaders.GP_SaveImage(self.ctx, filename, callback)
+
+ @extend(LoadersSubmodule)
+ def SavePNG(self, filename, callback=None):
+ """Save the image as PNG.
+
+ Generally, not all pixel types work with all formats.
+ """
+ c_loaders.GP_SavePNG(self.ctx, filename, callback)
+
+ @extend(LoadersSubmodule)
+ def SaveJPG(self, filename, callback=None):
+ """Save the image as JPEG.
+
+ Generally, not all pixel types work with all formats.
+ """
+ c_loaders.GP_SaveJPG(self.ctx, filename, callback)
+
+ @extend(LoadersSubmodule)
+ def SaveBMP(self, filename, callback=None):
+ """Save the image as BMP.
+
+ Generally, not all pixel types work with all formats.
+ """
+ c_loaders.GP_SaveBMP(self.ctx, filename, callback)
# Imports from the SWIG module
import re
-----------------------------------------------------------------------
Summary of changes:
demos/py_simple/dither.py | 2 +-
doc/loaders_python.txt | 45 +++++++++++++++++++++++++++++++++++++
pylib/gfxprim/loaders/__init__.py | 26 +++++++++++++++++++-
3 files changed, 70 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 e596f127b5823f055be5adcca6670be1cfc8b410 (commit)
via 6dd81cb58fa89ccd2c06ff17f16c9e58f79c6769 (commit)
from 88e2e7b22ee4ece7ef3f2b8ae41cdeae8a66c4ac (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/e596f127b5823f055be5adcca6670be1cfc8…
commit e596f127b5823f055be5adcca6670be1cfc8b410
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Apr 12 17:24:31 2013 +0200
build: Update list of exported symbols.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/build/syms/Core_symbols.txt b/build/syms/Core_symbols.txt
index 0dfdb17..c04e144 100644
--- a/build/syms/Core_symbols.txt
+++ b/build/syms/Core_symbols.txt
@@ -1,4 +1,5 @@
GP_PixelTypes
+GP_PixelHasFlags
GP_ContextAlloc
GP_ContextResize
diff --git a/build/syms/Filters_symbols.txt b/build/syms/Filters_symbols.txt
index 8343ae0..f523674 100644
--- a/build/syms/Filters_symbols.txt
+++ b/build/syms/Filters_symbols.txt
@@ -76,8 +76,6 @@ GP_FilterHistogramAlloc
GP_FilterHistogram_Raw
GP_FilterInterpolate_Cubic
-GP_FilterInterpolate_LinearInt
-GP_FilterInterpolate_LinearLFInt
GP_FilterInvert
GP_FilterInvert_Raw
@@ -141,6 +139,14 @@ GP_FilterPoint_Raw
GP_FilterResize
GP_FilterResize_Raw
+GP_FilterResizeLinearInt
+GP_FilterResizeLinearIntAlloc
+GP_FilterResizeLinearInt_Raw
+
+GP_FilterResizeLinearLFInt
+GP_FilterResizeLinearLFIntAlloc
+GP_FilterResizeLinearLFInt_Raw
+
GP_FilterResizeCubicInt
GP_FilterResizeCubicIntAlloc
GP_FilterResizeCubicInt_Raw
http://repo.or.cz/w/gfxprim.git/commit/6dd81cb58fa89ccd2c06ff17f16c9e58f79c…
commit 6dd81cb58fa89ccd2c06ff17f16c9e58f79c6769
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Fri Apr 12 16:35:38 2013 +0200
all: Add mising GPL headers.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/include/core/GP_Blit.h b/include/core/GP_Blit.h
index cacfa8b..693d73b 100644
--- a/include/core/GP_Blit.h
+++ b/include/core/GP_Blit.h
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301 USA *
* *
* Copyright (C) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
- * Copyright (C) 2011,2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2011-2012 Cyril Hrubis <metan(a)ucw.cz> *
* *
*****************************************************************************/
diff --git a/include/core/GP_Convert.gen.h.t b/include/core/GP_Convert.gen.h.t
index 760eb74..4672708 100644
--- a/include/core/GP_Convert.gen.h.t
+++ b/include/core/GP_Convert.gen.h.t
@@ -1,8 +1,30 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
{% block descr %}Convert PixelType values macros and functions{% endblock %}
-
%% macro GP_Pixel_TYPE_TO_TYPE(pt1, pt2)
/*** {{ pt1.name }} -> {{ pt2.name }} ***
* macro reads p1 ({{ pt1.name }} at bit-offset o1)
diff --git a/include/core/GP_Convert_Scale.gen.h.t b/include/core/GP_Convert_Scale.gen.h.t
index a7dae41..db3373b 100644
--- a/include/core/GP_Convert_Scale.gen.h.t
+++ b/include/core/GP_Convert_Scale.gen.h.t
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * 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) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * Copyright (C) 2013 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
{% block descr %}Fast value scaling macros{% endblock %}
diff --git a/include/core/GP_FnPerBpp.gen.h.t b/include/core/GP_FnPerBpp.gen.h.t
index 13a1f84..a53fbd5 100644
--- a/include/core/GP_FnPerBpp.gen.h.t
+++ b/include/core/GP_FnPerBpp.gen.h.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends 'base.h.t'
{% block description %}All FnPerBpp macros{% endblock %}
diff --git a/include/core/GP_GammaCorrection.gen.h.t b/include/core/GP_GammaCorrection.gen.h.t
index b2d0b26..76df078 100644
--- a/include/core/GP_GammaCorrection.gen.h.t
+++ b/include/core/GP_GammaCorrection.gen.h.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
{% block descr %}Gamma corrections.{% endblock %}
diff --git a/include/core/GP_GammaPixel.gen.h.t b/include/core/GP_GammaPixel.gen.h.t
index 3c8f832..cefb5cc 100644
--- a/include/core/GP_GammaPixel.gen.h.t
+++ b/include/core/GP_GammaPixel.gen.h.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
{% block descr %}Gamma correction for pixels.{% endblock %}
diff --git a/include/core/GP_GetPutPixel.gen.h.t b/include/core/GP_GetPutPixel.gen.h.t
index f04ea33..46325db 100644
--- a/include/core/GP_GetPutPixel.gen.h.t
+++ b/include/core/GP_GetPutPixel.gen.h.t
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
%% block descr
diff --git a/include/core/GP_MixPixels.gen.h.t b/include/core/GP_MixPixels.gen.h.t
index 67fdf31..41e9c3a 100644
--- a/include/core/GP_MixPixels.gen.h.t
+++ b/include/core/GP_MixPixels.gen.h.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
%% block descr
diff --git a/include/core/GP_Pixel.gen.h.t b/include/core/GP_Pixel.gen.h.t
index a71c461..f0bddab 100644
--- a/include/core/GP_Pixel.gen.h.t
+++ b/include/core/GP_Pixel.gen.h.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.h.t"
%% block descr
diff --git a/libs/core/GP_Blit.gen.c.t b/libs/core/GP_Blit.gen.c.t
index 0216cfc..d743fc4 100644
--- a/libs/core/GP_Blit.gen.c.t
+++ b/libs/core/GP_Blit.gen.c.t
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * 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) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * Copyright (C) 2011-2013 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.c.t"
{% block descr %}Specialized blit functions and macros.{% endblock %}
diff --git a/libs/core/GP_Convert.gen.c.t b/libs/core/GP_Convert.gen.c.t
index 86560b5..ef004e4 100644
--- a/libs/core/GP_Convert.gen.c.t
+++ b/libs/core/GP_Convert.gen.c.t
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * 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) 2011 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * Copyright (C) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.c.t"
{% block descr %}Convert PixelType values macros and functions{% endblock %}
diff --git a/libs/core/GP_GammaCorrection.gen.c.t b/libs/core/GP_GammaCorrection.gen.c.t
index 4b1a23e..72883b2 100644
--- a/libs/core/GP_GammaCorrection.gen.c.t
+++ b/libs/core/GP_GammaCorrection.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.c.t"
{% block descr %}Gamma correction tables for Gamma = 2.2{% endblock %}
diff --git a/libs/core/GP_WritePixel.c b/libs/core/GP_WritePixel.c
index 0cd1cc7..e80d1e8 100644
--- a/libs/core/GP_WritePixel.c
+++ b/libs/core/GP_WritePixel.c
@@ -343,7 +343,6 @@ void GP_WritePixels_4BPP_BE(void *start, uint8_t off,
void GP_WritePixels_8BPP(void *start, size_t count, unsigned int value)
{
-
memset(start, value, count);
}
diff --git a/libs/filters/GP_Addition.gen.c.t b/libs/filters/GP_Addition.gen.c.t
index f89ebd4..fa58da6 100644
--- a/libs/filters/GP_Addition.gen.c.t
+++ b/libs/filters/GP_Addition.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.arithmetic.c.t"
%% block descr
diff --git a/libs/filters/GP_Brightness.gen.c.t b/libs/filters/GP_Brightness.gen.c.t
index 7db0fd5..2a02268 100644
--- a/libs/filters/GP_Brightness.gen.c.t
+++ b/libs/filters/GP_Brightness.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.point.c.t"
%% block descr
diff --git a/libs/filters/GP_Contrast.gen.c.t b/libs/filters/GP_Contrast.gen.c.t
index dda0b2d..c8dae6f 100644
--- a/libs/filters/GP_Contrast.gen.c.t
+++ b/libs/filters/GP_Contrast.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.point.c.t"
%% block descr
diff --git a/libs/filters/GP_Difference.gen.c.t b/libs/filters/GP_Difference.gen.c.t
index cf60b97..e6df21b 100644
--- a/libs/filters/GP_Difference.gen.c.t
+++ b/libs/filters/GP_Difference.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.arithmetic.c.t"
%% block descr
diff --git a/libs/filters/GP_HilbertPeano.gen.c.t b/libs/filters/GP_HilbertPeano.gen.c.t
index f718105..37a79d7 100644
--- a/libs/filters/GP_HilbertPeano.gen.c.t
+++ b/libs/filters/GP_HilbertPeano.gen.c.t
@@ -1,4 +1,3 @@
-
/*****************************************************************************
* This file is part of gfxprim library. *
* *
diff --git a/libs/filters/GP_Invert.gen.c.t b/libs/filters/GP_Invert.gen.c.t
index ed4ce98..ef9598e 100644
--- a/libs/filters/GP_Invert.gen.c.t
+++ b/libs/filters/GP_Invert.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.point.c.t"
%% block descr
diff --git a/libs/filters/GP_Max.gen.c.t b/libs/filters/GP_Max.gen.c.t
index 6e8813d..9cbd2b8 100644
--- a/libs/filters/GP_Max.gen.c.t
+++ b/libs/filters/GP_Max.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.arithmetic.c.t"
%% block descr
diff --git a/libs/filters/GP_Min.gen.c.t b/libs/filters/GP_Min.gen.c.t
index b27d303..99c5dd9 100644
--- a/libs/filters/GP_Min.gen.c.t
+++ b/libs/filters/GP_Min.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.arithmetic.c.t"
%% block descr
diff --git a/libs/filters/GP_Multiply.gen.c.t b/libs/filters/GP_Multiply.gen.c.t
index 3bfe7a3..01d33c3 100644
--- a/libs/filters/GP_Multiply.gen.c.t
+++ b/libs/filters/GP_Multiply.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.arithmetic.c.t"
%% block descr
diff --git a/libs/filters/GP_Noise.gen.c.t b/libs/filters/GP_Noise.gen.c.t
index 7afca65..e48d72c 100644
--- a/libs/filters/GP_Noise.gen.c.t
+++ b/libs/filters/GP_Noise.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.point.c.t"
{% block descr %}Noise filter -- Adds noise to an image.{% endblock %}
diff --git a/libs/filters/GP_Point.gen.c.t b/libs/filters/GP_Point.gen.c.t
index 1e9af26..74c96b2 100644
--- a/libs/filters/GP_Point.gen.c.t
+++ b/libs/filters/GP_Point.gen.c.t
@@ -1,3 +1,25 @@
+/*****************************************************************************
+ * 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) 2011 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "filter.point.c.t"
%% block descr
-----------------------------------------------------------------------
Summary of changes:
build/syms/Core_symbols.txt | 1 +
build/syms/Filters_symbols.txt | 10 ++++++++--
include/core/GP_Blit.h | 2 +-
include/core/GP_Convert.gen.h.t | 24 +++++++++++++++++++++++-
include/core/GP_Convert_Scale.gen.h.t | 23 +++++++++++++++++++++++
include/core/GP_FnPerBpp.gen.h.t | 22 ++++++++++++++++++++++
include/core/GP_GammaCorrection.gen.h.t | 22 ++++++++++++++++++++++
include/core/GP_GammaPixel.gen.h.t | 22 ++++++++++++++++++++++
include/core/GP_GetPutPixel.gen.h.t | 23 +++++++++++++++++++++++
include/core/GP_MixPixels.gen.h.t | 22 ++++++++++++++++++++++
include/core/GP_Pixel.gen.h.t | 22 ++++++++++++++++++++++
libs/core/GP_Blit.gen.c.t | 23 +++++++++++++++++++++++
libs/core/GP_Convert.gen.c.t | 23 +++++++++++++++++++++++
libs/core/GP_GammaCorrection.gen.c.t | 22 ++++++++++++++++++++++
libs/core/GP_WritePixel.c | 1 -
libs/filters/GP_Addition.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Brightness.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Contrast.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Difference.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_HilbertPeano.gen.c.t | 1 -
libs/filters/GP_Invert.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Max.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Min.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Multiply.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Noise.gen.c.t | 22 ++++++++++++++++++++++
libs/filters/GP_Point.gen.c.t | 22 ++++++++++++++++++++++
26 files changed, 477 insertions(+), 6 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 c5577daf85d4668a1599d1131d5539b56108e188 (commit)
via 40d5d39bf35b82553d101497238393b04f86f55e (commit)
from f9ab072d9aeefcd9888506fe0a9f30757c9e9a76 (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/c5577daf85d4668a1599d1131d5539b56108…
commit c5577daf85d4668a1599d1131d5539b56108e188
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Apr 11 16:38:50 2013 +0200
core: Add GP_PixelHasFlags() + tests.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/include/core/GP_Pixel.h b/include/core/GP_Pixel.h
index a60707f..ff2d710 100644
--- a/include/core/GP_Pixel.h
+++ b/include/core/GP_Pixel.h
@@ -91,6 +91,16 @@ typedef struct GP_PixelTypeChannel {
#define GP_PIXELTYPE_MAX_CHANNELS 8
/*
+ * Pixel type flags for various pixel properties.
+ */
+typedef enum GP_PixelFlags {
+ GP_PIXEL_HAS_ALPHA = 0x01,
+ GP_PIXEL_IS_RGB = 0x02,
+ GP_PIXEL_IS_PALETTE = 0x04,
+ GP_PIXEL_IS_GRAYSCALE = 0x10,
+} GP_PixelFlags;
+
+/*
* Description of one PixelType
* Assumes name with at most 15 chars
* Assumes at most 8 channels
@@ -101,6 +111,7 @@ typedef struct GP_PixelTypeDescription {
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 */
@@ -187,9 +198,13 @@ GP_PixelType GP_PixelRGBLookup(uint32_t rsize, uint32_t roff,
uint8_t bits_per_pixel);
/*
- * Function to determine pixel attributes.
+ * Functions to determine pixel attributes.
+ *
+ * Call as:
+ *
+ * if (GP_PixelHasFlags(pixel_type, GP_PIXEL_IS_RGB | GP_PIXEL_HAS_ALPHA))
+ * ...
*/
-int GP_PixelHasAlpha(GP_PixelType pixel_type);
-
+int GP_PixelHasFlags(GP_PixelType pixel_type, GP_PixelFlags flags);
#endif /* CORE_GP_PIXEL_H */
diff --git a/libs/core/GP_Pixel.c b/libs/core/GP_Pixel.c
index b1ccad5..a210892 100644
--- a/libs/core/GP_Pixel.c
+++ b/libs/core/GP_Pixel.c
@@ -163,15 +163,9 @@ GP_PixelType GP_PixelRGBLookup(uint32_t rsize, uint32_t roff,
return GP_PIXEL_UNKNOWN;
}
-int GP_PixelHasAlpha(GP_PixelType pixel_type)
+int GP_PixelHasFlags(GP_PixelType pixel_type, GP_PixelFlags flags)
{
- unsigned int i;
-
- GP_CHECK_VALID_PIXELTYPE(pixel_type);
-
- for (i = 0; i < GP_PixelTypes[pixel_type].numchannels; i++)
- if (!strcmp(GP_PixelTypes[pixel_type].channels[i].name, "A"))
- return 1;
+ GP_PixelFlags my_flags = GP_PixelTypes[pixel_type].flags;
- return 0;
+ return flags == (my_flags & flags);
}
diff --git a/libs/core/GP_Pixel.gen.c.t b/libs/core/GP_Pixel.gen.c.t
index 8374856..7fad071 100644
--- a/libs/core/GP_Pixel.gen.c.t
+++ b/libs/core/GP_Pixel.gen.c.t
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * 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) 2011-2012 Tomas Gavenciak <gavento(a)ucw.cz> *
+ * Copyright (C) 2011-2013 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
%% extends "base.c.t"
%% block descr
@@ -9,6 +32,13 @@ Pixel type definitions and functions
#include "GP_Pixel.h"
#include "GP_GetSetBits.h"
+%%- macro getflags(pt)
+{% if pt.is_alpha() %} | GP_PIXEL_HAS_ALPHA{% endif -%}
+{% if pt.is_rgb() %} | GP_PIXEL_IS_RGB{% endif -%}
+{% if pt.is_palette() %} | GP_PIXEL_IS_PALETTE{% endif -%}
+{% if pt.is_gray() %} | GP_PIXEL_IS_GRAYSCALE{% endif -%}
+%%- endmacro
+
/*
* Description of all known pixel types
*/
@@ -21,6 +51,7 @@ const GP_PixelTypeDescription const GP_PixelTypes [GP_PIXEL_MAX] = {
.bit_endian = {{ pt.pixelsize.bit_endian_const }},
.numchannels = {{ len(pt.chanslist) }},
.bitmap = "{{ pt.bits|join("") }}",
+ .flags = 0{{ getflags(pt) }},
.channels = {
%% for c in pt.chanslist
{ .name = "{{ c[0] }}", .offset = {{ c[1] }}, .size = {{ c[2] }} },
diff --git a/tests/core/Makefile b/tests/core/Makefile
index 91185c2..757416b 100644
--- a/tests/core/Makefile
+++ b/tests/core/Makefile
@@ -2,11 +2,11 @@ TOPDIR=../..
include $(TOPDIR)/pre.mk
-CSOURCES=Context.c
+CSOURCES=Context.c Pixel.c
GENSOURCES+=WritePixel_testsuite.gen.c GetPutPixel.gen.c
-APPS=WritePixel_testsuite.gen Context GetPutPixel.gen
+APPS=WritePixel_testsuite.gen Pixel Context GetPutPixel.gen
include ../tests.mk
diff --git a/tests/core/Pixel.c b/tests/core/Pixel.c
new file mode 100644
index 0000000..e334a16
--- /dev/null
+++ b/tests/core/Pixel.c
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * 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> *
+ * *
+ *****************************************************************************/
+
+/*
+
+ Very basic GP_Pixel tests.
+
+ */
+#include <errno.h>
+
+#include <core/GP_Pixel.h>
+
+#include "tst_test.h"
+
+static int pixel_flags(void)
+{
+ int fail = 0;
+
+ if (!GP_PixelHasFlags(GP_PIXEL_RGB888, GP_PIXEL_IS_RGB)) {
+ tst_msg("RGB888 is RGB failed");
+ fail++;
+ }
+
+ if (GP_PixelHasFlags(GP_PIXEL_G1, GP_PIXEL_IS_RGB)) {
+ tst_msg("G1 is RGB succeeded");
+ fail++;
+ }
+
+ if (!GP_PixelHasFlags(GP_PIXEL_RGBA8888, GP_PIXEL_HAS_ALPHA)) {
+ tst_msg("RGBA8888 has Alpha failed");
+ fail++;
+ }
+
+ if (!GP_PixelHasFlags(GP_PIXEL_RGBA8888,
+ GP_PIXEL_HAS_ALPHA | GP_PIXEL_IS_RGB)) {
+ tst_msg("RGBA8888 has Alpha and is RGB failed");
+ fail++;
+ }
+
+ if (fail)
+ return TST_FAILED;
+
+ return TST_SUCCESS;
+}
+
+const struct tst_suite tst_suite = {
+ .suite_name = "Pixel Testsuite",
+ .tests = {
+ {.name = "Pixel Flags",
+ .tst_fn = pixel_flags},
+ {.name = NULL},
+ }
+};
diff --git a/tests/core/test_list.txt b/tests/core/test_list.txt
index 458f6e4..c4f6bb7 100644
--- a/tests/core/test_list.txt
+++ b/tests/core/test_list.txt
@@ -1,4 +1,5 @@
# Core testsuite
WritePixel_testsuite.gen
Context
+Pixel
GetPutPixel.gen
http://repo.or.cz/w/gfxprim.git/commit/40d5d39bf35b82553d101497238393b04f86…
commit 40d5d39bf35b82553d101497238393b04f86f55e
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Apr 11 14:24:26 2013 +0200
doc: compilation: Add instructions for debian.
Thanks Milan Vancura for the list.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/compilation.txt b/doc/compilation.txt
index 741b878..cb025e0 100644
--- a/doc/compilation.txt
+++ b/doc/compilation.txt
@@ -66,7 +66,7 @@ into your system. Python bindings are not installable at the moment.
OpenSUSE
~~~~~~~~
-Here are commands to install required packages on
+Instruction to install required packages on
link:http://www.opensuse.org/[OpenSUSE].
.Install basic tools
@@ -100,3 +100,39 @@ zypper in gcc make python-Jinja2 libjpeg-devel libpng-devel giflib-devel
freetype-devel libX11-devel libXext-devel swig python-devel
-------------------------------------------------------------------------------
+Debian
+~~~~~~
+
+Instruction to install required packages on link:http://www.debian.org[Debian]
+and other debian based distributions.
+
+.Install basic tools
+-------------------------------------------------------------------------------
+apt-get install gcc make python-jinja2
+-------------------------------------------------------------------------------
+
+.Install jpeg and png devel libraries
+-------------------------------------------------------------------------------
+apt-get install libjpeg-dev libpng-dev libgif-dev
+-------------------------------------------------------------------------------
+
+.Install FreeType devel library
+-------------------------------------------------------------------------------
+apt-get install libfreetype6-dev
+-------------------------------------------------------------------------------
+
+.Install X11 devel library
+-------------------------------------------------------------------------------
+apt-get install libx11-dev libxext-dev
+-------------------------------------------------------------------------------
+
+.Install swig
+-------------------------------------------------------------------------------
+apt-get install swig python-dev
+-------------------------------------------------------------------------------
+
+.All in the one for the lazy
+-------------------------------------------------------------------------------
+apt-get install gcc make python-jinja2 libjpeg-dev libpng-dev libgif-dev
+ libfreetype6-dev libx11-dev libxext-dev swig python-dev
+-------------------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
doc/compilation.txt | 38 ++++++++++++++-
include/core/GP_Pixel.h | 21 +++++++-
libs/core/GP_Pixel.c | 12 +---
libs/core/GP_Pixel.gen.c.t | 31 ++++++++++++
tests/core/Makefile | 4 +-
tests/{drivers/linux_input.c => core/Pixel.c} | 66 ++++++++++++++-----------
tests/core/test_list.txt | 1 +
7 files changed, 129 insertions(+), 44 deletions(-)
copy tests/{drivers/linux_input.c => core/Pixel.c} (66%)
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 feff7abe0be63662f56d82aa080f3c7c8be9d194 (commit)
via 5e0e6305889ab3f26302bf5c2b31aa83d0a1ec45 (commit)
from 59b7db7636f17da18520d71c091dd9c23694ea91 (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/feff7abe0be63662f56d82aa080f3c7c8be9…
commit feff7abe0be63662f56d82aa080f3c7c8be9d194
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Apr 9 15:09:43 2013 +0200
gfx: Ellipse: Fix special case for a == 0 || b == 0
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/gfx/algo/Ellipse.algo.h b/libs/gfx/algo/Ellipse.algo.h
index f10fbb0..a964e86 100644
--- a/libs/gfx/algo/Ellipse.algo.h
+++ b/libs/gfx/algo/Ellipse.algo.h
@@ -19,7 +19,7 @@
* Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
* <jiri.bluebear.dluhos(a)gmail.com> *
* *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2009-2013 Cyril Hrubis <metan(a)ucw.cz> *
* *
*****************************************************************************/
@@ -80,6 +80,19 @@ static void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, int b2 = b*b; int x, y, error; ++ if (a == 0) { + for (y = -b; y <= (int)b; y++) + PUTPIXEL(context, xcenter, ycenter + y, pixval); + return; + } ++ if (b == 0) { + for (x = -a; x <= (int)a; x++) + PUTPIXEL(context, xcenter + x, ycenter, pixval); + return; + } + for (x = 0, error = -b2*a, y = b; y >= 0; y--) { while (error < 0) {
http://repo.or.cz/w/gfxprim.git/commit/5e0e6305889ab3f26302bf5c2b31aa83d0a1…
commit 5e0e6305889ab3f26302bf5c2b31aa83d0a1ec45
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Apr 9 14:47:26 2013 +0200
core: WritePixel: Fix 24 BPP with count == 0.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/core/GP_WritePixel.c b/libs/core/GP_WritePixel.c
index 916f9ef..0cd1cc7 100644
--- a/libs/core/GP_WritePixel.c
+++ b/libs/core/GP_WritePixel.c
@@ -376,6 +376,9 @@ void GP_WritePixels_24BPP(void *start, size_t count, unsigned int value)
{
uint8_t *bytep = (uint8_t *) start;
+ if (count == 0)
+ return;
+
/* How much bytes we are offset against the 32-bit boundary. */
int shift = ((intptr_t) bytep) % 4;
-----------------------------------------------------------------------
Summary of changes:
libs/core/GP_WritePixel.c | 3 +++
libs/gfx/algo/Ellipse.algo.h | 15 ++++++++++++++-
2 files changed, 17 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.")