Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Image Buffer Pixel Array?

$
0
0

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));

 

    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 *)&params[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?

Viewing all articles
Browse latest Browse all 73444

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>