hi,
as i understand (correct me if i'm wrong) the pixele it that format are stay in this order (y1 cb2 y2 cr2 y3 cb4 y4 cr4) and soo on, i still cant understand how can i modify the the image to work on each pixel for example, i want in my project to make a miror present a miror image - how shuld i work on these pixeles? or can it be some ting as i wrote here down.
void process_image_test( void* currentFrame, int yRows, int xPixels)
{
int xx = 0;
int yy = 0;
for( yy = 0; yy < (xPixels*yRows)*2; yy+=4 )
{
*( ( (unsigned char*)currentFrame ) + yy ) = *( ( (unsigned char*)currentFrame ) - yy + (xx*yRows) - 2);
if (yy == (xx*yRows))
xx++;
}
for( yy = 1; yy < (xPixels*yRows)*2; yy+=2 )
{
*( ( (unsigned char*)currentFrame ) + yy ) = *( ( (unsigned char*)currentFrame ) - yy + (xx*yRows));
if (yy == (xx*yRows))
xx++;
}
for( yy = 2; yy < (xPixels*yRows)*2; yy+=4 )
{
*( ( (unsigned char*)currentFrame ) + yy ) = *( ( (unsigned char*)currentFrame ) - yy + (xx*yRows) + 2);
if (yy == (xx*yRows))
xx++;
}
}
please correct where i wrong.
another question is states here
for( xx = screenshift*2+1; xx < (yRows * xPixels)*2; xx+=2 )//operate only on luma
{
if( *( ( (unsigned char*)currentFrame ) + xx ) < lowThreshold*3 )
{
// Below threshold, lower the luma
*( ( (unsigned char*)currentFrame ) + xx ) = 0x09;
}
else if( *( ( (char*)currentFrame ) + xx ) >= lowThreshold*3 && *( ( (char*)currentFrame ) + xx ) < hiThreshold*3 )
{
// Between thresholds, set luma to a mid point
*( ( (unsigned char*)currentFrame ) + xx ) = 0x80;
}
else
{
// Above threshold, raise the luma
*( ( (unsigned char*)currentFrame ) + xx ) = 0xFE;
}
}// End for Quantize
why the curen frame (that spose to be the luma) can get only these values?
0x00, 0x80, 0xfe - no matter what other values i will put there will be the same result as here.
thnks alot,
vadim