image manipulation

Oct 20, 2013 at 3:07am
I've come to a point where I want to manipulate an image file at runtime or with pre-determine sizes and have to be applied when the windows is moved or through in program options.

I know I can do the applying part (hopefully). However I am a little unsure of how to tackle the image manipulation. I want to make it so that it is not os dependant. So I know I can not rely on any os functions. The only other thought that came to mind was to deal with the video card itself. If there is another way then feel free to tell me.

So the main question after all of that is said and done. How is c++ able to interact with the video card directly for images? Or if there are existing function I can use. How do they do that?

If I can use existing function I would like to be able to manipulate it myself.

-Stormhawk
Oct 20, 2013 at 5:03am
It looks you'd better explain what kind of manipulations you want to perform.

Dealing with video-card directly would be even worse than relying on OS-dependent functions since there are much more video-cards than OSes.

There are a number of libraries for C++ - they could be added to your program and be compiled with less or more success under different OSes.

http://stackoverflow.com/questions/2982711/c-image-processing-libraries/2982721

Or you can switch to java which is platform-independent and contains a number of basic image-manipulation functions in its standard API. :)
Oct 20, 2013 at 5:13am
hmm well I am using SDL to deal with all my graphics however it does not deal with image resizing to fit windows when you for example want to change the actual window size, or if you want to do a resolution change. Also I was hope I wouldn't have to add anything major in order to do a one little( I think it isn't a major thing at least) thing like that.
Oct 20, 2013 at 6:03am

I wouldn't have to add anything major in order to do a one little( I think it isn't a major thing at least) thing like that.

If you think image resizing is a simple matter, you may try to do it yourself. I think you will very soon find it is far not as simple. There are a lot of thing to consider - selection of colors interpolation algorithm, its implementation, handling different image formats etc.

It looks there are some additions to SDL:
http://stackoverflow.com/questions/2268349/scaling-sprites-in-sdl
Oct 20, 2013 at 7:49pm
Yes, before writing the question I had look a bit into it and saw sdl_gfx as well. I was hoping I wouldn't have to add a whole library just for 1-2 function out of the whole package. Which is one of the reason why I wanted to look for a better alternative. Also I I don't want to have too many 3rd party attachments to my program. Since if I rely to heavily on them and something goes wrong I wouldn't know where to start fixing the problem. Or even worst I couldn't fix it because it broke some licensing agreement.
Topic archived. No new replies allowed.