Commit Graph

105 Commits

Author SHA1 Message Date
John Cupitt feae09e9cd make arrayjoin much faster with large arrays
arrayjoin was making a region on every input image during startup, and
repeating for each thread (!!) so large arrays could be very expensive
to join.

Instead, make input regions on demand, and computre set of required
input images rather than searching for them.

See https://github.com/libvips/libvips/discussions/3247
2022-12-29 20:50:22 +00: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
Corentin Noël 69bf2be12b
Enhance the introspection support by fixing annotations (#2657)
Also refine the .metadata file
2022-02-15 10:54:40 +00:00
John Cupitt 362adae8c6
Revert "Enhance the introspection support by fixing annotations (#2655)" (#2656)
This reverts commit 47796dcda0.
2022-02-15 10:08:07 +00:00
Corentin Noël 47796dcda0
Enhance the introspection support by fixing annotations (#2655)
* Ensure that double asterisk characters are only used for gtk-doc comments

This triggers warnings when parsing the files with the introspection scanner
and gtk-doc

* Enhance the introspection support by fixing annotations

Also refine the .metadata file

Co-authored-by: John Cupitt <jcupitt@gmail.com>
2022-02-15 09:54:32 +00:00
John Cupitt 257d84108e fix some more introspection warnings 2022-02-15 09:48:01 +00:00
John Cupitt fee6a8a52b fix int overflow in vips_region_copy
this could cause crashes with very wide images, see:

https://github.com/libvips/libvips/issues/1989
2021-02-22 10:02:03 +00:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
John Cupitt cf5cad2b3e make pipe read limit configurable
We had a 1gb limit on the amount of data we would read from a pipe
before giving up.

This patch adds vips_pipe_read_limit_set() and makes this limit
configurable.

See: https://github.com/libvips/libvips/issues/1540
2020-02-03 16:57:10 +00:00
John Cupitt 4aeedd9711 add "nearest" region shrink 2020-01-30 16:53:18 +00:00
John Cupitt c14d7c254b add max and min to region_shrink
Add max and min to region_shrink. Useful with tiffsave and dzsave when
the image is (for example) line art. Thanks rgluskin.

See: https://github.com/libvips/libvips/issues/1490
2020-01-24 17:55:11 +00:00
John Cupitt ad98222073 better behaviour for vips_region_fetch()
we weren't clipping the fetch area against region valid, so in some
cases we could return many more pixels than expected

see https://github.com/libvips/pyvips/issues/103
2019-06-09 20:38:13 +01:00
John Cupitt 18c12fd66d remove some old sanity-checks
regions can have null generate now
2019-03-20 16:28:22 +00:00
John Cupitt a663a1bb1c add vips_region_fetch() etc.
to help ML applications ... they let us generate lots of small rectangular
areas of images very quickly
2019-03-12 16:00:24 +00:00
John Cupitt 33d90b5e26 only enable sanity checks in debug mode
We had a couple of sanity checks always on. As a result, libvips could
get slow for large pipelines.

Move them into g_assert().
2019-03-01 13:01:08 +00:00
John Cupitt 7b19ad8dc1 composite subimage positioning almost done
--x fails though? odd

vips composite2 Gugg_coloured.jpg PNG_transparency.png x.jpg over --x 600 --y 100

--x causes the dice to clip, but not translate
2018-12-06 18:28:55 +00:00
John Cupitt 1702529be0 add a compat stub for vips_region_shrink()
to keep ABI compat with 8.6
2018-08-29 09:50:35 +01:00
John Cupitt a373d2c876 add changelog notes for region_shrink 2018-06-13 17:36:36 +01:00
Simon Harris a14f3acdf5 Adds a first cut for region shrink mode 2018-03-28 21:59:17 +11:00
Simon Harris 442f4e55c9 Fix line lengths 2018-03-27 21:27:24 +11:00
Simon Harris eada4a7731 Adds MEAN and MEDIAN methods for region shrink 2018-03-27 21:15:48 +11:00
John Cupitt 24c07cfde2 revert an accidental ABI break
the new window manager code in 8.6.1 changed the prototype of an internal
function which was visible in the public API

this patch renames the function, adds it to an internal header instead,
and adds a stub for the old prototype

see https://github.com/jcupitt/libvips/issues/854
2018-01-12 11:56:17 +00:00
John Cupitt c5a7db6eb6 tiny cleanup 2017-12-10 20:03:58 +00:00
John Cupitt 3c0a2e4837 fix window cycling
we were repeatedly free-ing and new-ing input mmap windows ... this made
things like zoom out on large images in nip2 much slower than they
needed to be
2017-12-10 17:37:07 +00:00
John Cupitt c5139a0e50 doc fixups
various small things; fix the docs for composite, reduceh and reducev
2017-12-04 13:42:31 +00:00
John Cupitt fcec6d639b fix jaggies on the edge of affine output
and add a "background" param
2017-11-17 16:30:25 +00:00
John Cupitt a8bbe05596 tiny optimisations 2017-10-16 20:55:58 +01:00
Alistair Thomas 7452d046ca Update GObject introspection annotations for libvips/iofuncs directory 2017-09-30 13:31:00 +01:00
John Cupitt 846e4209f9 fix rounding in region shrink
we were not rounding int averages to nearest, thanks beaudet

see https://github.com/jcupitt/libvips/issues/659
2017-05-18 20:36:20 +01:00
John Cupitt 887eb249e4 revise region docs 2017-04-06 10:19:35 +01:00
John Cupitt 4bbd56fb0a handle transparency in vips_region_shrink()
we weren't multiplying through alpha in vips_region_shrink(), causing
fringing on pyramids with transparent elements

thanks sickrandir!

see https://github.com/jcupitt/libvips/issues/599
2017-02-23 17:04:25 +00:00
John Cupitt 2be0b97dce switch to g_warning()_/g_info()
we had vips_warn() and vips_info(), but they are a bit crappy ... switch
to g_warning() and g_info() instead

see https://github.com/jcupitt/libvips/issues/544
2017-01-03 15:52:27 +00:00
John Cupitt b6768a7e0f small speedup for reduceh 2016-08-01 12:04:15 +01:00
John Cupitt 7c55def6d7 remove error msg from start fail
just a debugging thing now
2016-07-29 15:13:59 +01:00
John Cupitt 1627440a37 remove a couple of IMAGE
still loads left, of course
2016-04-13 15:00:17 +01:00
John Cupitt 3c98ba78a0 small experiment 2016-03-22 14:19:32 +00:00
John Cupitt e8b5cb6c23 add VIPS_COUNT_PIXELS, overcomputation tracking
added VIPS_COUNT_PIXELS(), use like this:

	static int vips_shrinkh_gen( VipsRegion *or, ... )
	{
        	VIPS_COUNT_PIXELS( or, "vips_shrinkh_gen" );
	}

and on image close, if more than 100% of the pixels have been
calculated, you get a warning

only if you enable debugging, since this hurts perf slightly
2016-03-22 12:26:45 +00:00
John Cupitt 07a1903390 use g_assert_not_reached()
we were using g_assert(0) ... g_assert_not_reached() makes the
intention clearer
2016-01-24 13:21:53 +00:00
John Cupitt d88dd1ab72 fix a few coverity issues
a couple of minor bugs, and a lot of warnings
2015-09-30 09:54:50 +01:00
John Cupitt a00db6c8f1 doc cleanups 2015-04-24 12:49:50 +01:00
John Cupitt 187a12987a add vips_region_shrink()
add fast x2 region shrink

aim to share between pyramid builders
2015-02-14 13:44:32 +00:00
John Cupitt 29d073c04c now compiles cleanly with -Wstrict-prototypes
some downstream packages were seeing lots of spurious warnings
2015-01-21 09:02:56 +00:00
John Cupitt 394149e9e8 fix all docs warnings 2014-11-17 10:32:40 +00:00
John Cupitt 7d19abbae3 fix vips_region_paint() for float types 2014-09-25 17:40:41 +01:00
John Cupitt 573b94e3ec more docs argh 2014-08-19 17:57:27 +01:00
John Cupitt 16830d6937 vips_sink_screen() now invalidates for you
clients no longer need to call vips_image_invalidate_all()
2014-01-28 13:08:02 +00:00
John Cupitt 0d79221853 memuse improvements
- conv is now SMALLTILE
- more instrumentation
- better buffer recycling
- quicker buf freeing
2013-12-17 15:21:21 +00:00
John Cupitt a9fd318712 run over memuse for sharpen 2013-12-16 09:22:05 +00:00
John Cupitt 82df44f9d6 clean up buffer recycle fix 2013-12-13 14:05:10 +00:00
John Cupitt c782150a6d fix sharing detection (again) 2013-12-13 12:20:05 +00:00