Home

Awesome

Image Resampling Library

This is a simple yet flexible image resampling library that supports the following image samplers:

This library supports each separable sampler in both a two-pass 1D and 2D flavor. All resampling operations also support
size constraints (e.g. symmetric or pow-2 dimensions) and pad-filling. For more information about these filters, visit this blog post.

Supported Formats

Supported image formats may select between the following parameters:

The library uses a descriptive image format system, making it trivial to add new formats simply by inserting a valid new descriptor into the format list. The library also provides support for converting between formats. The following image formats are supported out of the box:

Usage

(Taken from Tutorial.cpp in the \Source folder):

CVImage source_image;
CVImage resampled_image;

if ( VN_FAILED( vnCreateImage( VN_IMAGE_FORMAT_R8G8B8, 
                               640, 
							   480, 
							   &source_image ) ) )
{
    printf( "Error! Unable to create the source image." );
    return -1;
}

// TODO(you): Copy 640x480 RGB image data into source_image->QueryData(). 

if ( VN_FAILED( vnResizeImage( source_image, 
                               VN_IMAGE_KERNEL_BILINEAR, 
							   320, 
							   240, 
							   0, 
							   &resampled_image ) ) )
{
    printf( "Error! Unable to resample the source image." );
    return -1;
}

// TODO(you): The image is resampled! Go party with 'resampled_image'.

More Information

For more information about this library or the larger Imagine Framework, visit bertolami.com.