Changeset 2794 for libpipi


Ignore:
Timestamp:
Aug 28, 2008, 11:43:52 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Add "8bit" to the list of supported template flags.
Location:
libpipi/trunk/pipi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/pipi_internals.h

    r2793 r2794  
    2222#define SET_FLAG_GRAY 0x00000001
    2323#define SET_FLAG_WRAP 0x00000002
     24#define SET_FLAG_8BIT 0x00000004
    2425
    2526/* pipi_image_t: the image structure. This is probably going to be the most
  • libpipi/trunk/pipi/pipi_template.h

    r2793 r2794  
    4747#   undef FLAG_WRAP
    4848
     49#elif !defined FLAG_8BIT
     50#   if (TEMPLATE_FLAGS) & SET_FLAG_8BIT
     51#      define FLAG_8BIT 1
     52#      include __FILE__
     53#      undef FLAG_8BIT
     54#   endif
     55#   define FLAG_8BIT 0
     56#   include __FILE__
     57#   undef FLAG_8BIT
     58
    4959#else
    5060    /* FIXME: I couldn't find a way to do this in one preprocessor pass,
    5161     * too many levels of indirection seem to be needed. */
    52 #   if FLAG_GRAY
     62#   if FLAG_8BIT
    5363#      if FLAG_WRAP
    54 #         define SUFFIX(x) x##_gray_wrap
     64#         if FLAG_GRAY
     65#            define SUFFIX(x) x##_gray_wrap_8bit
     66#         else
     67#            define SUFFIX(x) x##_wrap_8bit
     68#         endif
    5569#      else
    56 #         define SUFFIX(x) x##_gray
     70#         if FLAG_GRAY
     71#            define SUFFIX(x) x##_gray_8bit
     72#         else
     73#            define SUFFIX(x) x##_8bit
     74#         endif
    5775#      endif
    5876#   else
    5977#      if FLAG_WRAP
    60 #         define SUFFIX(x) x##_wrap
     78#         if FLAG_GRAY
     79#            define SUFFIX(x) x##_gray_wrap
     80#         else
     81#            define SUFFIX(x) x##_wrap
     82#         endif
    6183#      else
    62 #         define SUFFIX(x) x
     84#         if FLAG_GRAY
     85#            define SUFFIX(x) x##_gray
     86#         else
     87#            define SUFFIX(x) x
     88#         endif
    6389#      endif
    6490#   endif
Note: See TracChangeset for help on using the changeset viewer.