Ignore:
Timestamp:
Sep 28, 2008, 7:07:57 AM (12 years ago)
Author:
Sam Hocevar
Message:

Allow to use all available image loaders instead of just the first one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/codec/opencv.c

    r2814 r2837  
    3232/* FIXME: this whole file is broken until we support BGR24 images */
    3333
     34static int pipi_free_opencv(pipi_image_t *);
     35
    3436pipi_image_t *pipi_load_opencv(const char *name)
    3537{
     
    5355    img->codec_priv = (void *)priv;
    5456    img->codec_format = PIPI_PIXELS_BGR_C;
     57    img->codec_free = pipi_free_opencv;
    5558
    5659    img->wrap = 0;
     
    6063}
    6164
    62 void pipi_free_opencv(pipi_image_t *img)
    63 {
    64     IplImage *iplimg;
    65     iplimg = (IplImage *)img->codec_priv;
    66     cvReleaseImage(&iplimg);
    67 }
    68 
    69 void pipi_save_opencv(pipi_image_t *img, const char *name)
     65int pipi_save_opencv(pipi_image_t *img, const char *name)
    7066{
    7167    if(!img->codec_priv)
     
    9894    pipi_getpixels(img, img->codec_format);
    9995    cvSaveImage(name, img->codec_priv);
     96
     97    return 0;
    10098}
    10199
     100/*
     101 * XXX: The following functions are local.
     102 */
     103
     104static int pipi_free_opencv(pipi_image_t *img)
     105{
     106    IplImage *iplimg;
     107    iplimg = (IplImage *)img->codec_priv;
     108    cvReleaseImage(&iplimg);
     109
     110    return 0;
     111}
     112
Note: See TracChangeset for help on using the changeset viewer.