Changeset 1881
- Timestamp:
- Nov 4, 2007, 1:00:00 PM (15 years ago)
- Location:
- libcaca/trunk/cucul
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/cucul.h
r1880 r1881 223 223 char const * const * cucul_get_dither_charset_list(cucul_dither_t const *); 224 224 char 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 *);225 int cucul_set_dither_algorithm(cucul_dither_t *, char const *); 226 char const * const * cucul_get_dither_algorithm_list(cucul_dither_t const *); 227 char const * cucul_get_dither_algorithm(cucul_dither_t const *); 228 228 int cucul_dither_bitmap(cucul_canvas_t *, int, int, int, int, 229 229 cucul_dither_t const *, void *); … … 300 300 int cucul_rotate(cucul_canvas_t *) CUCUL_DEPRECATED; 301 301 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; 302 305 # define CUCUL_COLOR_BLACK CUCUL_BLACK 303 306 # define CUCUL_COLOR_BLUE CUCUL_BLUE -
libcaca/trunk/cucul/dither.c
r1880 r1881 138 138 enum color_mode color; 139 139 140 char const * dither_name;140 char const *algo_name; 141 141 void (*init_dither) (int); 142 142 unsigned int (*get_dither) (void); … … 178 178 static int init_lookup(void); 179 179 180 /* Dithering methods */180 /* Dithering algorithms */ 181 181 static void init_no_dither(int); 182 182 static unsigned int get_no_dither(void); … … 350 350 d->glyph_count = sizeof(ascii_glyphs) / sizeof(*ascii_glyphs); 351 351 352 d-> dither_name = "fstein";352 d->algo_name = "fstein"; 353 353 d->init_dither = init_fstein_dither; 354 354 d->get_dither = get_fstein_dither; … … 812 812 } 813 813 814 /** \brief Set dithering method815 * 816 * Tell the renderer which dithering methodshould be used. Dithering is814 /** \brief Set dithering algorithm 815 * 816 * Tell the renderer which dithering algorithm should be used. Dithering is 817 817 * necessary because the picture being rendered has usually far more colours 818 818 * than the available palette. Valid values for \c str are: … … 828 828 * 829 829 * \param d Dither object. 830 * \param str A string describing the methodthat needs to be used830 * \param str A string describing the algorithm that needs to be used 831 831 * for the dithering. 832 832 * \return 0 in case of success, -1 if an error occurred. 833 833 */ 834 int cucul_set_dither_ mode(cucul_dither_t *d, char const *str)834 int cucul_set_dither_algorithm(cucul_dither_t *d, char const *str) 835 835 { 836 836 if(!strcasecmp(str, "none")) 837 837 { 838 d-> dither_name = "none";838 d->algo_name = "none"; 839 839 d->init_dither = init_no_dither; 840 840 d->get_dither = get_no_dither; … … 843 843 else if(!strcasecmp(str, "ordered2")) 844 844 { 845 d-> dither_name = "ordered2";845 d->algo_name = "ordered2"; 846 846 d->init_dither = init_ordered2_dither; 847 847 d->get_dither = get_ordered2_dither; … … 850 850 else if(!strcasecmp(str, "ordered4")) 851 851 { 852 d-> dither_name = "ordered4";852 d->algo_name = "ordered4"; 853 853 d->init_dither = init_ordered4_dither; 854 854 d->get_dither = get_ordered4_dither; … … 857 857 else if(!strcasecmp(str, "ordered8")) 858 858 { 859 d-> dither_name = "ordered8";859 d->algo_name = "ordered8"; 860 860 d->init_dither = init_ordered8_dither; 861 861 d->get_dither = get_ordered8_dither; … … 864 864 else if(!strcasecmp(str, "random")) 865 865 { 866 d-> dither_name = "random";866 d->algo_name = "random"; 867 867 d->init_dither = init_random_dither; 868 868 d->get_dither = get_random_dither; … … 871 871 else if(!strcasecmp(str, "fstein") || !strcasecmp(str, "default")) 872 872 { 873 d-> dither_name = "fstein";873 d->algo_name = "fstein"; 874 874 d->init_dither = init_fstein_dither; 875 875 d->get_dither = get_fstein_dither; … … 885 885 } 886 886 887 /** \brief Get dithering methods888 * 889 * Return a list of available dithering methods for a given dither. The list890 * is a NULL-terminated array of strings, interleaving a string containing891 * the internal value for the dithering method, to be used with892 * cucul_set_dither_dithering(), and a string containing the natural893 * 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. 894 894 * 895 895 * This function never fails. … … 898 898 * \return An array of strings. 899 899 */ 900 char const * const * cucul_get_dither_ mode_list(cucul_dither_t const *d)900 char const * const * cucul_get_dither_algorithm_list(cucul_dither_t const *d) 901 901 { 902 902 static char const * const list[] = … … 914 914 } 915 915 916 /** \brief Get current dithering method917 * 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. 919 919 * 920 920 * This function never fails. … … 923 923 * \return A static string. 924 924 */ 925 char const * cucul_get_dither_ mode(cucul_dither_t const *d)926 { 927 return d-> dither_name;925 char const * cucul_get_dither_algorithm(cucul_dither_t const *d) 926 { 927 return d->algo_name; 928 928 } 929 929 -
libcaca/trunk/cucul/legacy.c
r1870 r1881 76 76 } 77 77 78 int cucul_set_dither_mode(cucul_dither_t *d, char const *s) 79 { 80 return cucul_set_dither_algorithm(d, s); 81 } 82 83 char const * const * cucul_get_dither_mode_list(cucul_dither_t const *d) 84 { 85 return cucul_get_dither_algorithm_list(d); 86 } 87 78 88 /* 79 89 * Functions from import.c
Note: See TracChangeset
for help on using the changeset viewer.