Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Image processing capabilities in SFML  (Read 2678 times)

0 Members and 1 Guest are viewing this topic.

sharethis

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Image processing capabilities in SFML
« on: January 09, 2013, 03:58:22 pm »
I am using SFML 2.0 for my OpenGL game. For the Minecraft-like cube terrain I use a texture atlas. My problem is that the default mipmap generator interpolates over the boundaries of tiles in the texture atlas. Therefore I need to generate mipmaps on my own.

To generate my own mipmaps which are not interpolated over the edge of tiles, I need some basic impage processing functionality. My question is if my needed functionality is built in in the SFML framework. Otherwise I would need to find an additional library for that purpose.

Image processing functions I need are extracting segments of an image as a new one, inserting there images back into another, larger image and resizing images using linear interpolation. I use the "sf::Image" class for now and would really appreciate continuing using it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Image processing capabilities in SFML
« Reply #1 on: January 09, 2013, 04:01:42 pm »
SFML has only minimal image processing features (ie. the sf::Image class), I'm afraid you will have to use another library to do what you want.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Image processing capabilities in SFML
« Reply #2 on: January 09, 2013, 05:01:01 pm »
If you are lucky, the other library is also compatible to the RGBA format in which sf::Image stores its pixels, so you could run algorithms in-place.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

sharethis

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Image processing capabilities in SFML
« Reply #3 on: January 09, 2013, 09:35:55 pm »
Thanks for your reply!

I think the "sf::Image::Copy" function is exactly what I need. Furthermore I only need resizing what sadly is not implemented in SFML as far as I found out. Maybe I can do that on my own because since the size halves everytime I only need to average over four pixels.