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

@@ -78,7 +78,7 @@ namespace sharp {
Initialise and return a VipsImage from a buffer. Supports JPEG, PNG, WebP and TIFF.
*/
VipsImage* InitImage(void *buffer, size_t const length, VipsAccess const access) {
return vips_image_new_from_buffer(buffer, length, NULL, "access", access, NULL);
return vips_image_new_from_buffer(buffer, length, nullptr, "access", access, nullptr);
}
/*
@@ -87,7 +87,7 @@ namespace sharp {
ImageType DetermineImageType(char const *file) {
ImageType imageType = ImageType::UNKNOWN;
char const *load = vips_foreign_find_load(file);
if (load != NULL) {
if (load != nullptr) {
std::string loader = load;
if (EndsWith(loader, "JpegFile")) {
imageType = ImageType::JPEG;
@@ -110,7 +110,7 @@ namespace sharp {
Initialise and return a VipsImage from a file.
*/
VipsImage* InitImage(char const *file, VipsAccess const access) {
return vips_image_new_from_file(file, "access", access, NULL);
return vips_image_new_from_file(file, "access", access, nullptr);
}
/*
@@ -169,7 +169,7 @@ namespace sharp {
*/
int InterpolatorWindowSize(char const *name) {
VipsInterpolate *interpolator = vips_interpolate_new(name);
if (interpolator == NULL) {
if (interpolator == nullptr) {
return -1;
}
int window_size = vips_interpolate_get_window_size(interpolator);
@@ -181,7 +181,7 @@ namespace sharp {
Called when a Buffer undergoes GC, required to support mixed runtime libraries in Windows
*/
void FreeCallback(char* data, void* hint) {
if (data != NULL) {
if (data != nullptr) {
g_free(data);
}
}