Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: C++ fast itmap resizing/blitting algorithm

  1. #1
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    3

    C++ fast itmap resizing/blitting algorithm

    Hello,

    I am not sure where to post this, so I apologize if it is posted in the wrong place.

    I need the fastest blitter algorithm for C++, I have a bitmap stored as RGB data, which I need to resize, most of the time scale down. Can someone please help me?
    I need to do this every frame, so I need the fastest possible solution.

  2. #2
    Intern Contributor Brokenmind's Avatar
    Join Date
    Feb 2014
    Location
    Aachen / Germany
    Posts
    78
    1) Do you need to save the image in every frame, or do you simply need to display it?
    2) How would you like to resize it, pixelated or interpolated?

  3. #3
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    3
    Hello,

    I save a different image each frame, think of what I am doing like FRAPS, but I need to resize the display each frame, the contents are different.

    2) I would like it interpolated, not the best algorithm, but certainly not the worst. A compromise would be OK for me.
    I currently use CreateDIBSection along with StretchDIBits, but performance is not as good as I need it to be.

  4. #4
    Intern Contributor Brokenmind's Avatar
    Join Date
    Feb 2014
    Location
    Aachen / Germany
    Posts
    78
    The certainly fastest way would be drawing your texture via openGL onto another texture of a different size (renderToTexture) which you can then read from the graphics memory. Only disadvantage would be the restricted influence on the interpolation algorithm, i.e. interpolated or not (pixelated). A shader lets you define own algorithms that suit your needs. I guess this will be much better (in many ways) than using WinAPI
    Last edited by Brokenmind; 05-01-2014 at 02:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •