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

Author Topic: Extended support in handling images  (Read 2862 times)

0 Members and 1 Guest are viewing this topic.

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Extended support in handling images
« on: March 25, 2008, 01:03:45 pm »
I've noticed a feature called Improve management of dependant resources in the roadmap. I wonder if it includes retrieving information about images like width, height, bits per pixel.

Let me describe my problem. I want to load large images to the program, but as ive been told, the size is limited by the graphics card.

So I want to slice the image into squares, but then I need to know the size of the image before loading it. And, as I already requested, I will need a function to slice out these rectangles from an image. ImageMagick library calls this function Extract.

Laurent, you told me that you will think about this feature, but should i expect it to be added in a month or rather in a year?  :wink:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Extended support in handling images
« Reply #1 on: March 26, 2008, 01:51:55 am »
Quote
I've noticed a feature called Improve management of dependant resources in the roadmap. I wonder if it includes retrieving information about images like width, height, bits per pixel.

No, this feature is more about notifying sprites / sounds that the image / buffer they point to no longer exists, to avoid weird behaviours.

Quote
So I want to slice the image into squares, but then I need to know the size of the image before loading it

Why do you need these informations before loading ?

Quote
Laurent, you told me that you will think about this feature, but should i expect it to be added in a month or rather in a year?

As you really need it quickly, this will be my new priority, so you should expect to get something in a few weeks ;)
I'm still trying to find the best solution to handle these large images. At least I could easily write the Image::LoadFromFile(file, rect) function.

Note that in the next two weeks I may be quite busy and I probably won't have much time to spend on SFML.
Laurent Gomila - SFML developer

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Extended support in handling images
« Reply #2 on: March 26, 2008, 01:29:34 pm »
Quote
Why do you need these informations before loading ?


I need to know how big the image is to set the coordinates of the rectangles.



Quote
As you really need it quickly, this will be my new priority


Geez, thanks. That really motivates me to get to work on my hobby-game.

Quote
I'm still trying to find the best solution to handle these large images.


How about loading an image to RAM to some new object. RAM has no size limits. Then we just need a function to create an sf::image object by extracting a rectangle from this RAMimage object. Easy talking, i don't really know how it is done on low level.[/quote]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Extended support in handling images
« Reply #3 on: March 27, 2008, 01:47:29 am »
Ok I see. I'll let you now as soon as something is ready.
Laurent Gomila - SFML developer

 

anything