Add small cache before convolution for seq access

This commit is contained in:
Lovell Fuller 2015-04-14 21:31:20 +01:00
parent ae968142ee
commit 3810f642d3

View File

@ -459,6 +459,15 @@ class ResizeWorker : public NanAsyncWorker {
return Error();
}
vips_object_local(hook, gaussian);
// Sequential input requires a small linecache before use of convolution
if (baton->accessMethod == VIPS_ACCESS_SEQUENTIAL) {
VipsImage *lineCached;
if (vips_linecache(image, &lineCached, "access", VIPS_ACCESS_SEQUENTIAL, "tile_height", 1, "threaded", TRUE, NULL)) {
return Error();
}
vips_object_local(hook, lineCached);
image = lineCached;
}
// Apply Gaussian function
VipsImage *blurred;
if (vips_convsep(image, &blurred, gaussian, "precision", VIPS_PRECISION_INTEGER, NULL)) {