diff options
author | Øyvind Kolås <pippin@gimp.org> | 2017-08-29 11:51:17 +0200 |
---|---|---|
committer | Øyvind Kolås <pippin@gimp.org> | 2017-08-30 03:53:57 +0200 |
commit | dea8d7a3007bd4f7fb69d1cf1bb2b9657ab2bcb1 (patch) | |
tree | 4d74801dd67e2f21a0fc3e409a6848664c3cfe85 /babl/babl-fish.c | |
parent | e12890613906736411e89710f67a5525dfa55d51 (diff) |
babl: on demand clone sRGB conversions
When a new RGB space is encountered clone all sRGB space to sRGB space
conversions, under the assumption that they are implemented respecting/using
the customizable TRCs of babl.
Diffstat (limited to 'babl/babl-fish.c')
-rw-r--r-- | babl/babl-fish.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/babl/babl-fish.c b/babl/babl-fish.c index 4cc4924..587c549 100644 --- a/babl/babl-fish.c +++ b/babl/babl-fish.c @@ -169,9 +169,9 @@ babl_fish_get_id (const Babl *source, /* value of 'id' will be used as argument for hash function, * substraction serves as simple combination of * source/destination values. */ - ptrdiff_t id = source - destination; + int id = (((int)source * 93)) ^ ((int)destination); /* instances with id 0 won't be inserted into database */ - id *= ((((size_t) (source))) % 37); + id *= ((((size_t) (destination))) % 37); if (id == 0) id = 1; @@ -254,12 +254,12 @@ babl_fish (const void *source, * path. */ babl_hash_table_find (id_htable, hashval, find_fish_path, (void *) &ffish); - if (ffish.fish_path) { /* we have found suitable fish path in the database */ return ffish.fish_path; } + if (!ffish.fish_fish) { /* we haven't tried to search for suitable path yet */ @@ -269,6 +269,7 @@ babl_fish (const void *source, { return fish_path; } +#if 1 else { /* there isn't a suitable path for requested formats, @@ -287,6 +288,7 @@ babl_fish (const void *source, fish->fish.destination = destination_format; babl_db_insert (babl_fish_db (), fish); } +#endif } } |