Changeset 3075 for libpipi


Ignore:
Timestamp:
Oct 23, 2008, 4:25:09 PM (12 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added 'Modular' codec as a testbed for hand-written codecs, as well as a JPEG decoder (libjpeg). Some stuff are

temporary, though.

Location:
libpipi/trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/configure.ac

    r3074 r3075  
    184184
    185185
    186 if test "${ac_cv_my_have_il}" = "no" -a "${ac_cv_my_have_ole}" = "no" -a "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no" -a "${ac_cv_my_have_opencv}" = "no" -a "${ac_cv_my_have_cocoa}" = "no"; then
     186# Use Modular codecs ?
     187MODULAR_CODEC=""
     188ac_cv_my_have_modular="no"
     189
     190ac_cv_my_have_libjpeg="no"
     191AC_CHECK_HEADERS(jpeglib.h,
     192 [ac_cv_my_have_libjpeg="yes"],
     193 [ac_cv_my_have_libjpeg="no"])
     194if test "${ac_cv_my_have_libjpeg}" != "no"; then
     195  ac_cv_my_have_modular="yes"
     196  AC_DEFINE(USE_LIBJPEG, 1, Define to 1 to use libjpeg)
     197  AC_DEFINE(USE_MODULAR, 1, Define to 1 to use modular codecs)
     198  MODULAR_CODEC="${MODULAR_CODEC} libjpeg"
     199fi
     200AM_CONDITIONAL(USE_LIBJPEG, test "${ac_cv_my_have_libjpeg}" = "yes")
     201AM_CONDITIONAL(USE_MODULAR, test "${ac_cv_my_have_modular}" = "yes")
     202
     203AC_MSG_CHECKING(valid modular codecs)
     204if test -z "${MODULAR_CODEC}"; then
     205  AC_MSG_RESULT(none)
     206else
     207  MODULAR_CODEC="${MODULAR_CODEC# *}"
     208  AC_MSG_RESULT([${MODULAR_CODEC}])
     209fi
     210
     211
     212
     213if test "${ac_cv_my_have_il}" = "no" -a "${ac_cv_my_have_ole}" = "no" -a "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no" -a "${ac_cv_my_have_opencv}" = "no" -a "${ac_cv_my_have_cocoa}" = "no" -a "${ac_cv_my_have_modular}" = "no"; then
    187214  AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2, Cocoa, or OpenCV, please install one of them]])
    188215fi
  • libpipi/trunk/pipi/Makefile.am

    r3067 r3075  
    123123codec_sources += codec/coreimage.m
    124124endif
     125
     126# Modular codecs
     127if USE_MODULAR
     128codec_sources += codec/modular.c
     129if USE_LIBJPEG
     130codec_libs += -ljpeg
     131codec_sources += codec/modular/jpeg.c
     132endif
     133endif
  • libpipi/trunk/pipi/codec.c

    r3070 r3075  
    3939        ret = pipi_load_oric(name);
    4040
     41#if USE_LIBJPEG
     42    if(!ret)
     43        ret = pipi_load_modular(name);
     44#endif
    4145#if USE_IMLIB2
    4246    if(!ret)
     
    111115        ret = pipi_save_coreimage(img, name);
    112116#endif
    113    
     117
    114118    return ret;
    115119}
  • libpipi/trunk/pipi/pipi_internals.h

    r3074 r3075  
    9898#endif
    9999
     100/* Modular codecs */
     101#ifdef USE_MODULAR
     102pipi_image_t *pipi_load_modular(const char *name);
     103int pipi_save_modular(pipi_image_t *img, const char *name);
     104#endif
     105
     106
    100107
    101108pipi_image_t *pipi_load_oric(const char *name);
Note: See TracChangeset for help on using the changeset viewer.