Changeset 1881


Ignore:
Timestamp:
11/04/07 13:00:00 (6 years ago)
Author:
sam
Message:
  • Renamed cucul_set_dither_mode() into cucul_set_dither_algorithm(). It’s a longer name but "mode" really wasn’t appropriate here.
Location:
libcaca/trunk/cucul
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/cucul.h

    r1880 r1881  
    223223char const * const * cucul_get_dither_charset_list(cucul_dither_t const *); 
    224224char const * cucul_get_dither_charset(cucul_dither_t const *); 
    225 int cucul_set_dither_mode(cucul_dither_t *, char const *); 
    226 char const * const * cucul_get_dither_mode_list(cucul_dither_t const *); 
    227 char const * cucul_get_dither_mode(cucul_dither_t const *); 
     225int cucul_set_dither_algorithm(cucul_dither_t *, char const *); 
     226char const * const * cucul_get_dither_algorithm_list(cucul_dither_t const *); 
     227char const * cucul_get_dither_algorithm(cucul_dither_t const *); 
    228228int cucul_dither_bitmap(cucul_canvas_t *, int, int, int, int, 
    229229                         cucul_dither_t const *, void *); 
     
    300300    int cucul_rotate(cucul_canvas_t *) CUCUL_DEPRECATED; 
    301301    int cucul_set_dither_invert(cucul_dither_t *, int) CUCUL_DEPRECATED; 
     302    int cucul_set_dither_mode(cucul_dither_t *, char const *) CUCUL_DEPRECATED; 
     303    char const * const * cucul_get_dither_mode_list(cucul_dither_t 
     304                                                    const *) CUCUL_DEPRECATED; 
    302305#   define CUCUL_COLOR_BLACK CUCUL_BLACK 
    303306#   define CUCUL_COLOR_BLUE CUCUL_BLUE 
  • libcaca/trunk/cucul/dither.c

    r1880 r1881  
    138138    enum color_mode color; 
    139139 
    140     char const *dither_name; 
     140    char const *algo_name; 
    141141    void (*init_dither) (int); 
    142142    unsigned int (*get_dither) (void); 
     
    178178static int init_lookup(void); 
    179179 
    180 /* Dithering methods */ 
     180/* Dithering algorithms */ 
    181181static void init_no_dither(int); 
    182182static unsigned int get_no_dither(void); 
     
    350350    d->glyph_count = sizeof(ascii_glyphs) / sizeof(*ascii_glyphs); 
    351351 
    352     d->dither_name = "fstein"; 
     352    d->algo_name = "fstein"; 
    353353    d->init_dither = init_fstein_dither; 
    354354    d->get_dither = get_fstein_dither; 
     
    812812} 
    813813 
    814 /** \brief Set dithering method 
    815  * 
    816  *  Tell the renderer which dithering method should be used. Dithering is 
     814/** \brief Set dithering algorithm 
     815 * 
     816 *  Tell the renderer which dithering algorithm should be used. Dithering is 
    817817 *  necessary because the picture being rendered has usually far more colours 
    818818 *  than the available palette. Valid values for \c str are: 
     
    828828 * 
    829829 *  \param d Dither object. 
    830  *  \param str A string describing the method that needs to be used 
     830 *  \param str A string describing the algorithm that needs to be used 
    831831 *         for the dithering. 
    832832 *  \return 0 in case of success, -1 if an error occurred. 
    833833 */ 
    834 int cucul_set_dither_mode(cucul_dither_t *d, char const *str) 
     834int cucul_set_dither_algorithm(cucul_dither_t *d, char const *str) 
    835835{ 
    836836    if(!strcasecmp(str, "none")) 
    837837    { 
    838         d->dither_name = "none"; 
     838        d->algo_name = "none"; 
    839839        d->init_dither = init_no_dither; 
    840840        d->get_dither = get_no_dither; 
     
    843843    else if(!strcasecmp(str, "ordered2")) 
    844844    { 
    845         d->dither_name = "ordered2"; 
     845        d->algo_name = "ordered2"; 
    846846        d->init_dither = init_ordered2_dither; 
    847847        d->get_dither = get_ordered2_dither; 
     
    850850    else if(!strcasecmp(str, "ordered4")) 
    851851    { 
    852         d->dither_name = "ordered4"; 
     852        d->algo_name = "ordered4"; 
    853853        d->init_dither = init_ordered4_dither; 
    854854        d->get_dither = get_ordered4_dither; 
     
    857857    else if(!strcasecmp(str, "ordered8")) 
    858858    { 
    859         d->dither_name = "ordered8"; 
     859        d->algo_name = "ordered8"; 
    860860        d->init_dither = init_ordered8_dither; 
    861861        d->get_dither = get_ordered8_dither; 
     
    864864    else if(!strcasecmp(str, "random")) 
    865865    { 
    866         d->dither_name = "random"; 
     866        d->algo_name = "random"; 
    867867        d->init_dither = init_random_dither; 
    868868        d->get_dither = get_random_dither; 
     
    871871    else if(!strcasecmp(str, "fstein") || !strcasecmp(str, "default")) 
    872872    { 
    873         d->dither_name = "fstein"; 
     873        d->algo_name = "fstein"; 
    874874        d->init_dither = init_fstein_dither; 
    875875        d->get_dither = get_fstein_dither; 
     
    885885} 
    886886 
    887 /** \brief Get dithering methods 
    888  * 
    889  *  Return a list of available dithering methods for a given dither. The list 
    890  *  is a NULL-terminated array of strings, interleaving a string containing 
    891  *  the internal value for the dithering method, to be used with 
    892  *  cucul_set_dither_dithering(), and a string containing the natural 
    893  *  language description for that dithering method. 
     887/** \brief Get dithering algorithms 
     888 * 
     889 *  Return a list of available dithering algorithms for a given dither. The 
     890 *  list is a NULL-terminated array of strings, interleaving a string 
     891 *  containing the internal value for the dithering algorithm, to be used 
     892 *  with cucul_set_dither_dithering(), and a string containing the natural 
     893 *  language description for that algorithm. 
    894894 * 
    895895 *  This function never fails. 
     
    898898 *  \return An array of strings. 
    899899 */ 
    900 char const * const * cucul_get_dither_mode_list(cucul_dither_t const *d) 
     900char const * const * cucul_get_dither_algorithm_list(cucul_dither_t const *d) 
    901901{ 
    902902    static char const * const list[] = 
     
    914914} 
    915915 
    916 /** \brief Get current dithering method 
    917  * 
    918  *  Return the given dither's current dithering method. 
     916/** \brief Get current dithering algorithm 
     917 * 
     918 *  Return the given dither's current dithering algorithm. 
    919919 * 
    920920 *  This function never fails. 
     
    923923 *  \return A static string. 
    924924 */ 
    925 char const * cucul_get_dither_mode(cucul_dither_t const *d) 
    926 { 
    927     return d->dither_name; 
     925char const * cucul_get_dither_algorithm(cucul_dither_t const *d) 
     926{ 
     927    return d->algo_name; 
    928928} 
    929929 
  • libcaca/trunk/cucul/legacy.c

    r1870 r1881  
    7676} 
    7777 
     78int cucul_set_dither_mode(cucul_dither_t *d, char const *s) 
     79{ 
     80    return cucul_set_dither_algorithm(d, s); 
     81} 
     82 
     83char const * const * cucul_get_dither_mode_list(cucul_dither_t const *d) 
     84{ 
     85    return cucul_get_dither_algorithm_list(d); 
     86} 
     87 
    7888/* 
    7989 * Functions from import.c 
Note: See TracChangeset for help on using the changeset viewer.