I consider whether it will have any matter if I am passing to IplImage *input image in BGRA format, or RGBA format in order to make its resizing using available interpolation algorithms:
NTER_NEAREST - a nearest-neighbor interpolation
INTER_LINEAR - a bilinear interpolation (used by default)
INTER_AREA - resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire’-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.
INTER_CUBIC - a bicubic interpolation over 4x4 pixel neighborhood
INTER_LANCZOS4 - a Lanczos interpolation over 8x8 pixel neighborhood
the resized image will be back retrieved into RGBA buffer. So I think that additional operation of converting RGBA -> BGRA and after resizing back BGRA -> RGBA will be redundant and only will slow my image resizing. Maybe I am wrong and it matters the image will be in right format BGRA when using above interpolations.
IplImage *image = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 4);
cvSetData(image, rgbaData, image->widthStep);
// resize image
float scale = 0.5;
IplImage *resizedImage = cvCreateImage(cvSize(image->width*scale, image->height*scale), image->depth, image->nChannels);
cvResize(image, resizedImage, CV_INTER_LANCZOS4);
To sum up my question is:
Does it matter the image be in BGRA data format in IplImage * while I want to resize it using cvResize() and above interpolations?