Ignore:
Timestamp:
Apr 7, 2006, 10:19:42 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • Changed the cucul_set_bitmap_antialias() argument to a string.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/bitmap.c

    r715 r726  
    403403
    404404/**
     405 * \brief Invert colors of bitmap
     406 *
     407 * Invert colors of bitmap
     408 *
     409 * \param bitmap Bitmap object.
     410 * \param value 0 for normal behaviour, 1 for invert
     411 */
     412void cucul_set_bitmap_invert(struct cucul_bitmap *bitmap, int value)
     413{
     414    bitmap->invert = value ? 1 : 0;
     415}
     416
     417/**
    405418 * \brief Set the contrast of a bitmap object.
    406419 *
     
    419432 *
    420433 * Tell the renderer whether to antialias the bitmap. Antialiasing smoothen
    421  * the rendered image and avoids the commonly seen staircase effect. The
    422  * method used is a simple prefilter antialiasing.
     434 * the rendered image and avoids the commonly seen staircase effect.
     435 *
     436 * \li \e "none": no antialiasing.
     437 *
     438 * \li \e "prefilter": simple prefilter antialiasing. This is the default
     439 *     value.
    423440 *
    424441 * \param bitmap Bitmap object.
    425  * \param value 0 to disable antialiasing, 1 to activate it.
    426  */
    427 void cucul_set_bitmap_antialias(struct cucul_bitmap *bitmap, int value)
    428 {
    429     bitmap->antialias = value ? 1 : 0;
    430 }
    431 
    432 /**
    433  * \brief Invert colors of bitmap
    434  *
    435  * Invert colors of bitmap
     442 * \param str A string describing the antialiasing method that will be used
     443 *        for the bitmap rendering.
     444 */
     445void cucul_set_bitmap_antialias(struct cucul_bitmap *bitmap, char const *str)
     446{
     447    else if(!strcasecmp(str, "none"))
     448        bitmap->antialias = 0;
     449    else /* "prefilter" is the default */
     450        bitmap->antialias = 1;
     451}
     452
     453/**
     454 * \brief Get available antialiasing methods
     455 *
     456 * Return a list of available antialiasing methods for a given bitmap. The
     457 * list is a NULL-terminated array of strings, interleaving a string
     458 * containing the internal value for the antialiasing method to be used with
     459 * \e cucul_set_bitmap_antialias(), and a string containing the natural
     460 * language description for that antialiasing method.
    436461 *
    437462 * \param bitmap Bitmap object.
    438  * \param value 0 for normal behaviour, 1 for invert
    439  */
    440 void cucul_set_bitmap_invert(struct cucul_bitmap *bitmap, int value)
    441 {
    442     bitmap->invert = value ? 1 : 0;
     463 * \return An array of strings.
     464 */
     465char const * const *
     466    cucul_get_bitmap_antialias_list(struct cucul_bitmap const *bitmap)
     467{
     468    static char const * const list[] =
     469    {
     470        "none", "No antialiasing",
     471        "prefilter", "Prefilter antialiasing",
     472        NULL, NULL
     473    };
     474
     475    return list;
    443476}
    444477
Note: See TracChangeset for help on using the changeset viewer.