Commit Graph

92 Commits

Author SHA1 Message Date
John Cupitt 976db37f84
Revised threading system (#3105)
* reimplement threadpool

just a set of threads that get recycled

"ninja test" passes and dzsave seems to work, though pytest fails for
some reason

* clean up threading code a bit

move base stuff into thread.c, so we have a simple

	thread -> threadset -> threadpool

layering

* start trying to revert g_threadpool

based on the original commit

* working!

nice low systime again

still need to repply cnages to threadpool.c since 80e0cc3d1

* reapply fixes from master

so threadpool.c is now up to date

* rename VipsThread as VipsWorker

a bit less confusing

* use a semaphore to count workers in a pool

* tidy up

* formatting

* dynamic threadpool sizing

based on counting the number of blocked threads in each pool

it works, but the improvement is not great :(

* add "concurrency" metadata item

so operators can hint threadpool size (dzsave especially)

* don't use thinstrip for small images

* add RGB mode to openslide

since flatten was taking 20% of CPU time for dzsave

* fix up rgb mode

now actually works

* make the tile buffer per thread

in the new openslideload rgb mode

* fix dynamic pool downsize

* mild refactoring

* fix the buffer system

oops, turned it off by mistake

* all done!

* revise changelog

* Update libvips/iofuncs/threadset.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* Update libvips/iofuncs/threadset.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* LSan: add libMagickCore to suppression file

* Revert "Remove mutex lock for VipsThreadStartFn"

This reverts commit 41440491.

* add VIPS_MAX_THREADS

to set a hard limit on the threadset size

* Revert "Revert "Remove mutex lock for VipsThreadStartFn""

This reverts commit 77e8520966ba79194fff3b4e648bbd295cd5c260.

* remove sslock from sink.c

* move fixed threadpool build to init

not first use

* add some doc comments

* revert test suite threshold change

* add a test for MAX_THREADS

and move the test tmp/ area into the builddir

* limit VIPS_MAX_THREADS to sane values

* use tabs rather than spaces

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2022-10-26 15:25:19 +01:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
John Cupitt c24e47e3a8 fix profile attach on colour output
some dead code needed removing

https://github.com/libvips/libvips/issues/1194#issuecomment-455164899
2019-01-17 16:36:25 +00:00
Dimitri Bouron 5f61727253 Fix black channel overwrite in XZY2CMYK.c 2019-01-16 19:06:36 +01:00
John Cupitt 8ded32ac20
Merge branch 'master' into cmyk2srgb 2019-01-12 14:39:20 +00:00
Dimitri Bouron d87bf01fdc Add cmyk <-> xyz default colourspace conversion
If no lcms2 library has been found, fallback to default
cmyk <-> xyz conversion.
Please note that it is an approximative conversion.
2019-01-11 11:48:25 +01:00
John Cupitt 28999aa5b6 add vips_profile_load()
and use it in icc_transform
2019-01-10 22:48:21 +00:00
John Cupitt c5d0ca8300 add cmyk2xyz and back
seems to work, still to do:

- tests
- try:

```
$ vipsthumbnail NordicsLIQUOR-SFBag_300_cmyk.JPG

(vipsthumbnail:7868): VIPS-WARNING **: 16:53:17.166: profile incompatible with image
```

see https://github.com/libvips/libvips/issues/1186
2018-12-27 17:35:35 +00:00
John Cupitt 5a48408925 fix licence comments
three files had the wrong licence attached in a copy-paste error

thanks kadt!

see https://github.com/libvips/libvips/issues/1121
2018-10-05 06:06:08 +01:00
John Cupitt e46a56e137 remove lcms1 support
it had bitrotted and no longer worked properly
2017-08-02 13:39:28 +01:00
John Cupitt ba129fceb3 better win32 compatibility
try to fold the patches @tumagonx maintains into libvips master, see:

https://github.com/tumagonx/pygi-mingw-patches/blob/master/vips-8.4.x.patch

still missing the bindtextdomain() patch though
2017-05-11 17:08:10 +01:00
John Cupitt 362c7efdfc argh reapply seq removal 2017-03-06 11:55:38 +00:00
John Cupitt e6b20cbd0f Revert "remove stalling"
This reverts commit 959f412380.
2017-02-27 10:26:32 +00:00
John Cupitt 959f412380 remove stalling 2017-02-21 15:03:15 +00:00
John Cupitt 6b325145e4 use new hints and prepare everywhere 2017-01-12 14:36:44 +00:00
John Cupitt c081f51ffc fix a compiler warning 2016-05-04 13:20:19 +01:00
John Cupitt 213f9e23b4 count colour pixels
more overcomputation testing
2016-03-24 17:41:05 +00:00
John Cupitt 35650c2244 reduce the number of copy() ops
reduce the number of copy() ops issued during colour conversion
2016-02-26 14:05:35 +00:00
John Cupitt a812e90332 add some docs 2015-06-22 09:42:53 +01:00
John Cupitt bdc96844bd Merge branch 'master' into add-hsv 2015-06-22 09:35:41 +01:00
John Cupitt 14dfda4e02 improve colour docs 2015-06-22 09:35:16 +01:00
John Cupitt f5b6f2d0f7 update docs for scRGB 2015-06-22 07:21:36 +01:00
John Cupitt a42232a9a1 boilerplate for hsv colourspace 2015-06-09 10:18:30 +01:00
John Cupitt 2f060c494d fix up translations 2015-04-24 15:03:09 +01:00
John Cupitt a0aacad871 much better convert to greyscale
mix RGB channels as .2, .7, .1 in linear light

see https://github.com/jcupitt/libvips/issues/266
2015-04-17 11:33:27 +01:00
John Cupitt 8f7c2c7110 sort out alpha going to and from 16-bit
rewritten sRGB <-> scRGB so that 16-bit alpha is scaled to float 8
2015-02-12 17:50:38 +00:00
John Cupitt 244ab301f7 start final push for vips 8 2015-02-11 17:01:02 +00:00
John Cupitt fd1db58189 rename VipsColourSpace as VipsColourTransform
to avoid confusion with VipsColourspace

an internal class, no API change
2015-01-04 21:44:54 +00:00
John Cupitt 394149e9e8 fix all docs warnings 2014-11-17 10:32:40 +00:00
John Cupitt 0a327af138 fixed extra band handling, again 2014-09-24 14:46:03 +01:00
John Cupitt 06366cf75b fix up deCMC again 2014-09-24 13:16:38 +01:00
John Cupitt d7083d7a03 make arrayimage ref/unref 2014-09-23 14:38:46 +01:00
John Cupitt b69613e06a working! 2014-09-20 16:52:44 +01:00
John Cupitt 63fd45f7ad not quite there 2014-09-19 14:59:45 +01:00
John Cupitt 1e6cd1b1a5 clean up length return
read file to mem was using uint for length for historical reasons
2014-09-18 10:19:24 +01:00
John Cupitt fb489bad53 move vips_image_decode() into the public API 2014-02-03 14:29:57 +00:00
John Cupitt affb274d85 more auto unpack hacking 2014-01-23 13:19:37 +00:00
John Cupitt 853124757b small polishes 2013-11-27 17:31:07 +00:00
John Cupitt eb3ad6d64f add lots of instrumentation
also svg output
2013-11-26 14:57:56 +00:00
John Cupitt 82f680484c vips_colourspace() could fail
for images with alpha channels
2013-11-14 13:55:23 +00:00
John Cupitt 0257dda270 first hack at supporting XYZ PCS
still need to fix new encode / decode
2013-11-12 14:58:59 +00:00
John Cupitt 12cf71a6a9 combin copy_fields and demand_hint
We had two API calls, vips_image_copy_fields() and vips_demand_hint().
They are now combined in the single vips_image_pipeline() call.

All operations are now slightly smaller and simpler.
2013-10-22 09:29:40 +01:00
John Cupitt 440b800e0e add a new unbuffered seq mode
things like

	vips copy huge.png x.v

now run with only a small line cache
2013-09-29 11:04:11 +01:00
John Cupitt 2fd2fd58f7 fix up gtk-doc
fix various problems:

- out of date IGNORE in doc/reference/Makefile.am
- name clashes between private .h and public
2013-06-17 20:16:20 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00
John Cupitt 89ff89ebf8 remove sRGB2XYZ and back
now go via scRGB
2012-12-12 12:43:26 +00:00
John Cupitt c341f0d134 add scRGB functions 2012-12-11 15:25:28 +00:00
John Cupitt 1ceb85eb5b move colour_dispatch to deprecated 2012-12-04 10:23:42 +00:00
John Cupitt 4c5dd969bc rename colour_convert as colourspace
also rework im_icc_ac2rc
2012-11-01 14:59:20 +00:00
John Cupitt 8e72d25c9a better colourspace sniffing 2012-11-01 13:16:54 +00:00