Øyvind Kolås [Sun, 29 Nov 2009 15:42:05 +0000 (15:42 +0000)]
Only initialize test buffers once
Also made the test buffer static inline for individual conversions like
it already was for fish paths.
Note, this relies on none of the tested conversions by accident
being buggy enough to modify their source data, adding a sanity
function that compares the buffers with the correct values could
perhaps be useful.
Øyvind Kolås [Tue, 24 Nov 2009 01:04:38 +0000 (01:04 +0000)]
Removed two function calls in common path
Re-arranged code making babl_process and babl_fish_process reside
in babl-path-fish.c, where babl_fish_process and babl_fish_path_process
can be inlined with babl_process().
Øyvind Kolås [Sat, 21 Nov 2009 18:31:50 +0000 (18:31 +0000)]
Fix accidental use of the format mutex instead of the debug mutex.
The memory statistics book-keeping was reusing the BablFormat flag mutex
thus deadlocking with pthreads mutexes since they are not recursive by
default.
Øyvind Kolås [Sat, 21 Nov 2009 16:47:24 +0000 (16:47 +0000)]
Made BablFishPath thread safe.
Refactored static variables away and added a lock to protect state
keeping inside the individual BablFormat when permutating possible
conversion paths.
Martin Nordholts [Thu, 19 Nov 2009 18:59:10 +0000 (19:59 +0100)]
tests: Add pthread based concurrency stress test for babl_fish()
Add a test that runs a bunch of pthread threads, all trying to use
babl_fish() at the same time. This test currently fails and it is the
goal of bug 587675 to make it pass.
The cause of the failure is the static variables in babl-fish-path.c.
In particular 'current_path' clearly needs to be moved to some
instance variable.
Rename CIE-Lab.c to CIE.c so that we can keep more CIE color spaces in
a single file. It would be overkill to separate the common code for
other color spaces into shared files.
Danny Robson [Sun, 19 Jul 2009 12:50:37 +0000 (22:50 +1000)]
Change occurences of assert (0) into babl_fatal()
babl_fatal() is the more appropriate method to die upon failure, so
all instances of assert (0) have been changed into babl_fatal() with
some attempt of an error message.
In this process, the babl_fish_process() method was refactored into
using the existing case statement.
Danny Robson [Sun, 19 Jul 2009 11:35:40 +0000 (21:35 +1000)]
Change sprintf() to babl_strcat() in model create_name()
babl/babl-model.c create_name uses an unsafe incantation of sprintf
to build names from concatenated components which should ideally use a
"%s" format specifier preceding the instance name.
Instead of fixing this, we replace it with a babl_strcat() based
alternative which allows us to remove the thread-unsafe static character
buffer at the cost of a few mallocs and a free.
Also do some cleanups, mainly to avoid two exit points from the
function, that increases readability and warns if a model with the
same name is registered twice.
Martin Nordholts [Tue, 14 Jul 2009 18:06:27 +0000 (20:06 +0200)]
Enable automake silent-rules by default
Enable silent build rules by default, requires at least
Automake-1.11. Disable by either passing --disable-silent-rules to
configure or passing V=1 to make.
Martin Nordholts [Tue, 14 Jul 2009 17:55:20 +0000 (19:55 +0200)]
Generate ChangeLog from git log
Add rule to generate ChangeLog from git log, copied from pango and
Behdad Esfahbod. Also disable the rss generation in docs since the rss
tool can't handle the git log format.
Martin Nordholts [Tue, 14 Jul 2009 17:33:56 +0000 (19:33 +0200)]
babl: Don't declare functions with external linkage as inline
Don't declare functions with external linkage as inline. The way we
did it is forbidden in C99 and causes compilation problems on other
platforms. See bug #572154.
Martin Nordholts [Wed, 20 May 2009 20:27:27 +0000 (22:27 +0200)]
docs: Add .libs directories to BABL_PATHs
Also add .libs directories to the BABL_PATHs so that e.g. the
BablFishPath introspection chart is properly generated when doing a
build, at least on Linux.
Kevin Cozens [Fri, 27 Mar 2009 20:13:01 +0000 (20:13 +0000)]
Applied patch from Matteo 'Peach' Pescarin which makes build use rsvg
* configure.ac:
* docs/graphics/Makefile.am: Applied patch from Matteo 'Peach'
Pescarin which makes build use rsvg binary instead of inkscape
to create pngs. Fixes bug 571516.
Martin Nordholts [Wed, 25 Mar 2009 19:02:35 +0000 (19:02 +0000)]
Handle variadic macros in a portable way
Apply patch from Gary V. Vaughan that adds configure time checks for
variadic macros and adapts the definitions of such macros in-code
accordingly so that babl can be compiled on more platforms.
Martin Nordholts [Sat, 24 Jan 2009 08:52:04 +0000 (08:52 +0000)]
Do a complete overhaul of the babl API.
* babl/babl.h: Instead of including subsystem headers, declare the
functions part of the API directly in the header. The public
types, macros and the version header is still pulled in as
includes but with inclusion guards that prevent them from being
included separately by clients. Notable things removed from the
API is internal class functions and the class instance structs.
(babl_format_has_alpha)
(babl_format_get_bytes_per_pixel)
(babl_format_get_num_of_components)
(babl_format_get_type): New getters to allow the Babl union to
become opaque for clients.
* babl/babl-types.h: New file with public types. Currently only
the opaque Babl union and the linear and planar conversion
function prototypes (which are not used in the API due to the use
of varags but still part of the API for reference) are there. Make
sure it's only included indirectly through babl.h.
* babl/babl-macros.h
* babl/babl-version.h.in: Make sure these are not included
directly, only indirectly through babl.h.
* babl/babl-main.h: Removed, function declarations are in babl.h
now.
* babl/babl-internal.h: Include the headers we now consider
internal, mostly the different class headers.
* babl/babl-class.h: The "named class" function declarations are
now in the public header so move them away from this internal
header.
Martin Nordholts [Sun, 18 Jan 2009 15:14:59 +0000 (15:14 +0000)]
Do a s/babl_destroy/babl_exit since 'destroy' is better paired
with a 'create' and other libraries also use the 'init'/'exit'
pair, including GEGL. Keep a define for babl_destroy unless
BABL_DISABLE_DEPRECATED is defined.
Martin Nordholts [Sun, 18 Jan 2009 13:33:52 +0000 (13:33 +0000)]
New file collecting the type constants, includes and the union for the
* babl/babl-classes.h: New file collecting the type constants,
includes and the union for the babl classes. When adding a new
class this is the only installed header file that requires
modification.
* babl/babl-class.h: Move the class type enums to the new file.
* babl/babl.h: Include babl-classes.h instead of each class on its
own, and move the Babl union to the new file.
* babl/babl-component.h
* babl/babl-conversion.h
* babl/babl-extension.h
* babl/babl-format.h
* babl/babl-model.h
* babl/babl-type.h: allow to disable the defines that were added
for backward compatibility by definining
BABL_DISABLE_DEPRECATED.
Martin Nordholts [Sat, 17 Jan 2009 13:33:49 +0000 (13:33 +0000)]
Instead of having BABL_CLASS() plus variants and making the macros
expand to different things depending on if they are used in a
header or a .c file, have two versions: BABL_CLASS_DECLARE() and
BABL_CLASS_IMPLEMENT(). This enables further refactorisations of
the babl.h header.
* babl.h: Do the name changes and remove the unpleasant #undefs at
the bottom.