I have a question dealing with the use of an image's width and widthstep.
I have the dimensions as well as the image data as a QByteArray. I also have the widthstep. My question is how to use the widthstep to properly populate the Ipl Image since my image's width is 4095, which is not an integer multiple of 8. I have successfully populated images with widths that are integer multiples of 8 but now I am stuck with this problem at hand. Any general code that uses widthstep to populate an IplImage would be welcomed and highly appreciated. :D
Here is the part of my switch case that works; the default integer multiple of 8 image width:
default:
{
IplImage* extracted_sar_image; // our image declaration
CvSize size; // size type has width and height attributes
size.height = sar_nrows_integer; // height of size
size.width = sar_ncols_integer;
extracted_sar_image = cvCreateImageHeader(size, IPL_DEPTH_8U, 1);
extracted_sar_image->imageData = sar_image_data_2.data();
cvNamedWindow("Image", CV_WINDOW_NORMAL );
cvShowImage("Image", extracted_sar_image);
cvMoveWindow("Image", 100, 100);
cvSaveImage("C:/Users/z_slant/Desktop/generated_extracted_sar_image.bmp", extracted_sar_image);
// delay to observe the image that is being saved
cvWaitKey(10000);
// deallocates the image data
cvReleaseImage(&extracted_sar_image);
// closes image display window
cvDestroyWindow("Image");
break;
}