Image Manipulation Functions

Hi.

I have looking through the SDL documentation and
I haven’t found any kind of funtion that do the following thing:

it takes two arguments:

  1. the color that will be changed
  2. the color that will replace the first color ( 1 )
  3. the source surface
  4. destination surface

is there any kind of library that do the this ??–
Best Regards
Michal ‘coldblood’ przybylowicz

This is not in SDL. But it should be no problem to write such a
function. You could try the getpixel() and putpixel() functions
(http://sdldoc.csn.ul.ie/guidevideo.php#AEN112), or maybe look for a
library that has a function like this. (http://www.libsdl.org/libraries.php)

Bernhard

coldblood wrote:> Hi.

I have looking through the SDL documentation and
I haven’t found any kind of funtion that do the following thing:

it takes two arguments:

  1. the color that will be changed
  2. the color that will replace the first color ( 1 )
  3. the source surface
  4. destination surface

is there any kind of library that do the this ??


Best Regards
Michal ‘coldblood’ przybylowicz


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

coldblood wrote:

Hi.

I have looking through the SDL documentation and
I haven’t found any kind of funtion that do the following thing:

it takes two arguments:

  1. the color that will be changed

Let’s call this color1

  1. the color that will replace the first color ( 1 )

Let’s call this color2 (yeah :slight_smile:

  1. the source surface
  2. destination surface

is there any kind of library that do the this ??

You can hack it the following way with minimal work :

  • set colorkey on the source surface to color1
  • fill destination surface with SDL_FillRect(color2)
  • blit source to dest

Stephane