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 3 of 3

Thread: 2D zoom

  1. #1
    Intern Newbie
    Join Date
    May 2005
    Location
    NY, NY
    Posts
    30

    2D zoom

    Hi all,

    I have an image array - 256x256 pixels lets say. How could I apply any arbitrary scaling value to it? Any particular algorithm to use?

    How do you account for the fact that there is a concrete amount of pixels on the user's monitor, yet you scale by a fraction, like 1.3 zoom, or 0.8 zoom?

    Thanks

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    Budapest (Hungary,Europe)
    Posts
    26

    Re: 2D zoom

    I think the most easier is in the case 1 -> 0.8 zoom, that you zoom for 8.0
    every pixels in line became the same
    color 8 pixels
    and unzoom for 0.8
    all 8 pixels became 1 pixel in the middle
    color

    /i mean under 'middle' that 100,80,20,5 's middle:51,25

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: 2D zoom

    OpenGL lets you specify a transformation matrix for texture coordinates, you may want to use that... I dont really understand your problem though.
    - Michael Steinberg

Posting Permissions

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