Gfxprim
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- 929 discussions
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 acc0e486f8637754ffdc19b5c0bd463d1317841d (commit)
from 2a5a7b89fa7ccb27b25011cc0d1c7456832db0b0 (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/acc0e486f8637754ffdc19b5c0bd463d1317…
commit acc0e486f8637754ffdc19b5c0bd463d1317841d
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Dec 28 23:40:22 2013 +0100
pywrap: core: Add ToByteArray() context method.
This allows us to pass the context pixel data to various python
libraries (such as PySide).
The downside is that data are being coiped to newly allocated ByteArray.
I would love to see a native buffer implementation for GP_Context
however I doubt that we can easily fill out the PyTypeObject field
tp_as_buffer in swig without doing unspeakable things.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py
index 00bba2a..96bf9be 100644
--- a/pylib/gfxprim/core/__init__.py
+++ b/pylib/gfxprim/core/__init__.py
@@ -99,6 +99,12 @@ def _init(module):
See GP_ContextConvertAlloc() for details."""
return c_core.GP_ContextConvertAlloc(self, pixeltype_no(target_type))
+ @extend(_context)
+ def ToByteArray(self):
+ """Returns new Python ByteArray created from context pixels. The
+ array size is exactly context.bytes_per_row * context.h"""
+ return c_core.GP_ContextToByteArray(self)
+
# Manipulation
extend_direct(_context, "PutPixel", c_core.GP_PutPixel,
diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i
index 88f9450..59b17e8 100644
--- a/pylib/gfxprim/core/core.i
+++ b/pylib/gfxprim/core/core.i
@@ -70,6 +70,13 @@ const GP_PixelTypeDescription *GP_PixelTypes_access(GP_PixelType no)
%rename("_%s") "GP_Context::bit_endian";
%rename("_%s") "GP_Context::free_pixels";
+%inline %{
+PyObject *GP_ContextToByteArray(GP_Context *self)
+{
+ return PyByteArray_FromStringAndSize((char*)self->pixels,
+ self->bytes_per_row * self->h);
+}
+%}
%feature("autodoc", "Proxy of C GP_Context struct
-----------------------------------------------------------------------
Summary of changes:
pylib/gfxprim/core/__init__.py | 6 ++++++
pylib/gfxprim/core/core.i | 7 +++++++
2 files changed, 13 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.")
1
0
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 annotated tag, 1.0.0-rc1 has been created
at ad12ab4eee7164c973a0648eea94272953ff423a (tag)
tagging 2a5a7b89fa7ccb27b25011cc0d1c7456832db0b0 (commit)
replaces 1.0.0-rc0
tagged by Cyril Hrubis
on Tue Dec 24 20:38:48 2013 +0100
- Log -----------------------------------------------------------------
GFXprim 1.0.0-rc1
Cyril Hrubis (331):
install: Add bindir, libdir and includedir configure opts.
loaders: gif: Fix build with giflib > 5.0.0
install: Fix symlink creation.
build: Update list of exported syms.
doc: Update index.html (as we have release).
build: pywrap: Reorder LDLIBS for pywrap too.
install: Fix make install for empty prefix.
doc: Update index.html
loaders: PNG: Fix Adam7 interlacing handling.
tests: gfx: Add FillEllipse testsuite.
gfx: FillCircle: Add GPL header, sort out includes.
gfx: Move FillEllipse to template, fix special case.
tests: gfx: Fix Line testsuite.
tests: PNG: Add testcase for Adam7 interlacing.
gfx: Remove commented out FillCircle from Circle.c
gfx: Remove unused Line.algo.h, fix copyrights.
configure: Use Popen instead of check_output
filters; Ditherings: Make list of output fmts explicit.
core: Add initial support for CMYK8888.
loaders: JPG: Add support for loading CMYK images.
test: core: Add Blit Conversions tests.
core: Common: Add MAX3(a, b, c) macro.
codegen: Propagate min, max to templating engine.
core: Convert: Add experimental RGB -> CMYK.
tests: core: Cleanup BlitConv.
core: Convert: Fix XXX -> XXXA conversion.
tests: core: More tests in BlitConv.
spiv: Update help and keys help.
gp_codegen: pixeltype.py: Edhance channel list members.
tests: core: New test for pixel conversions.
core: GP_Convert: Make it more readable.
tests: core: Convert.gen.c: Add more cases.
tests: core: Add test for Convert_Scale operations
spiv: Add image actions.
spiv: Cleanup the progress callback.
spiv: Cleanup and update help.
core: Convert_Scale: Limit conversions to 16 bits.
tests: core: Convert: Comment out gray in tests.
core: Convert: Fix rounding error on CMYK to RGB.
core: Convert: Fix swig syntax error.
tests: core: Convert: Remove the gray code.
spiv: Move help to separate source file.
input, backends: Add EventPeek and EventPushBack.
doc: Update and fix GP_EventQueue docs.
doc: Update backends docs.
pywrap: backends: Add PeekEvent and PutEventBack.
spiv: Add scrolling to help.
spiv: Add new zoom type.
core: GP_Pixel.gen.h.t: Add #define GP_PIXEL_foo
gfxprim_config.py: Add RGB555.
loaders: BMP: Add support for RGB555.
loaders: BMP: Add support for BITFIELDS formats.
core: Remove now unused GP_WritePixel.gen.c.t
loaders: BMP: Fix progress callback percentage.
loaders: BMP: Initial code for RLE8.
pywrap: Remove silence_swig_warnings.mk
templates: Fix description block id, add description
pylib: Add custom comment filter and use it descr
build: Update list of exported symbols.
core: Cleanup the GP_Pixel(SN)Print functions.
pylib: Propagate floor() and ceil() to templates.
tests: core: Add GetSetBits test.
core: Fix warning on GP_GET_BITS(0, 32, val).
demos: c_simple: Add pretty print example.
doc: Update pixels docs.
doc: Update core docs.
doc: general: Update BMP implementation state.
backends: Linux FB: Fix div by zero.
demos: c_simple: blittest: Correct caption.
build: check_symbols: Add loaders.
demos: c_simple: blittest: Add check.
lib: loaders: Rewrite PNM loaders.
tests: loaders: First simple PBM tests.
loaders: Add forgotten PNM header.
tests: loaders: PBM, PGM, PPM, more tests.
loaders: PNM: Fix a few issues found by tests.
loaders: PNM: Implemented GP_SavePPM, GP_SavePNM
loaders: PBM: Add support for Rawbits PBM + tests.
tests: core: Fix copy & paste error in name.
libs: loaders: GP_Loader.c: Cleanup.
doc: loaders, environment_variables: Update.
input: Add timers and timer priority queues.
input: Add GP_GetTimeStamp() function.
backends: Add support for timers to backends.
build: Update list of exported symbols.
spiv: Get rid of the ugly slideshow code, use timers!
doc: input: Add GP_Timer and GP_TimeStamp docs.
doc: backends: Add GP_BackendAddTimer() docs.
tests: input: Add timers testsuite.
tests: input: Simple test for TimeStamp.
tests: runtest.py: Print name of tests directory.
Remove traling whitespaces.
tests: filters: Add common.o to CLEAN.
core: Straigten up the blit code a bit.
demose: Remove tralling whitespaces too.
input: timers: Fix well_balaced().
doc: Remove trailing whitespaces.
input: timers: Implement remove + docs.
backends: Add GP_BackendTimersInQueue() + docs.
libs: backends: BackendWait() fix.
spiv: Initialize sleep_ms correctly.
backends: X11: Hotfix for Wait().
loaders: TIFF: Write loader for basic types.
loaders: TIFF: Add saving support.
loaders: TIFF: A few fixes.
Remove a duplicity in the help message
doc: compilation: Add libtiff to additional deps
loaders: ByteUtils: Correct comments in header.
loaders: Add image containers + ZIP container.
core: Fix typon in GP_Threads.h
spiv: Small cleanup.
build: Make distclean remove possible leftovers.
loaders: PNM: Add support for binary G8.
loaders: pnm: Avoid fgetc() in inner loops.
spiv: Map the actions better to the F keys.
libs: EventQueue: Zero keypress bitflags on init.
spiv: Large scale cleanup.
loaders: JPG: Fix signature matching.
loaders: TIFF: Mark internal funcitons static.
demos: spiv: Two fixes.
loaders: Containers, ZIP: More work done.
build: Update list of exported symbols.
spiv: A bit crude support for containers.
spiv: Stop loader thread before the seek in timer
examples, doc: Add backend timers example.
doc: Update general information.
pywrap: loaders: Add a new methods.
doc: loaders_python: Update.
loaders: PNG: Change the ReadPNG() and OpenPNG
container: ZIP: Add support for loading PNG.
backends: Improve Linux FB backend.
demos: c_simple, particle: Add -b (backend) option
backends: Add basic AALib backend.
demos: Add backend resize ack to few demos
input: KBD: Add mapping for few keys.
backends: SDL: Avoid lockup in Wait.
core: GP_Common.h: Add stddef.h due to offsetof().
input: KBD: Remove newline from debug message.
filters: GP_ResizeLinear.gen.c.t: Remove debug print
spiv: Disable timers by default.
build: Update list of backend symbols.
backends: Rename GP_ContextFromSurface()
doc: Update backends docs.
Blit: Debug print now logs src and dst pixel type.
loaders: JPG: Don't convert RGB to BGR by default.
backends: BackendInit: Add SDL bpp param.
loaders: ZIP: Fix errno vs err typo.
loaders: Experimental JPEG 2000 support.
loaders: TmpFile: Fix potentionaly unitialized err
core: Pixel: Fix the double const warning.
pywrap: loaders: Add LoadJP2()
doc: Add LoadJP2() docs.
filters: Templatize linear convolutions.
loaders: JP2: Add missing stub.
build: Update Loaders symbols (Add JP2 funcs)
filters: Cleanup Resize filters + docs.
filters: Resize: Two fixes.
spiv: Skip number of images in dir if not in dir
pywrap: filters: Update filters wrappings.
filters: ResizeCubicFloat: Set errno.
loaders: JPG: Fix cinfo init for GP_SaveJPG()
loaders: BMP: Implement BGR888 Save.
backends: Linux FB: Fix error codepath.
loaders: ZIP: Silence unused warning.
backends: Linux FB: Declare local function as static.
loaders: Add LineConvert.
build: Makefile: include config.mk
tests: framework: Use $(CC) instead of gcc
tests: core: GetPutPixel: Fix warnings.
core: GP_Pixel: Fix segfault.
loaders: ZIP: Load PNG images from stored records
libs: text: Small enhancements for default monospace font.
text: fonts: Add C64 like monospace font.
test: loaders: Fix whitespaces.
tests: loaders: New SaveLoad test.
loaders: TIFF: Handle correctly on unsuppored pixeltypes.
loaders: LineConvert: Add more conversions.
loaders: PNM: Make use of LineConvert.
loaders: PNM: Fix SavePBM.
tests: loaders: Add simple pixelcheck to save_load.
loaders: BMP, JPG: Simplify LineConvert usage.
tests: framework: Fix whitespaces.
test: framework: malloc check: Add realloc()
filters: ditherings: Cleanups.
doc: Update dithering docs.
build: Update list of Text symbols.
build: Cleanup check_symbols.sh, add Gamma syms.
render_utils.py: Add ./ to jinja2 template paths.
tests: loaders: New SaveAbort test.
loaders: BMP, PNM, TIFF: Fix abort path.
build: pywrap: Add deps on common.i into pywrap.mk
pywrap: Add default typemap for callback=NULL
demos: py_simple: Drop None callback parameters.
filters: Linear: Run one thread on in-place filter
filters: Convolution; Minor cleanup.
filters: Blur: Hotfix the GaussianBlurAlloc() case
doc: Work on python filter docs (add GaussianBlur)
doc: filters: Rewrite the example image generator
doc: filters: Further example generator changes
doc: filters: Generate Gaussian noise example imgs
doc: filters: regen.py: Add names to the filter params.
build: config.mk: Fix python-config switch
core: Move GP_Fill to core.
spiv: Two fixes for the slideshow timer.
loaders; BMP_RLE: Whitespace cleanup.
loaders: BMP: Make use of GP_Fill.
backends: Add GP_BackendRemTimer()
spiv: Key S now can stop and restart slideshow.
core: include: Whitespace fixes.
filters; Blur: Fix 'assigment discards 'const' warning'.
filters: Add missing header for edge detection filters.
gen: Rename pixeltype.C_enum to pixeltype.C_type
configure: Fix _FORTIFY_SOURCE redefinition.
tests: filters: Implement compare tests.
tests: filters: Better API Converage test.
filters: GaussianNoise: Set errno.
filters: ResizeCubicInt: Set errno.
tests: filters: Fix filters compare.
backends: X11: Avoid warning on GravityNotify
filters: GaussianNoise: Set errno.
text: Add va_list variant for GP_Print()
spiv: Another cleanup.
doc: Add AALib to supported backend in general info.
spiv: Rewrite configuration, add config file.
filters: ditherings: Enable all pixel types.
spiv: Add forgotten -e config opt
backends: Implement ResizeAck() for virtual backend.
spiv: image_loader: Drop cur_img before dropping cache.
doc: Update general information.
build: Update list of exported symbols.
build: Add check make target.
doc: Redo the pages style, new logo, etc.
tests: Makefile: Fix parallel build.
pywrap: text: Do not wrap GP_Print and GP_VPrint
build: Add --mandir to configure and install.mk
gp_codegen: Add idx to channel.
doc: Finish logo and favicon.
doc: Cleanup loaders docs a bit.
filters: Reimplement point filters.
loaders: PNM: Fix aligment issues in save_ascii_rgb888
loaders: PNM: Optimize Save()
tests: Filters: Add point filters.
filters: Ditherings: Set errno and fix abort.
filters: Clear free_table flag on GP_FilterTablesInit()
filters: Add two point filters.
doc: Update/Add point filters docs.
filters: GP_Rotate.c: Fix whitespaces.
filters: Swap GP_MirrorH() and GP_MirrorV()
filters: Rotate: Remove _Raw prototypes from header.
filters: Rotate: Remove the _Raw variants from API.
filters: Remove unused GP_Noise.gen.c.t and GP_Point.gen.c.t
build: Update list of filter exported symbols.
doc: filters_python: Add rotation and symmetry filters.
pywrap: Add wrapping around Convolution kernel
doc: Add Convolution examples to image generator.
doc: Update/Add convolution docs.
doc: Update the about page.
doc: Fix typos.
pywrap: core: Add Convert to module.
gfxprim_config.py: Add RGB332 8BPP.
doc: Update dithering documentation.
spiv: Add zoom modes.
test: gfx: Add test for FillRect.
gfx: GP_FillRect: Check y coords for context intersection.
backends: X11: Fix window size passed to event parser.
backends: X11: Cleanup + Fullscreen fixes
backends: X11: Warn if _NET_WM_STATE is not supported.
backends: X11: Avoid dereferencing closed window
backends: X11: Flush connection when window was closed.
filters: point: Remove the FilterArea.
pywrap: core: Remove/ignore a few functions.
backends: X11: Ignore Win Resize request in FullScreen
backends: X11: Fix memleak.
tests: framework: Finish and rename malloc barriers
tests: core: Add BlitClipped() tests.
tests: core: A few more Blit Clipped tests.
core: BlitClipped: Fix two special cases.
loaders: TIFF: Fix warnings.
tests: framework: Makefile: Fix LDLIBS.
core, loaders: Move endian include to core.
loaders: PNG: Add support for 16 bit Grayscale.
examples: py_simple: Remove pygtk_example
pywrap: filters: Add weighted median (disabled for now)
tests: FillRect: A few more testcases.
tests: Fix whitespaces.
tests: framework: Add TST_MALLOC_CANARIES flag.
tests: loaders: Enable malloc canaries for SaveLoad
loaders: PNM: Fix save_ascii_rgb888
spiv: Fix action index in image_action_run().
spiv: Fix help for arrow keys.
tests: loaders: Add basic test for ZIP container.
loaders: ZIP: Fix memory leak in deflate decompression
tests: loaders: ZIP: Two more testcases.
loaders: ZIP: Fix loading from mixed content zips
build: Fix configure && install.
doc: Autogenerate table of all examples + cleanup.
doc: Remove unused pixel_types.txt.
doc: Add C core documentation page + cleanup.
doc: Remove generated file examples.txt from index
pywrap: Add swig typemap for GP_ProgressCallback
doc: Add a better favicon and fix <title>
backends: X11: Don't use SHM for remote X11.
pywrap: Enable default NULL callback typemap.
pywrap: Progress callback proxy check for Py_None.
doc: Fix typos in GP_TempAlloc() documentation.
filters: Initial MultiTone and Sepia filters.
backends: X11: Fix window bitmap buffer init
spiv: Fix image cache limits.
input: TimeStamp: Fallback to CLOCK_MONOTOMIC if available
demos: spiv: Fix typo in spiv help.
tests: input: Fix and enable TimeStamp tests.
spiv: cfg: Two fixes.
doc: Add two more examples.
doc: text: Fix API docs.
demos: c_simple: Remove abort.c
libs: backend: Set timer event timestamp correctly
loaders: PNG: Enable save for RBGA8888
spiv: Print backend help if only '-b help' was passed
demos: Fix and cleanup GP_BackendInit() + docs.
doc: Add RGB tripplet to pixel conversion docs.
doc: Add screenshot to spiv page.
tst_preload: Fix realloc(NULL, size) case.
test: Two fixes for malloc canaries.
tests: PNG: Add RGBA8888 save test.
tests: Generate html report by default.
build: check_symbols: Fix bashishm
debian: Add graphviz dependency
spiv: Add man page.
build: Change library names GP -> gfxprim
demos: c_simple: Small cleanup.
GFXprim 1.0.0-rc1
Petr Baudis (2):
Add initial debian packaging info
debian/spiv.manpages: +spiv.1
-----------------------------------------------------------------------
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.")
1
0
24 Dec '13
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 2a5a7b89fa7ccb27b25011cc0d1c7456832db0b0 (commit)
via b8d50356877fa333d66f8c1b1383d66ab1e75b27 (commit)
via e27171add7b10d809d604f695d2f9a07f7b178b4 (commit)
from f8594e7a88faed4ad18a511ce7e814963dbc50e9 (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/2a5a7b89fa7ccb27b25011cc0d1c7456832d…
commit 2a5a7b89fa7ccb27b25011cc0d1c7456832db0b0
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 24 15:47:50 2013 +0100
GFXprim 1.0.0-rc1
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/Makefile b/doc/Makefile
index 2b0721b..05ae191 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,7 +5,7 @@ SOURCES=index.html about.txt context.txt loaders.txt filters.txt get_put_pixel.txt blits.txt progress_callback.txt text.txt event_queue.txt compilation.txt filters_resize.txt filters_dithering.txt filters_python.txt spiv.txt core_common.txt - convert.txt
+ convert.txt news_1_0_0-rc1.txt
SOURCES+=core_python.txt gfx_python.txt loaders_python.txt backends_python.txt
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
index 1191a13..4cca66e 100644
--- a/doc/asciidoc.conf
+++ b/doc/asciidoc.conf
@@ -77,7 +77,7 @@ ifdef::toc2[<link rel="stylesheet" href="{stylesdir=.}/toc2.css" type="text/css"
</div>
<div> </div>
<div id="footer">
- Current release is <em>1.0.0-rc0</em>.
+ Current release is <em>1.0.0-rc1</em>.
</div>
</div>
</div>
diff --git a/doc/index.txt b/doc/index.txt
index 4c3dff5..cb3302b 100644
--- a/doc/index.txt
+++ b/doc/index.txt
@@ -40,8 +40,22 @@ https://github.com/gfxprim/gfxprim/issues[issue tracker].
News
----
-The GFXprim version 1.0.0-rc0 has been released!
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The GFXprim 1.0.0-rc1 has been released!
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+See what is link:news_1_0_0-rc1.html[new].
+
+Download the
+http://gfxprim.ucw.cz/releases/gfxprim_1.0.0-rc1.tar.bz2[1.0.0-rc1] tarball (without docs).
+
+Get rpm packages (for RedHat and SUSE) from
+https://build.opensuse.org/package/show/home:metan/gfxprim[buildservice].
+
+Or download prebuild Debian
+http://gfxprim.ucw.cz/packages/debian/wheezy/[amd64 Wheezy packages].
+
+The GFXprim 1.0.0-rc1 has been released!
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Download
http://gfxprim.ucw.cz/releases/gfxprim_1.0.0-rc0.tar.bz2[1.0.0-rc0] tarball (without docs).
diff --git a/doc/news_1_0_0-rc1.txt b/doc/news_1_0_0-rc1.txt
new file mode 100644
index 0000000..f07240b
--- /dev/null
+++ b/doc/news_1_0_0-rc1.txt
@@ -0,0 +1,74 @@
+News for 1.0.0-rc1
+------------------
+
+General changes
+~~~~~~~~~~~~~~~
+
+* 333 patches since 1.0.0-rc0
+* Plenty of bugfixes
+* New pages and nearly finished documentation
+* More automatic testcases
+* Initial debian packaging
+ (thanks to Petr Baudis)
+
+Core
+~~~~
+
+* Added support for CMYK and 16 bit Grayscale bitmaps
+
+Loaders
+~~~~~~~
+
+* LineConvert was written for automatic conversions of pixel types
+ with exacly same channels but different orgaization
+ (such as between RGB888, BGR888 and xRGB888).
+* BMP loader gained support for less common formats such as RGB555, RLE8
+* PNM loaders were rewritten from scratch
+* PNG loader gained support for 16 bit Grayscale
+
+New loaders
+^^^^^^^^^^^
+* TIFF loader and saver
+* JPEG 2000 loader
+* CBZ loader (more general ZIP container)
+
+Filters
+~~~~~~~
+
+* Most of the filters are now templatized and build for all configured pixel
+types.
+* Point filters were reimplemented to be simpler, more generic and faster.
+
+Backends
+~~~~~~~~
+
+* Backends now support link:backends.html#Timers[timers]
+* X11 and SDL video backends are now thread safe and deadlock free (hopefully)
+* Linux framebuffer backend was improved
+* Basic AALib backend was written (which is not much usefull but it brings
+ warm memories).
+
+Python bindings
+~~~~~~~~~~~~~~~
+
+* Python bindings were updated and polished
+* Python arrays are converted to C arrays before passing to filters
+ (for example when passed as a convolution kernel)
+* All functions with callback parameter can now pass
+ link:core_python.html#Progress_Callback[python function]
+ as a callback
+* Documentation and examples were greatly improved
+
+spiv
+~~~~
+
+The image viewer build on the top of the library has became full featured
+application. The user interface is still a bit clunky (you can help to make it
+better too) but apart from that it's fast and stable now.
+
+Among other things following was added:
+
+- feh like actions
+- a man page
+- different zoom and window modes
+- configuration file
diff --git a/include/core/GP_Version.h b/include/core/GP_Version.h
index cb7c944..110e18c 100644
--- a/include/core/GP_Version.h
+++ b/include/core/GP_Version.h
@@ -38,6 +38,6 @@
#define GP_VER_STR GP_STRX(GP_VER_MAJOR) "." GP_STRX(GP_VER_MINOR) "." - GP_STRX(GP_VER_MICRO) "-rc0"
+ GP_STRX(GP_VER_MICRO) "-rc1"
#endif /* CORE_GP_VERSION_H */
http://repo.or.cz/w/gfxprim.git/commit/b8d50356877fa333d66f8c1b1383d66ab1e7…
commit b8d50356877fa333d66f8c1b1383d66ab1e75b27
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 24 16:12:09 2013 +0100
demos: c_simple: Small cleanup.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/c_simple/SDL_glue.c b/demos/c_simple/SDL_glue.c
index 2260c22..a613159 100644
--- a/demos/c_simple/SDL_glue.c
+++ b/demos/c_simple/SDL_glue.c
@@ -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> *
* *
*****************************************************************************/
@@ -49,6 +49,9 @@ void redraw_screen(void)
GP_Fill(&context, black_pixel);
+ GP_Text(&context, NULL, W/2, 20, GP_ALIGN_CENTER | GP_VALIGN_BELOW,
+ darkgray_pixel, black_pixel, "GFXprim SDL Demo");
+
GP_Line(&context, 0, 0, W-1, H-1, darkgray_pixel);
GP_Line(&context, 0, H-1, W-1, 0, darkgray_pixel);
@@ -93,7 +96,8 @@ int main(void)
if (display == NULL) {
fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
+ SDL_Quit();
+ return 1;
}
GP_ContextFromSDLSurface(&context, display);
@@ -108,9 +112,5 @@ int main(void)
SDL_Quit();
return 0;
-
-fail:
- SDL_Quit();
- return 1;
}
diff --git a/demos/c_simple/backend_example.c b/demos/c_simple/backend_example.c
index 6bb97f1..651ffff 100644
--- a/demos/c_simple/backend_example.c
+++ b/demos/c_simple/backend_example.c
@@ -26,6 +26,7 @@
*/
+#include <stdio.h>
#include <GP.h>
static void redraw(GP_Backend *self)
@@ -65,9 +66,6 @@ int main(int argc, char *argv[])
}
}
- /* Turn on debug messages */
- GP_SetDebugLevel(10);
-
backend = GP_BackendInit(backend_opts, "Backend Example");
if (backend == NULL) {
diff --git a/demos/c_simple/backend_timers_example.c b/demos/c_simple/backend_timers_example.c
index 8a592be..8d860e5 100644
--- a/demos/c_simple/backend_timers_example.c
+++ b/demos/c_simple/backend_timers_example.c
@@ -26,6 +26,7 @@
*/
+#include <stdio.h>
#include <GP.h>
static void redraw(GP_Backend *self)
diff --git a/demos/c_simple/blittest.c b/demos/c_simple/blittest.c
index 02b374b..c6cd275 100644
--- a/demos/c_simple/blittest.c
+++ b/demos/c_simple/blittest.c
@@ -23,6 +23,7 @@
* *
*****************************************************************************/
+#include <stdio.h>
#include <GP.h>
static GP_Pixel black;
diff --git a/demos/c_simple/convolution.c b/demos/c_simple/convolution.c
index e0acd17..213baf8 100644
--- a/demos/c_simple/convolution.c
+++ b/demos/c_simple/convolution.c
@@ -76,22 +76,21 @@ int main(int argc, char *argv[])
printf("n");
- float box_kernel[] = {
- 0.0, 0.1, 1.0, 0.1, 0.0,
- 0.1, 0.5, 1.0, 0.5, 0.1,
- 1.0, 1.0, 1.0, 1.0, 1.0,
- 0.1, 0.5, 1.0, 0.5, 0.1,
- 0.0, 0.1, 1.0, 0.1, 0.0,
- };
GP_FilterKernel2D box = {
.w = 5,
.h = 5,
.div = 11.8,
- .kernel = box_kernel,
+ .kernel = (float[]) {
+ 0.0, 0.1, 1.0, 0.1, 0.0,
+ 0.1, 0.5, 1.0, 0.5, 0.1,
+ 1.0, 1.0, 1.0, 1.0, 1.0,
+ 0.1, 0.5, 1.0, 0.5, 0.1,
+ 0.0, 0.1, 1.0, 0.1, 0.0,
+ }
};
- priv.op = "Box Linear Convolution";
+ priv.op = "Linear Convolution";
/*
* Blur in-place, inner rectangle of the image.
diff --git a/demos/c_simple/debug_handler.c b/demos/c_simple/debug_handler.c
index f514769..1744b04 100644
--- a/demos/c_simple/debug_handler.c
+++ b/demos/c_simple/debug_handler.c
@@ -26,6 +26,7 @@
*/
+#include <stdio.h>
#include <GP.h>
static char level_to_c(int level)
diff --git a/demos/c_simple/fonttest.c b/demos/c_simple/fonttest.c
index fb888e2..4e33020 100644
--- a/demos/c_simple/fonttest.c
+++ b/demos/c_simple/fonttest.c
@@ -263,8 +263,6 @@ int main(int argc, char *argv[])
print_instructions();
- GP_SetDebugLevel(10);
-
if (argc > 1) {
font_path = argv[1];
fprintf(stderr, "nLoading font '%s'n", argv[1]);
diff --git a/demos/c_simple/showimage.c b/demos/c_simple/showimage.c
index 14873d0..c78cff0 100644
--- a/demos/c_simple/showimage.c
+++ b/demos/c_simple/showimage.c
@@ -37,8 +37,6 @@ int main(int argc, char *argv[])
GP_Backend *backend;
GP_Context *image;
- GP_SetDebugLevel(10);
-
if (argc != 2) {
fprintf(stderr, "Takes image as an argumentn");
return 1;
@@ -47,7 +45,7 @@ int main(int argc, char *argv[])
/* Load image */
image = GP_LoadImage(argv[1], NULL);
- if (image == NULL) {
+ if (!image) {
fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno));
return 1;
}
@@ -55,7 +53,7 @@ int main(int argc, char *argv[])
/* Initalize backend */
backend = GP_BackendX11Init(NULL, 0, 0, image->w, image->h, argv[1], 0);
- if (backend == NULL) {
+ if (!backend) {
fprintf(stderr, "Failed to initalize backendn");
return 1;
}
diff --git a/demos/c_simple/v4l2_grab.c b/demos/c_simple/v4l2_grab.c
index c43cc32..6498fb8 100644
--- a/demos/c_simple/v4l2_grab.c
+++ b/demos/c_simple/v4l2_grab.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <errno.h>
+#include <stdio.h>
#include <GP.h>
diff --git a/demos/c_simple/v4l2_show.c b/demos/c_simple/v4l2_show.c
index f11fb83..97467b5 100644
--- a/demos/c_simple/v4l2_show.c
+++ b/demos/c_simple/v4l2_show.c
@@ -28,6 +28,7 @@
#include <errno.h>
#include <string.h>
+#include <stdio.h>
#include <GP.h>
diff --git a/demos/c_simple/x11_windows.c b/demos/c_simple/x11_windows.c
index 39252ed..fa52cc2 100644
--- a/demos/c_simple/x11_windows.c
+++ b/demos/c_simple/x11_windows.c
@@ -26,6 +26,7 @@
*/
+#include <stdio.h>
#include <GP.h>
static void redraw(struct GP_Context *context)
http://repo.or.cz/w/gfxprim.git/commit/e27171add7b10d809d604f695d2f9a07f7b1…
commit e27171add7b10d809d604f695d2f9a07f7b178b4
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 24 15:36:50 2013 +0100
build: Change library names GP -> gfxprim
Don't forget to rerun configure
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/build/Makefile b/build/Makefile
index 36c797a..b6cd8cb 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -6,7 +6,7 @@ TOPDIR=../
include $(TOPDIR)/config.mk
include $(TOPDIR)/libver.mk
-LIB_NAME=libGP
+LIB_NAME=libgfxprim
STATIC_LIB=$(LIB_NAME).$(LIB_VERSION).a
DYNAMIC_LIB=$(LIB_NAME).so.$(LIB_VERSION).$(LIB_RELEASE)
diff --git a/build/check_symbols.sh b/build/check_symbols.sh
index cbf7960..61be791 100755
--- a/build/check_symbols.sh
+++ b/build/check_symbols.sh
@@ -61,15 +61,15 @@ do_check()
rm $SYMTMPFILE
}
-do_check libGP.so syms/Core_symbols.txt syms/Input_symbols.txt - syms/Filters_symbols.txt syms/GFX_symbols.txt - syms/Text_symbols.txt
+do_check libgfxprim.so syms/Core_symbols.txt syms/Input_symbols.txt + syms/Filters_symbols.txt syms/GFX_symbols.txt + syms/Text_symbols.txt
-do_check libGP_backends.so syms/Backend_symbols.txt
+do_check libgfxprim-backends.so syms/Backend_symbols.txt
-do_check libGP_grabbers.so syms/Grabbers_symbols.txt
+do_check libgfxprim-grabbers.so syms/Grabbers_symbols.txt
-do_check libGP_loaders.so syms/Loaders_symbols.txt
+do_check libgfxprim-loaders.so syms/Loaders_symbols.txt
if [ -n "$FOUND" ]; then
echo
diff --git a/configure b/configure
index ac35338..200bfc7 100755
--- a/configure
+++ b/configure
@@ -278,17 +278,17 @@ def write_gfxprim_config(cfg, libs):
f.write('t--list-modules) echo "%s"; exit 0;;n' % ' '.join(modules))
f.write('t--cflags) echo -n "-I/usr/include/GP/%s";;n' %
libs.get_cflags('core'))
- f.write('t--libs) echo -n "-lGP -lrt -lm %s ";;n' % libs.get_linker_flags('core'))
+ f.write('t--libs) echo -n "-lgfxprim -lrt -lm %s ";;n' % libs.get_linker_flags('core'))
# ldflags for specific modules
for i in modules:
ldflags = ''
if i == 'backends':
- ldflags += '-lGP_backends '
+ ldflags += '-lgfxprim-backends '
if i == 'grabbers':
- ldflags += '-lGP_grabbers '
+ ldflags += '-lgfxprim-grabbers '
if i == 'loaders':
- ldflags += '-lGP_loaders '
+ ldflags += '-lgfxprim-loaders '
ldflags += libs.get_linker_flags(i)
f.write('t--libs-%s) echo -n "%s ";;n' % (i, ldflags))
diff --git a/doc/grabbers.txt b/doc/grabbers.txt
index 86bf056..06ff791 100644
--- a/doc/grabbers.txt
+++ b/doc/grabbers.txt
@@ -5,7 +5,7 @@ Grabber is an abstraction for a device whose output is a stream of images.
There is currently V4L2 driver that implements a grabber.
-Link with +-lGP_grabbers+ or better +`gfxprim-config --libs-grabbers`+.
+Link with +-lgfxprim-grabbers+ or better +`gfxprim-config --libs-grabbers`+.
TIP: For example usage see grabber link:example_v4l2.html[examples].
diff --git a/lib.mk b/lib.mk
index b8e4a20..ff44945 100644
--- a/lib.mk
+++ b/lib.mk
@@ -1,6 +1,6 @@
#
# Most of the libraries just generate object files that
-# are later linked in build into the libGP.so
+# are later linked in build into the libgfxprim.so
#
ifndef LIBNAME
$(error LIBNAME not defined, fix your library Makefile)
@@ -9,12 +9,12 @@ endif
ifeq ($(BUILDLIB),yes)
#
# Rules for single library, applied only when objects
-# are not linked to the libGP.so. This generates libGP_$(LIBNAME).
+# are not linked to the libgfxprim.so. This generates libgfxprim_$(LIBNAME).
#
include $(TOPDIR)/libver.mk
-LIB_NAME=libGP_$(LIBNAME)
+LIB_NAME=libgfxprim-$(LIBNAME)
BUILD_DIR=$(TOPDIR)/build/
STATIC_LIB=$(LIB_NAME).$(LIB_VERSION).a
diff --git a/tests/drivers/Makefile b/tests/drivers/Makefile
index 3a028d8..12fef24 100644
--- a/tests/drivers/Makefile
+++ b/tests/drivers/Makefile
@@ -2,7 +2,7 @@ TOPDIR=../..
CSOURCES=$(shell echo *.c)
-LDLIBS+=-lGP -lGP_backends -L$(TOPDIR)/build/
+LDLIBS+=-lgfxprim -lgfxprim-backends -L$(TOPDIR)/build/
APPS=$(CSOURCES:.c=)
-----------------------------------------------------------------------
Summary of changes:
build/Makefile | 2 +-
build/check_symbols.sh | 12 +++---
configure | 8 ++--
demos/c_simple/SDL_glue.c | 12 +++---
demos/c_simple/backend_example.c | 4 +-
demos/c_simple/backend_timers_example.c | 1 +
demos/c_simple/blittest.c | 1 +
demos/c_simple/convolution.c | 17 +++----
demos/c_simple/debug_handler.c | 1 +
demos/c_simple/fonttest.c | 2 -
demos/c_simple/showimage.c | 6 +--
demos/c_simple/v4l2_grab.c | 1 +
demos/c_simple/v4l2_show.c | 1 +
demos/c_simple/x11_windows.c | 1 +
doc/Makefile | 2 +-
doc/asciidoc.conf | 2 +-
doc/grabbers.txt | 2 +-
doc/index.txt | 18 +++++++-
doc/news_1_0_0-rc1.txt | 74 +++++++++++++++++++++++++++++++
include/core/GP_Version.h | 2 +-
lib.mk | 6 +-
tests/drivers/Makefile | 2 +-
22 files changed, 132 insertions(+), 45 deletions(-)
create mode 100644 doc/news_1_0_0-rc1.txt
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.")
1
0
24 Dec '13
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 f8594e7a88faed4ad18a511ce7e814963dbc50e9 (commit)
from d81f7c37237c49858b952abf595e6dd07148ef41 (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/f8594e7a88faed4ad18a511ce7e814963dbc…
commit f8594e7a88faed4ad18a511ce7e814963dbc50e9
Author: Petr Baudis <pasky(a)ucw.cz>
Date: Tue Dec 24 02:27:03 2013 +0100
debian/spiv.manpages: +spiv.1
Signed-off-by: Petr Baudis <pasky(a)ucw.cz>
diff --git a/debian/spiv.manpages b/debian/spiv.manpages
new file mode 100644
index 0000000..aa5e0a0
--- /dev/null
+++ b/debian/spiv.manpages
@@ -0,0 +1 @@
+demos/spiv/spiv.1
-----------------------------------------------------------------------
Summary of changes:
debian/spiv.manpages | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 debian/spiv.manpages
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.")
1
0
23 Dec '13
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 d81f7c37237c49858b952abf595e6dd07148ef41 (commit)
from b2d360a0e6a8dd5aa6ab8482ae3e66ba926c77c6 (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/d81f7c37237c49858b952abf595e6dd07148…
commit d81f7c37237c49858b952abf595e6dd07148ef41
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 23 14:28:54 2013 +0100
spiv: Add man page.
The man page is generated by running 'spiv --print-man'.
But let's add it into git index in order to keep the build (and cross
compilation) simple.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/spiv/Makefile b/demos/spiv/Makefile
index 4fc57aa..e3a5c15 100644
--- a/demos/spiv/Makefile
+++ b/demos/spiv/Makefile
@@ -12,7 +12,7 @@ LDLIBS+=$(LDLIBS_LOADERS) $(LDLIBS_BACKENDS)
APPS=spiv
INSTALL_BIN=spiv
-#INSTALL_MAN=spiv.1
+INSTALL_MAN=spiv.1
spiv: cpu_timer.o image_cache.o image_list.o image_actions.o spiv_help.o image_loader.o cfg.o spiv_config.o
diff --git a/demos/spiv/spiv.1 b/demos/spiv/spiv.1
new file mode 100644
index 0000000..6599330
--- /dev/null
+++ b/demos/spiv/spiv.1
@@ -0,0 +1,322 @@
+.TH spiv 1 2013 GFXprim "Simple yet Powerful Image Viewer"
+
+.SH NAME
+spiv - Simple yet Powerful Image Viewer
+.SH SYNOPSIS
+.B spiv
+[options] images|dirs
+.SH DESCRIPTION
+.B spiv
+is a fast, lightweight and minimalistic image viewer build on the
+top of the GFXprim library.
+.PP
+Spiv supports wide range of image formats, currently supported are
+JPEG, PNG, GIF, BMP, TIFF, PSP, PPM, JP2 and CBZ (as well general
+ZIP archives with images), and more will come in the near future.
+.PP
+Spiv supports variety of video backends (via GFXprim backends)
+currently these are X11, Linux Framebuffer, SDL and AAlib. Spiv also
+supports wide range of backend pixel types from 1bit Grayscale to 32bit RGB
+with optional Floyd-Steinberg dithering (even, for example, from RGB888 to RGB565).
+.PP
+Spiv implements feh-like image actions, which are short shell scripts with
+printf-like modifiers.
+See
+.B ACTIONS
+bellow for further information.
+
+.SH KEYBOARD CONTROL
+.IP "Esc, Enter, Q"
+Quit spiv
+.IP "Space"
+Move to the next image
+.IP "BackSpace"
+Move to the prev image
+.IP "PgDown"
+Move to the start of directory
+.IP "PgUp"
+Move to the end of directory
+.IP "Home"
+Move to the first image
+.IP "End"
+Move to the last image
+.IP "R"
+Rotate by 90 degrees clockwise
+.IP "E"
+Rotate by 90 degrees counterclockwise
+.IP "W"
+Toggle fixed, resizable window
+.IP "D"
+Turn on/off downscale when image is larger than win
+.IP "U"
+Turn on/off upscale when image is smaller than win
+.IP "H"
+Show help
+.IP "I"
+Toggle show info box
+.IP "P"
+Toggle show progress
+.IP "S"
+Start/stop slideshow
+.IP "F1-F10"
+Execute action 1 - 10
+.IP "<, KP Minus"
+Zoom out by 50% (by 10% with Shift)
+.IP ">, KP Plus"
+Zoom in by 50% (by 10% with Shift)
+.IP "1"
+Resize to the image size
+.IP "2"
+Resize to a half of the image size
+.IP "3"
+Resize to one third of the image size
+.IP "9"
+Resize to one ninth of the image size
+.IP "0"
+Resize to one tenth of the image size
+.IP "Shift 2"
+Resize twice of the image size
+.IP "Shift 3"
+Resize three times of the image size
+.IP "Up"
+Move image by 10px up (by 1 with Shift)
+.IP "Down"
+Move image by 10px down (by 1 with Shift)
+.IP "Left"
+Move image by 10px left (by 1 with Shift)
+.IP "Right"
+Move image by 10px right (by 1 with Shift)
+.IP "]"
+Change to next resampling method
+.IP "["
+Change to prev resampling method
+.IP "L"
+Toggle low pass filter
+.IP "C"
+Drop image cache
+.SH OPTIONS
+.TP
+.B -h, --help
+Shows this help
+.TP
+.I Gui
+.TP
+.B -i, --show-info
+Show image info such as filename, size, etc...
+.TP
+.B -p, --show-progress
+Show progress bar when loading/resampling/... images
+.TP
+.B -s=value, --slideshow-delay=value
+Delay between images in seconds (float) for slideshow
+.TP
+.B -d, --dithering
+Turn on Floyd-Steinberg dithering
+.TP
+.B -o=value, --orientation=value
+Orientation, one of 0, 90, 180, 270
+.TP
+.B -f, --full-screen
+Start fullscreen.
+.TP
+.B -b=value, --backend-init=value
+Backend init string, set it to 'help' for more info
+.TP
+.I Zoom
+.TP
+.B -w=value, --window-size=value
+Window size, resizeable (-wr) or fixed (-wf)
+.TP
+.B -z=value, --zoom-strategy=value
+Zoom strategy, none (-zn), upscale (-zu), downscale (-zd) or both (-zb)
+.TP
+.B -m=value, --max-win-size=value
+Window maximal size, 800x600 for example
+.TP
+.I Actions
+.TP
+.B -1=value, --action-1=value
+.TP
+.B -2=value, --action-2=value
+.TP
+.B -3=value, --action-3=value
+.TP
+.B -4=value, --action-4=value
+.TP
+.B -5=value, --action-5=value
+.TP
+.B -6=value, --action-6=value
+.TP
+.B -7=value, --action-7=value
+.TP
+.B -8=value, --action-8=value
+.TP
+.B -9=value, --action-9=value
+.TP
+.B -0=value, --action-10=value
+Sets command line for action 1-10
+.TP
+.I Devel
+.TP
+.B -t, --timers
+Turns on cpu and wall clock measurement (printed to stdout)
+.TP
+.B -e=value, --backend-emulation=value
+Emulate different backend pixel type (G1, G2, RGB555, ...)
+.TP
+.B --print-man
+Prints spiv man page to stdout
+.SH CONFIGURATION FILE
+Configuraton file has simple key = value syntax, keys without values are written just as key.
+Lines started with # are comments.
+Keys are grouped in namespaces, namespace block is started
+by [NameSpace] and continues until next namespace.
+.TP
+.I [Gui]
+.TP
+.B ShowInfo
+Show image info such as filename, size, etc...
+.TP
+.B ShowProgress
+Show progress bar when loading/resampling/... images
+.TP
+.B SlideshowDelay=value
+Delay between images in seconds (float) for slideshow
+.TP
+.B Dithering
+Turn on Floyd-Steinberg dithering
+.TP
+.B Orientation=value
+Orientation, one of 0, 90, 180, 270
+.TP
+.B FullScreen
+Start fullscreen.
+.TP
+.B BackendInit=value
+Backend init string, set it to 'help' for more info
+.TP
+.I [Zoom]
+.TP
+.B WindowSize=value
+Window size, resizeable (-wr) or fixed (-wf)
+.TP
+.B ZoomStrategy=value
+Zoom strategy, none (-zn), upscale (-zu), downscale (-zd) or both (-zb)
+.TP
+.B MaxWinSize=value
+Window maximal size, 800x600 for example
+.TP
+.I [Actions]
+.TP
+.B 1=value
+.TP
+.B 2=value
+.TP
+.B 3=value
+.TP
+.B 4=value
+.TP
+.B 5=value
+.TP
+.B 6=value
+.TP
+.B 7=value
+.TP
+.B 8=value
+.TP
+.B 9=value
+.TP
+.B 10=value
+Sets command line for action 1-10
+.TP
+.I [Devel]
+.TP
+.B Timers
+Turns on cpu and wall clock measurement (printed to stdout)
+.TP
+.B BackendEmulation=value
+Emulate different backend pixel type (G1, G2, RGB555, ...)
+.PP
+Configuration is loaded from /etc/spiv.conf
+then ~/.spiv and overriden by command line parameters.
+
+.SH ACTIONS
+Actions are short shell scripts with printf-like modifiers, the
+modifiers are substituted to current image path, name, etc. and executed
+by pressing function keys).
+.PP
+Actions could be set via command line parameters or written into the
+configuration file and support following modifiers:
+
+.PP
+.B %f
+Path to current image
+.PP
+.B %F
+Shell escaped path to current image
+.PP
+.B %n
+Current image filename without extension
+.PP
+.B %N
+Shell escaped image filename without extension
+.PP
+.B %e
+Current image file extension
+.SH EXAMPLES
+.PP
+.B Shows all jpeg images in current directory
+.nf
+spiv *.jpg
+
+.PP
+.B Shows all images stored in zip file
+.nf
+spiv images.zip
+
+.PP
+.B Shows all loadable images in current directory
+.nf
+spiv .
+
+.PP
+.B Runs slideshow with 5 second delay
+.nf
+spiv -s 5 vacation/
+
+.PP
+.B Copies currently loaded image into directory 'sorted/' on pressing F1
+.nf
+spiv -1 'cp %F sorted' images/
+
+.PP
+.B Emulates 1-bit Grayscale display and turns on Floyd-Steinberg dithering
+.nf
+spiv -e G1 -d images/
+
+.PP
+.B Runs slideshow using X root window as backend window
+.nf
+spiv -b 'X11:use_root' -t 10 images/
+
+.PP
+.B Same as abowe but works in KDE
+
+.nf
+spiv -b 'X11:create_root' -t 10 images/
+
+.SH BUGS
+Bugs happen. If you find one, report it on the GFXprim mailing list at
+.I gfxprim(a)ucw.cz
+.SH AUTHORS
+Spiv is developed by Cyril Hrubis <chrubis(a)ucw.cz>
+.PP
+GFXprim was/is developed by:
+.PP
+.nf
+Cyril Hrubis <chrubis(a)ucw.cz>
+.nf
+Jiri "BlueBear" Dluhos <jiri.bluebear.dluhos(a)gmail.com>
+.nf
+Tomas Gavenciak <gavento(a)ucw.cz>
+
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/Makefile | 2 +-
demos/spiv/spiv.1 | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 323 insertions(+), 1 deletions(-)
create mode 100644 demos/spiv/spiv.1
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.")
1
0
23 Dec '13
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 b2d360a0e6a8dd5aa6ab8482ae3e66ba926c77c6 (commit)
from 00025c3127899e6de388292615ab900eac0cda89 (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/b2d360a0e6a8dd5aa6ab8482ae3e66ba926c…
commit b2d360a0e6a8dd5aa6ab8482ae3e66ba926c77c6
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 23 14:20:21 2013 +0100
debian: Add graphviz dependency
Graphviz is needed for building the documentation.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/debian/control b/debian/control
index 117e91c..6dee715 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Priority: extra
Maintainer: Petr Baudis <pasky(a)ucw.cz>
Build-Depends: debhelper (>= 8.0.0), python-jinja2, libjpeg-dev, libpng-dev, libgif-dev,
libtiff-dev, libfreetype6-dev, libx11-dev, libxext-dev,
- asciidoc, source-highlight, dvipng
+ asciidoc, source-highlight, dvipng, graphviz
Standards-Version: 3.9.3
Section: libs
Homepage: http://gfxprim.ucw.cz/
-----------------------------------------------------------------------
Summary of changes:
debian/control | 2 +-
1 files changed, 1 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.")
1
0
23 Dec '13
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 00025c3127899e6de388292615ab900eac0cda89 (commit)
via c2360b8b90f7e5fd71c8992c33346263433b7029 (commit)
from 38c6f46dd0901638b9a91ea0bce3c0b98c9b426a (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/00025c3127899e6de388292615ab900eac0c…
commit 00025c3127899e6de388292615ab900eac0cda89
Author: Petr Baudis <pasky(a)ucw.cz>
Date: Mon Dec 23 05:08:35 2013 +0100
Add initial debian packaging info
Signed-off-by: Petr Baudis <pasky(a)ucw.cz>
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..113e970
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,5 @@
+gfxprim for Debian
+------------------
+
+We currently do not package the Python bindings, this remains a TODO
+as I don't know anything about Python packaging in Debian yet. -- pasky
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..7ba6b0a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,6 @@
+gfxprim (1.0.0-rc0-1) unstable; urgency=low
+
+ * Initial release (based on the commit 38c6f4, not including
+ the Python bindings)
+
+ -- Petr Baudis <pasky(a)ucw.cz> Mon, 23 Dec 2013 02:11:26 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..117e91c
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,55 @@
+Source: gfxprim
+Priority: extra
+Maintainer: Petr Baudis <pasky(a)ucw.cz>
+Build-Depends: debhelper (>= 8.0.0), python-jinja2, libjpeg-dev, libpng-dev, libgif-dev,
+ libtiff-dev, libfreetype6-dev, libx11-dev, libxext-dev,
+ asciidoc, source-highlight, dvipng
+Standards-Version: 3.9.3
+Section: libs
+Homepage: http://gfxprim.ucw.cz/
+
+Package: libgfxprim-doc
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}
+Description: Open-source modular 2D bitmap graphics library
+ GFXprim is open-source modular 2D bitmap graphics library with
+ emphasis on speed and correctness.
+ .
+ This package contains the documentation.
+
+Package: libgfxprim-dev
+Section: libdevel
+Architecture: any
+Depends: libgfxprim1 (= ${binary:Version})
+Description: Open-source modular 2D bitmap graphics library
+ GFXprim is open-source modular 2D bitmap graphics library with
+ emphasis on speed and correctness.
+ .
+ This package contains the header and development files which are
+ needed for building gfxprim applications.
+
+Package: libgfxprim1
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: spiv
+Description: Open-source modular 2D bitmap graphics library
+ GFXprim is open-source modular 2D bitmap graphics library with
+ emphasis on speed and correctness.
+ .
+ This package contains the shared libraries.
+
+Package: spiv
+Section: graphics
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libgfxprim1 (= ${binary:Version})
+Description: Simple yet Powerful Image Viewer
+ Spiv is a fast, lightweight and minimalistic image viewer build
+ on the top of the GFXprim library.
+ .
+ Spiv supports wide range of image formats, implements image caches,
+ can also crawl a directory, supports variety of video backends, and
+ implements feh-like image actions, which are short shell scripts with
+ printf-like modifiers.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..24a9855
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,22 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: gfxprim
+Source: http://gfxprim.ucw.cz/
+
+Files: *
+Copyright: 2013 Cyril Hrubis
+License: LGPL-2+
+ This library 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.
+ .
+ This library 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 this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License version 2 can be found in "/usr/share/common-licenses/LGPL-2.1".
diff --git a/debian/libgfxprim-dev.dirs b/debian/libgfxprim-dev.dirs
new file mode 100644
index 0000000..4418816
--- /dev/null
+++ b/debian/libgfxprim-dev.dirs
@@ -0,0 +1,2 @@
+usr/lib
+usr/include
diff --git a/debian/libgfxprim-dev.install b/debian/libgfxprim-dev.install
new file mode 100644
index 0000000..d1bffed
--- /dev/null
+++ b/debian/libgfxprim-dev.install
@@ -0,0 +1,3 @@
+usr/include/*
+usr/lib/lib*.a
+usr/lib/lib*.so
diff --git a/debian/libgfxprim-doc.dirs b/debian/libgfxprim-doc.dirs
new file mode 100644
index 0000000..7276ecd
--- /dev/null
+++ b/debian/libgfxprim-doc.dirs
@@ -0,0 +1 @@
+usr/share/doc
diff --git a/debian/libgfxprim-doc.install b/debian/libgfxprim-doc.install
new file mode 100644
index 0000000..79f7ac8
--- /dev/null
+++ b/debian/libgfxprim-doc.install
@@ -0,0 +1 @@
+usr/share/doc/libgfxprim-doc/*
diff --git a/debian/libgfxprim1.dirs b/debian/libgfxprim1.dirs
new file mode 100644
index 0000000..527b78f
--- /dev/null
+++ b/debian/libgfxprim1.dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/lib
diff --git a/debian/libgfxprim1.docs b/debian/libgfxprim1.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/libgfxprim1.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/libgfxprim1.install b/debian/libgfxprim1.install
new file mode 100644
index 0000000..f8acb67
--- /dev/null
+++ b/debian/libgfxprim1.install
@@ -0,0 +1,2 @@
+usr/lib/lib*.so.*
+usr/bin/gfxprim-config
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..24cb937
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,23 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ ./configure --prefix=/usr
+
+override_dh_auto_build-indep:
+ $(MAKE) doc
+
+override_dh_auto_install-indep:
+ install -m 755 -d $(CURDIR)/debian/tmp/usr/share/doc/libgfxprim-doc
+ install -m 644 doc/*.html $(CURDIR)/debian/tmp/usr/share/doc/libgfxprim-doc/
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..af745b3
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (git)
diff --git a/debian/spiv.dirs b/debian/spiv.dirs
new file mode 100644
index 0000000..e772481
--- /dev/null
+++ b/debian/spiv.dirs
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/spiv.install b/debian/spiv.install
new file mode 100644
index 0000000..a267714
--- /dev/null
+++ b/debian/spiv.install
@@ -0,0 +1 @@
+usr/bin/spiv
diff --git a/debian/spiv.menu b/debian/spiv.menu
new file mode 100644
index 0000000..675fa09
--- /dev/null
+++ b/debian/spiv.menu
@@ -0,0 +1,2 @@
+?package(spiv):needs="X11|vc|wm" section="Applications/Graphics"+ title="spiv (GFXPrim image viewer)" command="/usr/bin/spiv"
http://repo.or.cz/w/gfxprim.git/commit/c2360b8b90f7e5fd71c8992c33346263433b…
commit c2360b8b90f7e5fd71c8992c33346263433b7029
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 23 11:05:05 2013 +0100
build: check_symbols: Fix bashishm
Reported-by: Petr Baudis <pasky(a)ucw.cz>
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/build/check_symbols.sh b/build/check_symbols.sh
index 641df38..cbf7960 100755
--- a/build/check_symbols.sh
+++ b/build/check_symbols.sh
@@ -8,21 +8,21 @@ WARN="WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARNING : WARN
SYMTMPFILE=symbols.txt
-function grep_sym
+grep_sym()
{
if objdump --syms "$1" |grep "$2" 2>&1 > /dev/null; then
echo -e "t$1"
fi
}
-function find_symbol
+find_symbol()
{
echo "SYM $1:"
find ../libs/ -name '*.o' | while read obj; do grep_sym "$obj" "$1"; done
}
-function get_symbols
+get_symbols()
{
objdump --dynamic-syms "$1" | awk 'NR > 4 { print }' | awk '$3 != "*UND*"' | awk '{print $NF}' > "$2"
@@ -34,7 +34,7 @@ function get_symbols
sed -i '/^_.*$/d' "$2"
}
-function check_symbols
+check_symbols()
{
local symfile=$1
shift
@@ -53,7 +53,7 @@ function check_symbols
done
}
-function do_check
+do_check()
{
get_symbols "$1" $SYMTMPFILE
shift
-----------------------------------------------------------------------
Summary of changes:
build/check_symbols.sh | 10 +++---
debian/README.Debian | 5 +++
debian/changelog | 6 ++++
debian/compat | 1 +
debian/control | 55 +++++++++++++++++++++++++++++++++++++++++
debian/copyright | 22 ++++++++++++++++
debian/libgfxprim-dev.dirs | 2 +
debian/libgfxprim-dev.install | 3 ++
debian/libgfxprim-doc.dirs | 1 +
debian/libgfxprim-doc.install | 1 +
debian/libgfxprim1.dirs | 2 +
debian/libgfxprim1.docs | 1 +
debian/libgfxprim1.install | 2 +
debian/rules | 23 +++++++++++++++++
debian/source/format | 1 +
debian/spiv.dirs | 1 +
debian/spiv.install | 1 +
debian/spiv.menu | 2 +
18 files changed, 134 insertions(+), 5 deletions(-)
create mode 100644 debian/README.Debian
create mode 100644 debian/changelog
create mode 100644 debian/compat
create mode 100644 debian/control
create mode 100644 debian/copyright
create mode 100644 debian/libgfxprim-dev.dirs
create mode 100644 debian/libgfxprim-dev.install
create mode 100644 debian/libgfxprim-doc.dirs
create mode 100644 debian/libgfxprim-doc.install
create mode 100644 debian/libgfxprim1.dirs
create mode 100644 debian/libgfxprim1.docs
create mode 100644 debian/libgfxprim1.install
create mode 100755 debian/rules
create mode 100644 debian/source/format
create mode 100644 debian/spiv.dirs
create mode 100644 debian/spiv.install
create mode 100644 debian/spiv.menu
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.")
1
0
22 Dec '13
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 38c6f46dd0901638b9a91ea0bce3c0b98c9b426a (commit)
via 75c43f675ff09ada0f6ff804a43a74e743b87b1b (commit)
via 0fc5c8f5c814c67b358c9cab1f019cc34fb4e150 (commit)
via 9dd2b6a1c757b73d58da9aa1c5b2af59b98c6adb (commit)
via d33f1e300065869146bc57be16c1696b04946803 (commit)
from cfa164fc6f9a5e7e97bd501dce67b6d7665504ec (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/38c6f46dd0901638b9a91ea0bce3c0b98c9b…
commit 38c6f46dd0901638b9a91ea0bce3c0b98c9b426a
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 22:32:20 2013 +0100
tests: Generate html report by default.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/tests/framework/log2html.py b/tests/framework/log2html.py
index 2263373..c1dac38 100755
--- a/tests/framework/log2html.py
+++ b/tests/framework/log2html.py
@@ -54,7 +54,7 @@ class MallocStats:
print(' <td bgcolor="#ffffcc" colspan="3">')
print(' <center>')
print(' <table>')
-
+
# Table header
print(' <tr>')
@@ -300,13 +300,11 @@ class TestSuite:
if (test_ok < test_all):
bg_color = html_colors['Failed']
else:
- bg_color = '#ccccee'
-
-
+ bg_color = html_colors['Success']
print(' <td bgcolor="#ccccee">%s</td>' % (self.suite_name))
print(' <td bgcolor="%s">%i</td>' % (bg_color, test_all - test_ok))
-
+
test_skipped = res_dict['Skipped']
if (test_skipped > 0):
diff --git a/tests/runtests.py b/tests/runtests.py
index 8cd1477..5bac628 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -106,13 +106,16 @@ def run_tests(resdir, testsdir):
run_test(curresdir, path, runtest)
def main():
- now = datetime.datetime.now()
+ now = datetime.datetime.now()
resdir = '%s_%i-%02i-%02i_%02i-%02i-%02i' % (results_dir, now.year, now.month,
now.day, now.hour, now.minute, now.second)
print('Creating result directory "%s"' % resdir)
os.mkdir(resdir)
run_tests(resdir, tests_dir)
+ os.system('cd framework && ./res2html.sh "../%s"' % resdir)
+
+ print('nPoint your browser to "%s/index.html"n' % resdir)
if __name__ == '__main__':
main()
http://repo.or.cz/w/gfxprim.git/commit/75c43f675ff09ada0f6ff804a43a74e743b8…
commit 75c43f675ff09ada0f6ff804a43a74e743b87b1b
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 22:25:02 2013 +0100
tests: PNG: Add RGBA8888 save test.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/tests/loaders/PNG.c b/tests/loaders/PNG.c
index 0803e98..5cee605 100644
--- a/tests/loaders/PNG.c
+++ b/tests/loaders/PNG.c
@@ -228,6 +228,11 @@ const struct tst_suite tst_suite = {
.data = (void*)GP_PIXEL_RGB888,
.flags = TST_CHECK_MALLOC},
+ {.name = "PNG Save 100x100 RGBA8888",
+ .tst_fn = test_save_PNG,
+ .data = (void*)GP_PIXEL_RGBA8888,
+ .flags = TST_CHECK_MALLOC},
+
{.name = "PNG Save 100x100 BGR888",
.tst_fn = test_save_PNG,
.data = (void*)GP_PIXEL_BGR888,
http://repo.or.cz/w/gfxprim.git/commit/0fc5c8f5c814c67b358c9cab1f019cc34fb4…
commit 0fc5c8f5c814c67b358c9cab1f019cc34fb4e150
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 22:12:26 2013 +0100
test: Two fixes for malloc canaries.
* Make use of real_free() instead of free()
(this fixes posible infinite loop)
* Fix special case for canary_right when size
is multiple of page size.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/tests/framework/tst_malloc_canaries.c b/tests/framework/tst_malloc_canaries.c
index 40f16c9..ec1fbca 100644
--- a/tests/framework/tst_malloc_canaries.c
+++ b/tests/framework/tst_malloc_canaries.c
@@ -20,10 +20,12 @@
* *
*****************************************************************************/
+#define _GNU_SOURCE
#include <stdio.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
+#include <dlfcn.h>
#include "tst_malloc_canaries.h"
@@ -33,6 +35,9 @@ void *tst_malloc_canary_right(size_t size)
size_t pages = size/pagesize + !!(size%pagesize) + 1;
char *buf;
+ if (size == 0)
+ return NULL;
+
if (posix_memalign((void*)&buf, pagesize, pages * pagesize))
return NULL;
@@ -47,21 +52,28 @@ void *tst_malloc_canary_right(size_t size)
return NULL;
}
- return buf + (pagesize - size%pagesize);
+ if (size%pagesize)
+ return buf + (pagesize - size%pagesize);
+
+ return buf;
}
+static void (*real_free)(void *) = NULL;
+
void tst_free_canary_right(void *ptr, size_t size)
{
size_t pagesize = sysconf(_SC_PAGESIZE);
size_t pages = size/pagesize + !!(size%pagesize);
- void *start = (char*)ptr - (pagesize - size%pagesize);
+ void *start = size%pagesize ? (char*)ptr - (pagesize - size%pagesize) : ptr;
/* Reset the memory protection back to RW */
- if (mprotect(start + pagesize * pages, pagesize, PROT_READ | PROT_WRITE)) {
+ if (mprotect(start + pagesize * pages, pagesize, PROT_READ | PROT_WRITE))
perror("mprotect");
- }
- free(start);
+ if (!real_free)
+ real_free = dlsym(RTLD_NEXT, "free");
+
+ real_free(start);
}
void *tst_malloc_canary_left(size_t size)
@@ -69,6 +81,9 @@ void *tst_malloc_canary_left(size_t size)
size_t pagesize = sysconf(_SC_PAGESIZE);
size_t pages = size/pagesize + !!(size%pagesize) + 1;
+ if (size == 0)
+ return NULL;
+
char *buf;
if (posix_memalign((void*)&buf, pagesize, pages * pagesize))
@@ -94,8 +109,12 @@ void tst_free_canary_left(void *ptr, size_t size __attribute__((unused)))
/* Reset the memory protection back to RW */
if (mprotect(start, pagesize, PROT_READ | PROT_WRITE)) {
+ printf("%p size %zun", ptr, size);
perror("mprotect");
}
- free(start);
+ if (!real_free)
+ real_free = dlsym(RTLD_NEXT, "free");
+
+ real_free(start);
}
http://repo.or.cz/w/gfxprim.git/commit/9dd2b6a1c757b73d58da9aa1c5b2af59b98c…
commit 9dd2b6a1c757b73d58da9aa1c5b2af59b98c6adb
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 22:09:44 2013 +0100
tst_preload: Fix realloc(NULL, size) case.
In case the realloc() was called with NULL optr the code wrongly
searched for the old chunk and caused crash.
The fix is to return malloc(size) in this case instead.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/tests/framework/tst_preload.c b/tests/framework/tst_preload.c
index 9436c2c..42457aa 100644
--- a/tests/framework/tst_preload.c
+++ b/tests/framework/tst_preload.c
@@ -235,6 +235,9 @@ void *realloc(void *optr, size_t size)
if (!real_realloc)
real_realloc = dlsym(RTLD_NEXT, "realloc");
+ if (!optr)
+ return malloc(size);
+
switch (malloc_canary) {
case MALLOC_CANARY_OFF:
ptr = real_realloc(optr, size);
http://repo.or.cz/w/gfxprim.git/commit/d33f1e300065869146bc57be16c1696b0494…
commit d33f1e300065869146bc57be16c1696b04946803
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 21:18:00 2013 +0100
doc: Add screenshot to spiv page.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/images/spiv/spiv_tux.png b/doc/images/spiv/spiv_tux.png
new file mode 100644
index 0000000..258216c
Binary files /dev/null and b/doc/images/spiv/spiv_tux.png differ
diff --git a/doc/spiv.txt b/doc/spiv.txt
index 0b36e17..0a0b6ba 100644
--- a/doc/spiv.txt
+++ b/doc/spiv.txt
@@ -1,14 +1,10 @@
spiv
----
-
-'spiv' - Simple yet Powerful Image Viewer.
+.Simple yet Powerful Image Viewer.
Spiv is a fast, lightweight and minimalistic image viewer build on the top of
the GFXprim library.
-Spiv is optimized for keyboard control and although you can use your mouse for
-some of the actions, everything could be done from the keyboard as well.
-
Spiv supports wide range of image formats, currently supported are JPEG, PNG,
GIF, BMP, TIFF, PSP, PPM, JP2 and CBZ (as well general ZIP archives with
images), and more will come in the near future.
@@ -29,3 +25,6 @@ printf-like modifiers. The modifiers are substituted to current image path,
name, etc. and executed by pressing function keys).
See 'spiv(1)' man page for more information.
+
+.Spiv running in X11
+image::images/spiv/spiv_tux.png[Spiv in X11]
-----------------------------------------------------------------------
Summary of changes:
doc/images/spiv/spiv_tux.png | Bin 0 -> 90878 bytes
doc/spiv.txt | 9 ++++-----
tests/framework/log2html.py | 8 +++-----
tests/framework/tst_malloc_canaries.c | 31 +++++++++++++++++++++++++------
tests/framework/tst_preload.c | 3 +++
tests/loaders/PNG.c | 5 +++++
tests/runtests.py | 5 ++++-
7 files changed, 44 insertions(+), 17 deletions(-)
create mode 100644 doc/images/spiv/spiv_tux.png
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.")
1
0
22 Dec '13
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 cfa164fc6f9a5e7e97bd501dce67b6d7665504ec (commit)
via 7d1c136443984e20f8fb05008fe63f66ca165767 (commit)
via 48c629b8a273d8e72d4e381fc86f930fc8bf14a7 (commit)
from 442c7288654c4fd015c2a77f52b3b38ce9a82d0e (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/cfa164fc6f9a5e7e97bd501dce67b6d76655…
commit cfa164fc6f9a5e7e97bd501dce67b6d7665504ec
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 21:01:12 2013 +0100
doc: Add RGB tripplet to pixel conversion docs.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/Makefile b/doc/Makefile
index 28cc670..2b0721b 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,10 +1,11 @@
SOURCES=index.html about.txt context.txt loaders.txt filters.txt - basic_types.txt gfx.txt backends.txt gamma.txt grabbers.txt + basic_types.txt gfx.txt backends.txt gamma.txt grabbers.txt environment_variables.txt debug.txt core.txt input.txt gen.txt pixels.txt coordinate_system.txt coding_style.txt get_put_pixel.txt blits.txt progress_callback.txt text.txt event_queue.txt compilation.txt filters_resize.txt filters_dithering.txt filters_python.txt spiv.txt core_common.txt + convert.txt
SOURCES+=core_python.txt gfx_python.txt loaders_python.txt backends_python.txt
diff --git a/doc/basic_types.txt b/doc/basic_types.txt
index 2d9b342..11ff214 100644
--- a/doc/basic_types.txt
+++ b/doc/basic_types.txt
@@ -18,6 +18,7 @@ be changed at compile time to support colors with more than 10 bits per
channel. The 'GP_Pixel' is thus used as opaque value big enough to hold any
supported pixel value.
+[[Color]]
Color
~~~~~
diff --git a/doc/convert.txt b/doc/convert.txt
new file mode 100644
index 0000000..9191805
--- /dev/null
+++ b/doc/convert.txt
@@ -0,0 +1,39 @@
+Pixel Conversions
+-----------------
+
+This page describes RGB tripplet to pixels conversions.
+
+See also link:basic_types.html#Color[colors].
+
+[source,c]
+-------------------------------------------------------------------------------
+#include <GP.h>
+/* or */
+#include <core/GP_Convert.h>
+
+GP_Pixel GP_RGBToPixel(uint8_t r, uint8_t g, uint8_t b, GP_PixelType type);
+
+GP_Pixel GP_RGBAToPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
+ GP_PixelType type);
+
+GP_Pixel GP_RGBToContextPixel(uint8_t r, uint8_t g, uint8_t b,
+ const GP_Context *context);
+
+GP_Pixel GP_RGBAToContextPixel(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
+ const GP_Context *context);
+-------------------------------------------------------------------------------
+
+Simple functions to convert RGB or RGBA 8 bit values into the specific
+link:pixels.html[pixel types].
+
+[source,c]
+-------------------------------------------------------------------------------
+#include <GP.h>
+/* or */
+#include <core/GP_Convert.h>
+
+GP_Pixel GP_ConvertPixel(GP_Pixel pixel, GP_PixelType from, GP_PixelType to);
+-------------------------------------------------------------------------------
+
+Converts pixel value. The conversion currently converts by converting the
+value to RGBA8888 and then to the resulting value.
diff --git a/doc/gfx.txt b/doc/gfx.txt
index c311dbf..14cb7d8 100644
--- a/doc/gfx.txt
+++ b/doc/gfx.txt
@@ -6,6 +6,8 @@ as lines, circles, etc.
You may want to see the link:coordinate_system.html[coordinate system] first.
+See also RGB tripplet to pixel link:convert.html[conversions].
+
Rotation Flags
~~~~~~~~~~~~~~
http://repo.or.cz/w/gfxprim.git/commit/7d1c136443984e20f8fb05008fe63f66ca16…
commit 7d1c136443984e20f8fb05008fe63f66ca165767
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 20:40:39 2013 +0100
demos: Fix and cleanup GP_BackendInit() + docs.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/c_simple/backend_example.c b/demos/c_simple/backend_example.c
index ecf82cc..6bb97f1 100644
--- a/demos/c_simple/backend_example.c
+++ b/demos/c_simple/backend_example.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
backend_opts = optarg;
break;
case 'h':
- GP_BackendInit(NULL, NULL, stderr);
+ GP_BackendInit(NULL, NULL);
return 0;
break;
default:
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
/* Turn on debug messages */
GP_SetDebugLevel(10);
- backend = GP_BackendInit(backend_opts, "Backend Example", stderr);
+ backend = GP_BackendInit(backend_opts, "Backend Example");
if (backend == NULL) {
fprintf(stderr, "Failed to initialize backendn");
diff --git a/demos/c_simple/backend_timers_example.c b/demos/c_simple/backend_timers_example.c
index e31075c..8a592be 100644
--- a/demos/c_simple/backend_timers_example.c
+++ b/demos/c_simple/backend_timers_example.c
@@ -54,7 +54,7 @@ int main(void)
GP_Backend *backend;
const char *backend_opts = "X11:100x100";
- backend = GP_BackendInit(backend_opts, "Backend Timers Example", stderr);
+ backend = GP_BackendInit(backend_opts, "Backend Timers Example");
if (backend == NULL) {
fprintf(stderr, "Failed to initialize backendn");
diff --git a/demos/c_simple/blittest.c b/demos/c_simple/blittest.c
index 3aaf45e..02b374b 100644
--- a/demos/c_simple/blittest.c
+++ b/demos/c_simple/blittest.c
@@ -161,7 +161,7 @@ int main(void)
return 1;
}
- win = GP_BackendInit(backend_opts, "Blit Test", stderr);
+ win = GP_BackendInit(backend_opts, "Blit Test");
if (win == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/fileview.c b/demos/c_simple/fileview.c
index f0608c7..2d06dae 100644
--- a/demos/c_simple/fileview.c
+++ b/demos/c_simple/fileview.c
@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
if (!read_file_head(argv[1]))
return 1;
- backend = GP_BackendInit(backend_opts, "File View", stderr);
+ backend = GP_BackendInit(backend_opts, "File View");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/fonttest.c b/demos/c_simple/fonttest.c
index 2ecfa05..fb888e2 100644
--- a/demos/c_simple/fonttest.c
+++ b/demos/c_simple/fonttest.c
@@ -271,7 +271,7 @@ int main(int argc, char *argv[])
font = GP_FontFaceLoad(argv[1], 0, font_h);
}
- win = GP_BackendInit(backend_opts, "Font Test", stderr);
+ win = GP_BackendInit(backend_opts, "Font Test");
if (win == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/input_example.c b/demos/c_simple/input_example.c
index 5243c82..3b94ce3 100644
--- a/demos/c_simple/input_example.c
+++ b/demos/c_simple/input_example.c
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
backend_opts = optarg;
break;
case 'h':
- GP_BackendInit(NULL, NULL, stderr);
+ GP_BackendInit("help", NULL);
return 0;
break;
default:
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
}
}
- backend = GP_BackendInit(backend_opts, "Input Test", stderr);
+ backend = GP_BackendInit(backend_opts, "Input Test");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/koch.c b/demos/c_simple/koch.c
index 6325e35..335815d 100644
--- a/demos/c_simple/koch.c
+++ b/demos/c_simple/koch.c
@@ -128,7 +128,7 @@ int main(void)
{
const char *backend_opts = "X11";
- backend = GP_BackendInit(backend_opts, "Koch", stderr);
+ backend = GP_BackendInit(backend_opts, "Koch");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/linetest.c b/demos/c_simple/linetest.c
index 1069a7e..1df6e6e 100644
--- a/demos/c_simple/linetest.c
+++ b/demos/c_simple/linetest.c
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
}
}
- win = GP_BackendInit(backend_opts, "Line Test", stderr);
+ win = GP_BackendInit(backend_opts, "Line Test");
if (win == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/randomshapetest.c b/demos/c_simple/randomshapetest.c
index bf53204..f3dbaa1 100644
--- a/demos/c_simple/randomshapetest.c
+++ b/demos/c_simple/randomshapetest.c
@@ -260,7 +260,7 @@ int main(void)
{
const char *backend_opts = "X11";
- win = GP_BackendInit(backend_opts, "Random Shape Test", stderr);
+ win = GP_BackendInit(backend_opts, "Random Shape Test");
if (win == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/shapetest.c b/demos/c_simple/shapetest.c
index 314be26..db32938 100644
--- a/demos/c_simple/shapetest.c
+++ b/demos/c_simple/shapetest.c
@@ -491,7 +491,7 @@ int main(int argc, char *argv[])
}
}
- backend = GP_BackendInit(backend_opts, "Shapetest", stderr);
+ backend = GP_BackendInit(backend_opts, "Shapetest");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/textaligntest.c b/demos/c_simple/textaligntest.c
index 99a6a3f..1e8a77d 100644
--- a/demos/c_simple/textaligntest.c
+++ b/demos/c_simple/textaligntest.c
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
print_instructions();
- win = GP_BackendInit(backend_opts, "Font Align Test", stderr);
+ win = GP_BackendInit(backend_opts, "Font Align Test");
if (win == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n",
diff --git a/demos/c_simple/virtual_backend_example.c b/demos/c_simple/virtual_backend_example.c
index d149bc8..925a3d6 100644
--- a/demos/c_simple/virtual_backend_example.c
+++ b/demos/c_simple/virtual_backend_example.c
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
}
break;
case 'h':
- GP_BackendInit(NULL, NULL, stderr);
+ GP_BackendInit("help", NULL);
return 0;
break;
default:
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
/* Turn on debug messages */
GP_SetDebugLevel(10);
- backend = GP_BackendInit(backend_opts, "Virtual Backend Example", stderr);
+ backend = GP_BackendInit(backend_opts, "Virtual Backend Example");
if (emul_type != GP_PIXEL_UNKNOWN) {
GP_Backend *emul;
diff --git a/demos/particle/particle_demo.c b/demos/particle/particle_demo.c
index cc9a4a2..2b902a0 100644
--- a/demos/particle/particle_demo.c
+++ b/demos/particle/particle_demo.c
@@ -51,7 +51,7 @@ static void sighandler(int signo)
static void init_backend(const char *backend_opts)
{
- backend = GP_BackendInit(backend_opts, "Particles", stderr);
+ backend = GP_BackendInit(backend_opts, "Particles");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n", backend_opts);
diff --git a/demos/py_simple/backends.py b/demos/py_simple/backends.py
index f6d9e40..31fb59d 100755
--- a/demos/py_simple/backends.py
+++ b/demos/py_simple/backends.py
@@ -32,7 +32,7 @@ def main():
sys.exit(1)
# Create backend window
- bk = backends.BackendInit(backend_string, "Backend Example", sys.stderr)
+ bk = backends.BackendInit(backend_string, "Backend Example")
assert(bk)
redraw(bk)
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index 33b0971..ca37408 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -638,7 +638,7 @@ static void sighandler(int signo)
static void init_backend(const char *backend_opts)
{
- backend = GP_BackendInit(backend_opts, "Spiv", stderr);
+ backend = GP_BackendInit(backend_opts, "Spiv");
if (backend == NULL) {
fprintf(stderr, "Failed to initalize backend '%s'n", backend_opts);
diff --git a/demos/spiv/spiv_help.c b/demos/spiv/spiv_help.c
index 736756d..0f9e222 100644
--- a/demos/spiv/spiv_help.c
+++ b/demos/spiv/spiv_help.c
@@ -95,9 +95,9 @@ static const struct examples examples[] = {
"Copies currently loaded image into directory 'sorted/' on pressing F1"},
{"spiv -e G1 -d images/",
"Emulates 1-bit Grayscale display and turns on Floyd-Steinberg dithering"},
- {"spiv -b 'X11:ROOT_WIN' -t 10 images/",
+ {"spiv -b 'X11:use_root' -t 10 images/",
"Runs slideshow using X root window as backend window"},
- {"spiv -b 'X11:CREATE_ROOT' -t 10 images/",
+ {"spiv -b 'X11:create_root' -t 10 images/",
"Same as abowe but works in KDEn"}
};
diff --git a/doc/backends.txt b/doc/backends.txt
index 46a631a..4196c8f 100644
--- a/doc/backends.txt
+++ b/doc/backends.txt
@@ -206,19 +206,22 @@ it.
-------------------------------------------------------------------------------
#include <GP.h>
-GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help);
--------------------------------------------------------------------------------
-
-This function takes a params string as an parameter which is used for
-determining backend-dependent parameters. The format is
-'backend_name:backend_parameters' where backend parameters may be window size
-(either 'WxH' or 'FS' in case of 'SDL' backend). The caption is window caption
-(which is ignored in some of the cases) and the 'FILE' is file, where an error
-is printed in case of failure, you should mostly use 'stderr' for that
-purpose. If params is set to 'NULL' the the call only prints help into the
-passed help 'FILE'. If initialization was successful pointer to allocated and
-initialized backend is returned otherwise 'NULL' is returned and some helpful
-information should be printed into the passed help 'FILE'.
+GP_Backend *GP_BackendInit(const char *params, const char *caption);
+-------------------------------------------------------------------------------
+
+The 'params' string composes of backend name and backend dependend parameters.
+The format is 'backend_name:backend_params' for example
+'fb:new_console:/dev/fb1'.
+
+The 'caption' string is used for window caption, in case of X11 backend or may
+be ignored completly in case of framebuffer backend.
+
+If 'params' is set to '"help"' help for all backends is printed into the
+'stderr'.
+
+If initialization was successful pointer to allocated and initialized backend
+is returned otherwise 'NULL' is returned and some helpful information should
+be printed into the 'stderr'.
General Backend API
diff --git a/doc/backends_python.txt b/doc/backends_python.txt
index a5c2206..183b4c1 100644
--- a/doc/backends_python.txt
+++ b/doc/backends_python.txt
@@ -57,7 +57,7 @@ import gfxprim.backends as backends
backend_string = "X11:100x100"
# Initialize backend by init string
- bk = backends.BackendInit(backend_string, "Window title", stderr)
+ bk = backends.BackendInit(backend_string, "Window title")
# Assert that inicialization was successful
assert(bk)
@@ -82,7 +82,7 @@ import gfxprim.gfx as gfx
import gfxprim.backends as backends
# Initialize backend
- bk = backends.BackendInit("X11:100x100", "Window title", stderr)
+ bk = backends.BackendInit("X11:100x100", "Window title")
# Assert that inicialization was successful
assert(bk)
@@ -109,7 +109,7 @@ import gfxprim.backends as backends
# Initialize backend
- bk = backends.BackendInit("X11:100x100", "Window title", stderr)
+ bk = backends.BackendInit("X11:100x100", "Window title")
# Assert that inicialization was successful
assert(bk)
diff --git a/include/backends/GP_BackendInit.h b/include/backends/GP_BackendInit.h
index db9fdda..9b89975 100644
--- a/include/backends/GP_BackendInit.h
+++ b/include/backends/GP_BackendInit.h
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2009-2013 Cyril Hrubis <metan(a)ucw.cz> *
* *
*****************************************************************************/
@@ -38,7 +38,7 @@
*
* "backend_name:backend_params"
*
- * For example "SDL:FS" is string for fullscreen SDL backend.
+ * For example "SDL:fs" is string for fullscreen SDL backend.
*
* The caption parameter may, or may not be used. For example in windowed
* enviroment caption will become caption of a window. When running on
@@ -46,9 +46,8 @@
*
* Returns initalized backend or NULL in case of failure.
*
- * If initialization has failed or params is NULL and help is not NULL, help
- * text is printed to a given file.
+ * If help is passed as a backend name a help is printed into the stderr.
*/
-GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help);
+GP_Backend *GP_BackendInit(const char *params, const char *caption);
#endif /* BACKENDS_GP_BACKEND_INIT_H */
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c
index a9c887f..c9f8e8b 100644
--- a/libs/backends/GP_BackendInit.c
+++ b/libs/backends/GP_BackendInit.c
@@ -28,322 +28,322 @@
#include "GP_Backends.h"
#include "GP_BackendInit.h"
-static void backend_sdl_help(FILE *help, const char *err)
+static char *next_param(char *params)
{
- if (help == NULL)
- return;
-
- if (err != NULL)
- fprintf(help, "ERROR: %sn", err);
-
- fprintf(help, "libSDL backendn"
- "--------------n"
- "SDL:[FS]:[8]:[16]:[24]:[32]:[WxH]n"
- " FS - Full Screen moden"
- " 8 - Sets 8bppn"
- " 16 - Sets 16bppn"
- " 24 - Sets 24bppn"
- " 32 - Sets 32bppn"
- " WxH - Display Sizen");
+ for (;;) {
+ switch (*params) {
+ case ':':
+ *params = '0';
+ return params + 1;
+ break;
+ case '0':
+ return NULL;
+ break;
+ }
+ params++;
+ }
}
-static int sdl_params_to_flags(const char *param, GP_Size *w, GP_Size *h,
- GP_Size *bpp, uint8_t *flags, FILE *help)
+static int parse_x11_params(char *params, GP_Size *w, GP_Size *h,
+ enum GP_BackendX11Flags *flags)
{
- if (!strcasecmp(param, "FS")) {
- *flags |= GP_SDL_FULLSCREEN;
- return 0;
- }
+ char *param;
- if (!strcmp(param, "8")) {
- *bpp = 8;
+ if (!params)
return 0;
- }
- if (!strcmp(param, "16")) {
- *bpp = 16;
- return 0;
- }
+ do {
+ param = params;
+ params = next_param(params);
- if (!strcmp(param, "24")) {
- *bpp = 24;
- return 0;
- }
+ if (!strcasecmp(param, "use_root")) {
+ *flags |= GP_X11_USE_ROOT_WIN;
+ GP_DEBUG(1, "X11: Using root window");
+ continue;
+ }
- if (!strcmp(param, "32")) {
- *bpp = 32;
- return 0;
- }
+ if (!strcasecmp(param, "create_root")) {
+ *flags |= GP_X11_CREATE_ROOT_WIN;
+ GP_DEBUG(1, "X11: Creating root window");
+ continue;
+ }
+
+ if (!strcasecmp(param, "disable_shm")) {
+ *flags |= GP_X11_DISABLE_SHM;
+ GP_DEBUG(1, "X11: Disabling SHM");
+ continue;
+ }
- /*
- * Accepts only string with format "intxint" or "intXint"
- */
- int sw, sh;
- unsigned int n;
+ if (!strcasecmp(param, "fs")) {
+ *flags |= GP_X11_FULLSCREEN;
+ GP_DEBUG(1, "X11: Enabling fullscreen");
+ continue;
+ }
- if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) {
- *w = sw;
- *h = sh;
- return 0;
- }
+ /*
+ * Accepts only string with format "intxint" or "intXint"
+ */
+ int sw, sh;
+ unsigned int n;
+
+ if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) {
+ *w = sw;
+ *h = sh;
+ continue;
+ }
- backend_sdl_help(help, "SDL: Invalid parameters");
- errno = EINVAL;
- return 1;
+ GP_WARN("X11: Invalid parameters '%s'", param);
+ errno = EINVAL;
+ return 1;
+ } while (params);
+
+ return 0;
}
-static GP_Backend *backend_sdl_init(char *params, const char *caption,
- FILE *help)
+static GP_Backend *x11_init(char *params, const char *caption)
{
- if (params == NULL)
- return GP_BackendSDLInit(0, 0, 0, 0, caption);
+ GP_Size w = 640, h = 480;
+ enum GP_BackendX11Flags flags = 0;
- GP_Size w = 0, h = 0, bpp = 0;
- uint8_t flags = GP_SDL_RESIZABLE;
+ if (parse_x11_params(params, &w, &h, &flags))
+ return NULL;
- char *s = params;
+ return GP_BackendX11Init(NULL, 0, 0, w, h, caption, flags);
+}
- for (;;) {
- switch (*s) {
- case ':':
- (*s) = '0';
- if (sdl_params_to_flags(params, &w, &h, &bpp, &flags, help))
- return NULL;
- s++;
- params = s;
- break;
- case '0':
- if (sdl_params_to_flags(params, &w, &h, &bpp, &flags, help))
- return NULL;
+static int parse_sdl_params(char *params, GP_Size *w, GP_Size *h,
+ GP_Size *bpp, uint8_t *flags)
+{
+ char *param;
- return GP_BackendSDLInit(w, h, bpp, flags, caption);
- break;
+ if (!params)
+ return 0;
+
+ do {
+ param = params;
+ params = next_param(params);
+
+ if (!strcasecmp(param, "FS")) {
+ *flags |= GP_SDL_FULLSCREEN;
+ GP_DEBUG(1, "SDL fullscreen enabled");
+ continue;
}
- s++;
- }
-}
-static void backend_fb_help(FILE *help, const char *err)
-{
- if (help == NULL)
- return;
+ if (!strcmp(param, "8")) {
+ *bpp = 8;
+ GP_DEBUG(1, "SDL depth set to 8");
+ continue;
+ }
- if (err != NULL)
- fprintf(help, "ERROR: %sn", err);
+ if (!strcmp(param, "16")) {
+ *bpp = 16;
+ GP_DEBUG(1, "SDL depth set to 16");
+ continue;
+ }
- fprintf(help, "LinuxFB backendn"
- "--------------n"
- "FB:NO_SHADOW:USE_CON:[/dev/fbX]n");
-}
+ if (!strcmp(param, "24")) {
+ *bpp = 24;
+ GP_DEBUG(1, "SDL depth set to 24");
+ continue;
+ }
-static GP_Backend *backend_fb_init(char *params, const char *caption,
- FILE *help)
-{
- const char *fb = "/dev/fb0";
+ if (!strcmp(param, "32")) {
+ *bpp = 32;
+ GP_DEBUG(1, "SDL depth set to 32");
+ continue;
+ }
- (void) help;
- (void) caption;
+ /*
+ * Accepts only string with format "intxint" or "intXint"
+ */
+ int sw, sh;
+ unsigned int n;
- if (params != NULL)
- fb = params;
+ if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) {
+ *w = sw;
+ *h = sh;
+ continue;
+ }
+
+ GP_WARN("SDL: Invalid parameters '%s'", param);
+ errno = EINVAL;
+ return 1;
+ } while (params);
- return GP_BackendLinuxFBInit(fb, 3);
+ return 0;
}
-static void backend_x11_help(FILE *help, const char *err)
+static GP_Backend *sdl_init(char *params, const char *caption)
{
- if (help == NULL)
- return;
-
- if (err != NULL)
- fprintf(help, "ERROR: %sn", err);
-
- fprintf(help, "X11 backendn"
- "--------------n"
- "X11:[WxH]:[ROOT_WIN]:[CREATE_ROOT]nn"
- "ROOT_WIN - starts the backend in the root windown"
- " (w and h, if set, are ignored)n"
- "CREATE_ROOT - starts the backend in newly createdn"
- " root window (w and h, if set, are ignored)n"
- "DISABLE_SHM - disable MIT SHM even if availablen"
- "FS - start fullscreenn");
+ GP_Size w = 0, h = 0, bpp = 0;
+ uint8_t flags = GP_SDL_RESIZABLE;
+
+ if (parse_sdl_params(params, &w, &h, &bpp, &flags))
+ return NULL;
+ return GP_BackendSDLInit(w, h, bpp, flags, caption);
}
-static int x11_params_to_flags(const char *param, GP_Size *w, GP_Size *h,
- enum GP_BackendX11Flags *flags, FILE *help)
+static int parse_fb_params(char *params, int *flags, const char **fb)
{
- if (!strcasecmp(param, "ROOT_WIN")) {
- *flags |= GP_X11_USE_ROOT_WIN;
- return 0;
- }
+ char *param;
- if (!strcasecmp(param, "CREATE_ROOT")) {
- *flags |= GP_X11_CREATE_ROOT_WIN;
+ if (!params)
return 0;
- }
-
- if (!strcasecmp(param, "DISABLE_SHM")) {
- *flags |= GP_X11_DISABLE_SHM;
- return 0;
- }
-
- if (!strcasecmp(param, "FS")) {
- *flags |= GP_X11_FULLSCREEN;
- return 0;
- }
-
- /*
- * Accepts only string with format "intxint" or "intXint"
- */
- int sw, sh;
- unsigned int n;
- if (sscanf(param, "%i%*[xX]%i%n", &sw, &sh, &n) == 2 && n == strlen(param)) {
- *w = sw;
- *h = sh;
- return 0;
- }
+ do {
+ param = params;
+ params = next_param(params);
- backend_x11_help(help, "X11: Invalid parameters");
- errno = EINVAL;
- return 1;
-}
+ if (!strcasecmp(param, "no_shadow")) {
+ *flags &= ~GP_FB_SHADOW;
+ GP_DEBUG(1, "Shadow framebuffer disabled");
+ continue;
+ }
+ if (!strcasecmp(param, "new_console")) {
+ *flags |= GP_FB_ALLOC_CON;
+ GP_DEBUG(1, "Console allocation enabled");
+ continue;
+ }
-static GP_Backend *backend_x11_init(char *params, const char *caption,
- FILE *help)
-{
- GP_Size w = 640, h = 480;
- enum GP_BackendX11Flags flags = 0;
+ *fb = param;
- if (params == NULL)
- return GP_BackendX11Init(NULL, 0, 0, w, h, caption, 0);
+ if (strncmp(*fb, "/dev/", 5))
+ GP_WARN("Console dev set to '%s', are you sure?", *fb);
- char *s = params;
+ GP_DEBUG(1, "Framebuffer console set to '%s'", *fb);
- for (;;) {
- switch (*s) {
- case ':':
- (*s) = '0';
- if (x11_params_to_flags(params, &w, &h, &flags, help))
- return NULL;
- s++;
- params = s;
- break;
- case '0':
- if (x11_params_to_flags(params, &w, &h, &flags, help))
- return NULL;
+ } while (params);
- return GP_BackendX11Init(NULL, 0, 0, w, h, caption, flags);
- break;
- }
- s++;
- }
+ return 0;
}
-static void backend_aa_help(FILE *help, const char *err)
+static GP_Backend *fb_init(char *params, const char *caption)
{
- if (help == NULL)
- return;
+ const char *fb = "/dev/fb0";
- if (err != NULL)
- fprintf(help, "ERROR: %sn", err);
+ (void) caption;
+
+ int flags = GP_FB_INPUT_KBD | GP_FB_SHADOW;
+
+ parse_fb_params(params, &flags, &fb);
- fprintf(help, "AALib backendn"
- "--------------n"
- "AAn");
+ return GP_BackendLinuxFBInit(fb, flags);
}
-static GP_Backend *backend_aa_init(char *params, const char *caption,
- FILE *help)
+static GP_Backend *aa_init(char *params, const char *caption)
{
- (void) help;
(void) caption;
(void) params;
return GP_BackendAALibInit();
}
-
-static const char *backend_names[] = {
- "SDL", /* libSDL */
- "FB", /* Linux Framebuffer */
- "X11", /* X11 window system */
- "AA", /* AALib */
- NULL,
-};
-
-static GP_Backend *(*backend_inits[])(char *, const char *, FILE *) = {
- backend_sdl_init,
- backend_fb_init,
- backend_x11_init,
- backend_aa_init,
- NULL,
+struct backend_init {
+ const char *name;
+ GP_Backend *(*init)(char *params, const char *caption);
+ const char *usage;
+ const char *help[10];
};
-static void (*backend_helps[])(FILE *help, const char *err) = {
- backend_sdl_help,
- backend_fb_help,
- backend_x11_help,
- backend_aa_help,
- NULL,
+static GP_Backend *do_help(char *params, const char *caption);
+
+static struct backend_init backends[] = {
+ {.name = "X11",
+ .init = x11_init,
+ .usage = "X11:[WxH]:[use_root]:[create_root]:[disable_shm]",
+ .help = {"use_root - starts the backend in the root window",
+ " (w and h, if set, are ignored)",
+ "create_root - starts the backend in newly created",
+ " root window (w and h, if set, are ignored)",
+ "disable_shm - disable MIT SHM even if available",
+ "fs - start fullscreen",
+ NULL}
+ },
+ {.name = "SDL",
+ .init = sdl_init,
+ .usage = "SDL:[fs]:[8]:[16]:[24]:[32]:[WxH]",
+ .help = {"fs - Full Screen mode",
+ "8 - Sets 8bpp",
+ "16 - Sets 16bpp",
+ "24 - Sets 24bpp",
+ "32 - Sets 32bpp",
+ "WxH - Display Size",
+ NULL}
+ },
+ {.name = "FB",
+ .init = fb_init,
+ .usage = "fb:[no_shadow]:[new_console]:[/dev/fbX]",
+ .help = {"no_shadow - turns off shadow buffer",
+ "new_console - allocate new console",
+ NULL}
+ },
+ {.name = "AA",
+ .init = aa_init,
+ .usage = "AA",
+ .help = {NULL}
+ },
+ {.name = "help",
+ .init = do_help
+ },
+ {.name = NULL}
};
-static void print_help(FILE *help, char *err)
+static GP_Backend *do_help(char *params, const char *caption)
{
- int i;
+ struct backend_init *i;
+ unsigned int j;
- if (help == NULL)
- return;
+ (void) params;
+ (void) caption;
- if (err != NULL) {
- fprintf(help, "ERROR: %sn", err);
- fprintf(help, "n");
+ for (i = backends; (i+1)->name; i++) {
+ fprintf(stderr, "Backend %snn %snn",
+ i->name, i->usage);
+ if (i->help[0]) {
+ for (j = 0; i->help[j]; j++)
+ fprintf(stderr, " %sn", i->help[j]);
+ fprintf(stderr, "n");
+ }
}
- fprintf(help, "Backends usagen"
- "--------------nn");
-
- for (i = 0; backend_helps[i] != NULL; i++) {
- backend_helps[i](help, NULL);
- fprintf(help, "n");
- }
+ return NULL;
}
-static int get_backend(const char *name)
+static struct backend_init *get_backend(const char *name)
{
- int i;
+ struct backend_init *i;
- for (i = 0; backend_names[i] != 0; i++)
- if (!strcasecmp(name, backend_names[i]))
+ for (i = backends; i->name; i++) {
+ if (!strcasecmp(name, i->name))
return i;
+ }
- return -1;
+ return NULL;
}
static GP_Backend *init_backend(const char *name, char *params,
- const char *caption, FILE *help)
+ const char *caption)
{
- int i = get_backend(name);
+ struct backend_init *init = get_backend(name);
GP_Backend *ret;
- if (i < 0) {
- GP_DEBUG(1, "Invalid backend name '%s'", name);
- print_help(help, "Invalid backend name");
+ if (!init) {
+ GP_WARN("Invalid backend name '%s'", name);
errno = EINVAL;
return NULL;
}
- ret = backend_inits[i](params, caption, help);
+ ret = init->init(params, caption);
return ret;
}
-GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help)
+GP_Backend *GP_BackendInit(const char *params, const char *caption)
{
if (params == NULL) {
- print_help(help, NULL);
+ do_help(NULL, NULL);
return NULL;
}
@@ -363,5 +363,5 @@ GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help)
GP_DEBUG(1, "Have backend name '%s' params '%s'", buf, backend_params);
- return init_backend(buf, backend_params, caption, help);
+ return init_backend(buf, backend_params, caption);
}
diff --git a/pylib/gfxprim/backends/backends.i b/pylib/gfxprim/backends/backends.i
index e893674..319129d 100644
--- a/pylib/gfxprim/backends/backends.i
+++ b/pylib/gfxprim/backends/backends.i
@@ -51,36 +51,7 @@ ERROR_ON_NULL(GP_BackendLinuxX11Init);
%newobject GP_BackendX11Init;
%include "GP_X11.h"
-/*
- * Backend Init with a typemap for FILE* for the last parameter
- *
- * This is a ugly hack because Python 3 uses its own I/O buffers for file
- * objects.
- *
- */
-%typemap(in) FILE* {
- if ($input != Py_None) {
- int fd = PyObject_AsFileDescriptor($input);
-
- if (fd < 0) {
- PyErr_SetString(PyExc_TypeError, "$1_name must be a file type.");
- return NULL;
- }
-
- $1 = fdopen(dup(fd), "w");
- }
-}
-
-%exception GP_BackendInit {
-$action
-
- //HACK: fclose the FILE*
- fclose(arg3);
-
- if (result == NULL)
- return PyErr_SetFromErrno(PyExc_OSError);
-}
-
%newobject GP_BackendInit;
+ERROR_ON_NULL(GP_BackendInit);
%include "GP_BackendInit.h"
http://repo.or.cz/w/gfxprim.git/commit/48c629b8a273d8e72d4e381fc86f930fc8bf…
commit 48c629b8a273d8e72d4e381fc86f930fc8bf14a7
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 22 18:54:51 2013 +0100
spiv: Print backend help if only '-b help' was passed
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index b3139d9..33b0971 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -752,6 +752,12 @@ int main(int argc, char *argv[])
params.sleep_ms = 1000 * config.slideshow_delay + 0.5;
if (opts >= argc) {
+
+ if (!strcmp(config.backend_init, "help")) {
+ init_backend(config.backend_init);
+ return 0;
+ }
+
fprintf(stderr, "Requires path to at least one imagenn");
print_help();
return 1;
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/backend_example.c | 4 +-
demos/c_simple/backend_timers_example.c | 2 +-
demos/c_simple/blittest.c | 2 +-
demos/c_simple/fileview.c | 2 +-
demos/c_simple/fonttest.c | 2 +-
demos/c_simple/input_example.c | 4 +-
demos/c_simple/koch.c | 2 +-
demos/c_simple/linetest.c | 2 +-
demos/c_simple/randomshapetest.c | 2 +-
demos/c_simple/shapetest.c | 2 +-
demos/c_simple/textaligntest.c | 2 +-
demos/c_simple/virtual_backend_example.c | 4 +-
demos/particle/particle_demo.c | 2 +-
demos/py_simple/backends.py | 2 +-
demos/spiv/spiv.c | 8 +-
demos/spiv/spiv_help.c | 4 +-
doc/Makefile | 3 +-
doc/backends.txt | 29 +-
doc/backends_python.txt | 6 +-
doc/basic_types.txt | 1 +
doc/convert.txt | 39 +++
doc/gfx.txt | 2 +
include/backends/GP_BackendInit.h | 9 +-
libs/backends/GP_BackendInit.c | 456 +++++++++++++++---------------
pylib/gfxprim/backends/backends.i | 31 +--
25 files changed, 322 insertions(+), 300 deletions(-)
create mode 100644 doc/convert.txt
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.")
1
0
21 Dec '13
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 442c7288654c4fd015c2a77f52b3b38ce9a82d0e (commit)
from 6fb527824eda1a4f749d1212a1fcadd680b4bd36 (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/442c7288654c4fd015c2a77f52b3b38ce9a8…
commit 442c7288654c4fd015c2a77f52b3b38ce9a82d0e
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Dec 21 23:04:27 2013 +0100
loaders: PNG: Enable save for RBGA8888
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 937bb34..384d599 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -459,6 +459,10 @@ static int prepare_png_header(const GP_Context *src, png_structp png,
color_type = PNG_COLOR_TYPE_GRAY;
break;
#endif
+ case GP_PIXEL_RGBA8888:
+ bit_depth = 8;
+ color_type = PNG_COLOR_TYPE_RGB | PNG_COLOR_MASK_ALPHA;
+ break;
default:
return 1;
break;
@@ -482,6 +486,10 @@ static int prepare_png_header(const GP_Context *src, png_structp png,
case GP_PIXEL_RGB888:
png_set_bgr(png);
break;
+ case GP_PIXEL_RGBA8888:
+ png_set_bgr(png);
+ png_set_swap_alpha(png);
+ break;
case GP_PIXEL_G1:
case GP_PIXEL_G2:
case GP_PIXEL_G4:
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_PNG.c | 8 ++++++++
1 files changed, 8 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.")
1
0