Ignore:
Timestamp:
Jan 4, 2005, 6:06:04 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • fixed a bug in the SDL code: alpha mask should be set to 0.
  • implemented filter_black_stuff to remove black dots.
  • allow threshold to be negative in filter_equalize; in this case, invert colours.
  • implemented filter_crop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/image.c

    r407 r413  
    2727#endif
    2828
    29 struct image *image_load(char *name)
     29struct image *image_load(const char *name)
    3030{
    3131    struct image *img;
     
    7777    gmask = 0x00ff0000;
    7878    bmask = 0x0000ff00;
    79     amask = 0x000000ff;
     79    amask = 0x00000000;
    8080#   else
    8181    rmask = 0x000000ff;
    8282    gmask = 0x0000ff00;
    8383    bmask = 0x00ff0000;
    84     amask = 0xff000000;
     84    amask = 0x00000000;
    8585#   endif
    8686    priv = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
     
    135135
    136136    free(img);
     137}
     138
     139void image_save(struct image *img, const char *name)
     140{
     141#if defined(HAVE_SDL_IMAGE_H)
     142    SDL_SaveBMP(img->priv, name);
     143#elif defined(HAVE_IMLIB2_H)
     144    imlib_context_set_image(img->priv);
     145    imlib_save_image(name);
     146#elif defined(HAVE_CV_H)
     147    cvSaveImage(name, img->priv);
     148#endif
    137149}
    138150
Note: See TracChangeset for help on using the changeset viewer.