Switch default interpolator to bicubic #289

Only use gaussian blur for non-linear interpolators

Improves performance of bilinear by ~15%

Add liborc to the packaged build to improve bicubic perf

Add examples of the various interpolation methods

Add bilinear vs bicubic to perf tests
This commit is contained in:
Lovell Fuller
2015-11-15 22:04:31 +00:00
parent 2678d761ba
commit 84fd1caa46
21 changed files with 935 additions and 442 deletions

View File

@@ -81,13 +81,13 @@ class MetadataWorker : public AsyncWorker {
g_atomic_int_dec_and_test(&counterQueue);
ImageType imageType = ImageType::UNKNOWN;
VipsImage *image = NULL;
VipsImage *image = nullptr;
if (baton->bufferInLength > 0) {
// From buffer
imageType = DetermineImageType(baton->bufferIn, baton->bufferInLength);
if (imageType != ImageType::UNKNOWN) {
image = InitImage(baton->bufferIn, baton->bufferInLength, VIPS_ACCESS_RANDOM);
if (image == NULL) {
if (image == nullptr) {
(baton->err).append("Input buffer has corrupt header");
imageType = ImageType::UNKNOWN;
}
@@ -96,10 +96,10 @@ class MetadataWorker : public AsyncWorker {
}
} else {
// From file
imageType = DetermineImageType(baton->fileIn.c_str());
imageType = DetermineImageType(baton->fileIn.data());
if (imageType != ImageType::UNKNOWN) {
image = InitImage(baton->fileIn.c_str(), VIPS_ACCESS_RANDOM);
if (image == NULL) {
image = InitImage(baton->fileIn.data(), VIPS_ACCESS_RANDOM);
if (image == nullptr) {
(baton->err).append("Input file has corrupt header");
imageType = ImageType::UNKNOWN;
}
@@ -107,7 +107,7 @@ class MetadataWorker : public AsyncWorker {
(baton->err).append("Input file is of an unsupported image format");
}
}
if (image != NULL && imageType != ImageType::UNKNOWN) {
if (image != nullptr && imageType != ImageType::UNKNOWN) {
// Image type
switch (imageType) {
case ImageType::JPEG: baton->format = "jpeg"; break;
@@ -161,7 +161,7 @@ class MetadataWorker : public AsyncWorker {
Local<Value> argv[2] = { Null(), Null() };
if (!baton->err.empty()) {
// Error
argv[0] = Error(baton->err.c_str());
argv[0] = Error(baton->err.data());
} else {
// Metadata Object
Local<Object> info = New<Object>();