Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualAhmed Egyptian

Posted 13 March 2013 - 04:09 PM

Thanks for your answer, I have made an imaginary bitmap, so I got 4*4 pixels assuming 1 Pixel is 3 bytes RGB, and I added them, but how come from two rows I get 4*4 pixels?

Would someone please show me some pics smile.png ?

 

Regarding also those lines:

           

 

                pDest8[0] = (uint8_t)((r + 2)/4); // average with rounding
                pDest8[1] = (uint8_t)((g + 2)/4);
                pDest8[2] = (uint8_t)((b + 2)/4);
                pDest8[3] = (uint8_t)((a + 2)/4);
                pSrc8 += 8; // skip forward 2 source pixels
                pDest8 += 4; // skip forward 1 destination pixel
 

He skipped 4 bytes, but at the second iteration he writes again at 0,1,2,3 at the dest, should be 4,5,6,7 ?


#2Ahmed Egyptian

Posted 13 March 2013 - 04:08 PM

Thanks for your answer, I have made an imaginary bitmap, so I got 4*4 pixels assuming 1 Pixel is 3 bytes RGB, and I added them, but how come from two rows I get 4*4 pixels?

Would someone please show me some pics smile.png ?

 

Regarding also those lines:

           

 

                pDest8[0] = (uint8_t)((r + 2)/4); // average with rounding
                pDest8[1] = (uint8_t)((g + 2)/4);
                pDest8[2] = (uint8_t)((b + 2)/4);
                pDest8[3] = (uint8_t)((a + 2)/4);
                pSrc8 += 8; // skip forward 2 source pixels
                pDest8 += 4; // skip forward 1 destination pixel
 

He skipped 4 bytes, but at the second iteration he writes again at 0,1,2,3 at the dest, should be 4,5,6,7 ?


#1Ahmed Egyptian

Posted 13 March 2013 - 03:59 PM

Thanks for your answer, I have made an imaginary bitmap, so I got 4*4 pixels assuming 1 Pixel is 3 bytes RGB, and I added them, but how come from two rows I get 4*4 pixels?

Would someone please show me some pics :) ?

 

Regarding also those lines:

           

 

                pDest8[0] = (uint8_t)((r + 2)/4); // average with rounding
                pDest8[1] = (uint8_t)((g + 2)/4);
                pDest8[2] = (uint8_t)((b + 2)/4);
                pDest8[3] = (uint8_t)((a + 2)/4);
                pSrc8 += 8; // skip forward 2 source pixels
                pDest8 += 4; // skip forward 1 destination pixel
 

He skipped 4 bytes, but at the second iteration he writes again at 0,1,2,3 at the dest, should be 4,5,6,7 ?


PARTNERS