I have a little problem which I am unable to figure out. I need the image buffer with only pixels but not any padding. Currently I am using the following code.
int num = (int)(output->width*output->
height*sizeof(PF_Pixel8));
data = new unsigned char[num] ;
for(int y = 0; y < output->height; y++)
{
}
for(int y = 0; y < output->height; y++)
{
}
delete [] data;
unsigned char * data;
data = new unsigned char[num] ;
for(int y = 0; y < output->height; y++)
{
memcpy(&data[y*output->width*sizeof(PF_Pixel8)], (char *)¶ms[LAYER_INPUT]->u.ld.data+params[LAYER_INPUT]->u.ld.rowbytes* y, output->width*sizeof(PF_Pixel8));
}
To test whether its working or not, I have the following snippet
for(int y = 0; y < output->height; y++)
{
memcpy((char *)output->data+output->rowbytes*y,&data[y*output->width*sizeof(PF_Pix el8)] , output->width*sizeof(PF_Pixel8));
}
delete [] data;
But, then image is all glitched and jaggy when I test it. What did I do wrong?