summaryrefslogtreecommitdiff
path: root/babl/babl-internal.h
Commit message (Collapse)AuthorAge
...
* babl: make some of the new space API internal for nowØyvind Kolås2017-08-19
|
* add BablTRC class, that handles gamma or sRGBØyvind Kolås2017-08-19
| | | | Done this way, it is easily extendable to also handle LUTs.
* make use of babl space for reference computationsØyvind Kolås2017-08-18
|
* Add the BablConversion as first argument of all conversionsØyvind Kolås2017-08-18
| | | | | This is neccesary to be able to access state of source/destination from within registered conversions.
* babl: clean up various syntax bugs.Jehan2017-07-16
| | | | Trailing whitespaces, tabs, etc.
* babl-internal: tidy up some log messagesØyvind Kolås2017-06-13
|
* bug #783704, Check db NULL to avoid segfault if babl not initiated,Guiu Rocafort2017-06-13
|
* babl-cache: incorporate BABL_PATH_LENGTH in headerØyvind Kolås2016-11-23
|
* remove babl-fish-statsØyvind Kolås2016-11-19
|
* babl-cache: store tolerance as part of cache versioningØyvind Kolås2016-11-15
|
* move fish cache to own .c fileØyvind Kolås2016-11-15
|
* babl_parse_double: permit 0 and 9 after .Øyvind Kolås2015-06-21
| | | | | spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not possible.
* add internal babl_parse_double; to avoid using atofØyvind Kolås2014-06-09
| | | | | atof is locale dependent; it was being used two places parsing floating point values from environment variables.
* resolve ambiguous calling of real_babl_log with va_argsPaul Fredrickson2014-03-20
| | | | | | | | | | | | | | | | | | | | In babl-internal.h there are two different ways of calling real_babl_log. One matches the macro definitions of babl_log which expects an arbitrary number of parameters, and the other is to pass a va_list used to access those parameters. The latter case can be found in the function definition of babl_log when an appropriate macro definition is not selected. It may be that some platforms implement varargs in such a way that passing a va_list pointing to the params of another call stack is the same as passing those parameters directly, but that definitely isn't the case on mac OS X, where this results in corrupted strings when calling babl_log or babl_fatal. The solution here is to create a varargs-enabled version of real_babl_log that accepts a va_list, and have all calls eventually call into that. (This may not be seen under normal configurations. This was discovered while trying to build with a hand-crafted config.h in Xcode.)
* Use a static set of reference pixelsDaniel Sabo2014-01-30
| | | | | The ref pixels are stored in babl/babl-ref-pixels.inc which is generated by tools/babl-gen-test-pixels.
* Mostly remove BablImage from babl-fish-reference.cDaniel Sabo2013-10-15
| | | | | There is no valid way to trigger these paths, and the BABL_IS_BABL call on image data produces false positives (see bug 698913).
* constify APIØyvind Kolås2012-03-18
|
* babl: add ability to register user data with BablModelØyvind Kolås2012-03-17
| | | | | | The user data is available in the callback functions, no ABI change only processing functions interested in this data needs to define the arguments,.. keeping ABI compatibility.
* constify source argument of babl_processØyvind Kolås2012-03-15
|
* get rid of hack_hack(), use NEEDS_BABL_DB insteadNils Philippsen2011-05-26
|
* disable DEBUG_MEMØyvind Kolås2010-12-18
| | | | | This option provides a hit in multithreaded use, and should only be enabled when debugging babl memory allocation internals.
* Port all of babl to use use babl_set_destructorØyvind Kolås2010-06-27
| | | | | | Making all babl objects be free-able with babl_free means that overall management code can be directly shared between the different babl-classes.
* Removed two function calls in common pathØyvind Kolås2009-11-24
| | | | | | 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().
* Made BablFishPath thread safe.Øyvind Kolås2009-11-21
| | | | | | Refactored static variables away and added a lock to protect state keeping inside the individual BablFormat when permutating possible conversion paths.
* Added a mutex to memory sanity counters.Øyvind Kolås2009-11-21
| | | | | | Also added a BABL_DEBUG_MEM define which is set to 1 in babl-internal.h that can be used to disable these locks which only are nedded when debugging.
* Added a BablMutex type.Øyvind Kolås2009-11-21
| | | | | Mutex abstraction for internal use pthreads by default and critical sections on win32.
* Make use of system return value to avoid warningsDanny Robson2009-07-19
| | | | | Make (minimal) use of system's return value to avoid gcc complaining, as it's declared using the warn_unused_result attribute.
* Avoid the need for define __func__ "unknown" on some vendor compilersMartin Nordholts2009-03-31
| | | | | | Patch from Gary V. Vaughan svn path=/trunk/; revision=408
* Handle variadic macros in a portable wayMartin Nordholts2009-03-25
| | | | | | | | 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. svn path=/trunk/; revision=400
* based on a patch from Gary V. Vaughan, include "config.h" before any otherSven Neumann2009-02-24
| | | | | | | | | | | | | | | | 2009-02-24 Sven Neumann <sven@gimp.org> * */*.c: based on a patch from Gary V. Vaughan, include "config.h" before any other header file from all .c files. * babl/babl-internal.h * extensions/util.h: instead of including config.h from here, bail out if it wasn't included beforehand. svn path=/trunk/; revision=394
* Do a complete overhaul of the babl API.Martin Nordholts2009-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. * babl/babl-image.h * babl/babl-format.h * babl/babl-fish.h * babl/babl-extension.h * babl/babl-conversion.h * babl/babl-component.h * babl/babl-classes.h * babl/babl-introspect.h * babl/babl-sampling.h * babl/babl-model.h * babl/babl-type.h: Adapt to above changes, move relevant things to babl.h * babl/base/formats.c * babl/base/model-gray.c * babl/base/model-rgb.c * babl/base/model-ycbcr.c * babl/base/type-float.c: Explicitly #include "babl-classes.h". * babl/babl-internal.c: s/babl_name/babl_get_name/ * babl/babl-format.c (babl_format_has_alpha) (babl_format_get_bytes_per_pixel) (babl_format_get_num_of_components) (babl_format_get_type): Implement these. * babl/Makefile.am: Don't install the now internal headers and add, remove and install the other headers according to above changes. svn path=/trunk/; revision=390
* Since babl_foo_from_id() will not be part of the public API we canMartin Nordholts2009-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revert to having the short variant babl_foo() instead of babl_foo_from_name(). * babl/babl-class.h * babl/babl-component.h * babl/babl-conversion.c * babl/babl-conversion.h * babl/babl-extension.h * babl/babl-fish-path.c * babl/babl-fish.c * babl/babl-format.c * babl/babl-format.h * babl/babl-image.c * babl/babl-internal.h * babl/babl-model.c * babl/babl-model.h * babl/babl-type.c * babl/babl-type.h * extensions/CIE-Lab.c * extensions/frequency.c * extensions/gegl-fixups.c * extensions/gggl-lies.c * extensions/gggl.c * extensions/gimp-8bit.c * extensions/naive-CMYK.c * extensions/sse-fixups.c * tests/grayscale_to_rgb.c * tests/rgb_to_bgr.c * tests/rgb_to_ycbcr.c svn path=/trunk/; revision=389
* s/babl_foo_init/babl_foo_class_init/Martin Nordholts2009-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s/babl_foo_destroy/babl_foo_class_destroy/ s/babl_foo_each/babl_foo_class_for_each/ s/babl_foo/babl_foo_from_name/ s/babl_foo_id/babl_foo_from_id/ * babl/babl-class.h * babl/babl-conversion.c * babl/babl-core.c * babl/babl-fish-path.c * babl/babl-fish-reference.c * babl/babl-fish-stats.c * babl/babl-fish.c * babl/babl-format.c * babl/babl-image.c * babl/babl-internal.h * babl/babl-introspect.c * babl/babl-model.c * babl/babl-sampling.c * babl/babl-sanity.c * babl/babl-type.c * babl/babl.c * babl/base/formats.c * babl/base/model-gray.c * babl/base/model-rgb.c * babl/base/model-ycbcr.c * babl/base/type-float.c * babl/base/type-u16.c * babl/base/type-u32.c * babl/base/type-u8.c * extensions/CIE-Lab.c * extensions/frequency.c * extensions/gegl-fixups.c * extensions/gggl-lies.c * extensions/gggl.c * extensions/gimp-8bit.c * extensions/naive-CMYK.c * extensions/sse-fixups.c * tests/babl-html-dump.c * tests/babl_fish_path_fitness.c * tests/conversions.c * tests/formats.c * tests/grayscale_to_rgb.c * tests/models.c * tests/rgb_to_bgr.c * tests/rgb_to_ycbcr.c * tests/types.c svn path=/trunk/; revision=381
* Formating.Martin Nordholts2009-01-17
| | | | | | * babl/babl-internal.h: Formating. svn path=/trunk/; revision=375
* Instead of having BABL_CLASS() plus variants and making the macrosMartin Nordholts2009-01-17
| | | | | | | | | | | | | | | | | | | | | | | | 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. * babl-internal.h: Do the name changes. * babl-component.[ch] * babl-conversion.[ch] * babl-extension.[ch] * babl-fish.[ch] * babl-format.[ch] * babl-image.h * babl-model.[ch] * babl-sampling.h * babl-type.[ch]: Adjust to changes. svn path=/trunk/; revision=370
* Remove BABL_HARD_MAX_PATH_LENGTH from here, it's only for internal use.Martin Nordholts2009-01-14
| | | | | | | | | | | * babl/babl.h: * babl/babl-internal.h: Remove BABL_HARD_MAX_PATH_LENGTH from here, it's only for internal use. * babl/babl-fish-path.c: #define BABL_HARD_MAX_PATH_LENGTH locally here. svn path=/trunk/; revision=361
* Don't just eek when an assertion fails, also say exactly what failed.Martin Nordholts2008-12-08
| | | | | | | * babl/babl-internal.h (babl_assert): Don't just eek when an assertion fails, also say exactly what failed. svn path=/trunk/; revision=359
* Added support for CPU acceleration, RGBA float -> RGB u8 and RGBA float ->Jan Heller2008-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-05-23 Jan Heller <jheller@svn.gnome.org> Added support for CPU acceleration, RGBA float -> RGB u8 and RGBA float -> RGBA u8 SSE accelerated conversions. * babl/Makefile.am: Added babl-cpuaccel.[ch]. * babl/babl-cpuaccel.h: * babl/babl-cpuaccel.c (babl_cpu_accel_get_support), (babl_cpu_accel_set_use), (arch_get_vendor), (arch_accel_intel), (arch_accel_amd), (arch_accel_centaur), (arch_accel_cyrix), (sigill_handler), (arch_accel_sse_os_support), (arch_accel), (cpu_accel): Runtime CPU detection code. Ported from GIMP. * babl/babl-internal.h: Include babl-cpuaccel.h. * babl/babl-memory.c (babl_malloc): Make babl_malloc align memory to BABL_ALIGN==16 boundaries. * babl/babl.c (babl_init): Enabled CPU acceleration. * configure.ac: Added compile time MMX/SSE/AltiVec detection. Ported from GIMP. * extensions/Makefile.am: Added SSE_EXTRA_CFLAGS for sse-fixups.c compilation. * extensions/sse-fixups.c (conv_rgbaF_linear_rgb8_linear), (conv_rgbaF_linear_rgba8_linear), (init): Added RGBA float -> RGB u8 and RGBA float -> RGBA u8 SSE accelerated conversions. svn path=/trunk/; revision=316
* changed fallback macro to have the same return type as rint().Sven Neumann2008-05-21
| | | | | | | | | 2008-05-21 Sven Neumann <sven@gimp.org> * babl/babl-internal.h (rint): changed fallback macro to have the same return type as rint(). svn path=/trunk/; revision=314
* fallback to floor function when rint function is not available.Jan Heller2008-05-20
| | | | | | | | | | | | | | | | | | | | 2008-05-21 Jan Heller <jheller@svn.gnome.org> * babl/babl-internal.h: * babl/base/type-u16.c: * babl/base/type-u32.c: * babl/base/type-u8.c: * extensions/CIE-Lab.c: * extensions/gegl-fixups.c: * extensions/gggl-lies.c: * extensions/gggl.c: * extensions/gimp-8bit.c: * extensions/util.h: fallback to floor function when rint function is not available. * configure.ac: added check for rint function. svn path=/trunk/; revision=313
* removed babl-classes.h removed and mostly folded into ... .. this file,Øyvind Kolås2008-04-15
| | | | | | | | | | | | | | | | | | | | | | | * babl/Makefile.am: removed babl-classes.h * babl/babl-classes.h: removed and mostly folded into ... * babl/babl.h: .. this file, which has been reorganized to contain each separate class by itself. * babl/babl-internal.h: simplified code renamed BABL_CLASS_TEMPLATE to be just BABL_CLASS or BABL_CLASS_MINIMAL. * babl/babl-fish.c: (babl_fish): do not accept varargs, use use BABL_CLASS_MINIMAL. * babl/babl-component.c: * babl/babl-conversion.c: * babl/babl-extension.c: * babl/babl-format.c: * babl/babl-model.c: * babl/babl-type.c: use BABL_CLASS instead of BABL_CLASS_TEMPLATE * babl/babl-hash-table.h: * babl/babl-list.h: * babl/babl-db.h: changed include warning since babl-classes doesn't exist anymore. svn path=/trunk/; revision=308
* extensions/util.h removed trailing whitespace.Sven Neumann2008-04-15
| | | | | | | | | 2008-04-15 Sven Neumann <sven@gimp.org> * extensions/util.h * babl/*.[ch]: removed trailing whitespace. svn path=/trunk/; revision=307
* Applied patch from Jan Heller that improves logic of go_fishing codeØyvind Kolås2008-04-08
| | | | | | | | | | | | | | | | | | | | in babl-fish.c. The current code searches list of all fishes while looking for suitable preexistent BABL_FISH_PATH instance. The new code only searches relevant part of database's hash table. Further, the current code searches for fish path every time such a babl fish is requested, even though the same fish path has been requested before and not found. The new code creates dummy BABL_FISH instance with appropriate source/destination formats and inserts it into the fish database to indicate that fish path has been searched for and not found. * babl/babl-fish.c: (find_fish_path), (find_memcpy_fish), (babl_fish_get_id), (babl_fish): * babl/babl-fish-path.c: (babl_fish_path): * babl/babl-fish-reference.c: (babl_fish_reference): * babl/babl-fish-simple.c: (babl_fish_simple): * babl/babl-internal.h: svn path=/trunk/; revision=304
* Sparse fixes.Mukund Sivaraman2008-04-03
| | | | | | | | | | | | | | | 2008-04-02 Mukund Sivaraman <muks@mukund.org> Sparse fixes. * babl/babl-internal.h: fflush() takes pointer. * babl/babl-conversion.c: Don't mix code and declarations. * babl/babl-fish-reference.c: Fixed array assignment. svn path=/trunk/; revision=302
* applied patch from Jan Heller that improves readability by using the newlyØyvind Kolås2008-04-01
| | | | | | | | | | | | | | | | | | | | | * babl/babl-classes.h: * babl/babl-conversion.c: * babl/babl-db.c: * babl/babl-fish-path.c: * babl/babl-fish.c: * babl/babl-format.c: * babl/babl-internal.h: * babl/babl-introspect.c: * babl/babl-list.c: * babl/babl-list.h: * babl/babl-model.c: * babl/babl-sampling.c: * babl/babl-sanity.c: * babl/babl-type.c: * babl/babl-util.[ch]: applied patch from Jan Heller that improves readability by using the newly introduced BablList structure. svn path=/trunk/; revision=300
* Applied patch from Jan Heller that introduces list and hash tableSven Neumann2008-03-22
| | | | | | | | | | | | | | | | | | | | | | | 2008-03-22 Sven Neumann <sven@gimp.org> Applied patch from Jan Heller that introduces list and hash table functionality and changes the babl database to use coalesced hashing (bug #523507): * babl/Makefile.am * babl/babl-list.[ch] * babl/babl-hash-table.[ch]: new files providing list and hash table functionality. * babl/babl-internal.h: include the new header files. * babl/babl-db.[ch]: use the new code. * babl/babl-fish.c: changed accordingly. svn path=/trunk/; revision=294
* Const'ified code with Babl*'s refering to formats.Øyvind Kolås2007-12-29
| | | | | | | | | | | | * babl/babl.h: * babl/babl-classes.h: * babl/babl-fish-path.c: * babl/babl-fish-reference.c: * babl/babl-fish.c: * babl/babl-internal.[ch]: Const'ified code with Babl*'s refering to formats. svn path=/trunk/; revision=260
* Modified copyright statement to refer to an URL instead of a civic addressØyvind Kolås2007-11-11
| | | | | | | * Modified copyright statement to refer to an URL instead of a civic address for the Free Software Foundation and the text of the license. svn path=/trunk/; revision=249
* Upgraded babl from LGPLv2 to LGPLv3. Copyright statements in all filesØyvind Kolås2007-11-10
| | | | | | | | | | have been updated to reflect this change, the permission to use leter versions of the GNU licenses have been retained in all instances.) * COPYING: changed to GPLv3 * COPYING.LESSER: added (LGPLv3's overlay over GPLv3) svn path=/trunk/; revision=243
* applied patch from Tim Mooney fixing bug #392843, replacing _FUNCTION_Øyvind Kolås2007-01-21
| | | | | | | | * babl/babl-internal.h: applied patch from Tim Mooney fixing bug #392843, replacing _FUNCTION_ with _func_ which is the C99 equivalent of the gcc extension. svn path=/trunk/; revision=197