LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   image rescaling using sdl (https://www.linuxquestions.org/questions/programming-9/image-rescaling-using-sdl-797959/)

puneeth bhat 03-25-2010 11:44 PM

image rescaling using sdl
 
how can i do image rescaling in sdl.....i m receiving the RGB image of 640*480,i have to change it to 352*288 while displaying in sdl...is there any direct api to change it.

smeezekitty 03-26-2010 04:56 PM

Try to implement something like: (Where picture is a linear array of pixels, and putpixel plots pixels).
Code:

int x,y;
for(x=0;x < 640;x++){
      for(y=0;y < 480;y++){
            putpixel(x * 1.82, y * 1.666, picture[(y * 640) + x]);
      }
}



All times are GMT -5. The time now is 04:47 PM.