1
Graphics / Re: RGB image pixels
« on: April 02, 2012, 01:35:45 am »
use some thing like this
void ToRGBA(unsigned char * frame,unsigned char * RGBA,int width,int height)
{
int count=0;
int count2=0;
while(count2<width*height*3)
{
RGBA[count]=frame[count2];
RGBA[count+1]=frame[count2+1];
RGBA[count+2]=frame[count2+2];
RGBA[count+3]=255;
count+=4;
count2+=3;
}
}
hope that helps
void ToRGBA(unsigned char * frame,unsigned char * RGBA,int width,int height)
{
int count=0;
int count2=0;
while(count2<width*height*3)
{
RGBA[count]=frame[count2];
RGBA[count+1]=frame[count2+1];
RGBA[count+2]=frame[count2+2];
RGBA[count+3]=255;
count+=4;
count2+=3;
}
}
hope that helps