Ignore:
Timestamp:
Nov 29, 2003, 8:35:07 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • src/caca.c src/caca.h: + Added caca_get_dithering_name().
  • src/bitmap.c: + Created a new dithering method with an 8x8 ordered matrix. + Replaced the char list with a string for better readability. + Dithering functions now return a value between 0 and 255.
  • examples/demo.c examples/view.c: + Adapted to use caca_get_dithering_name().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/caca.c

    r234 r235  
    153153}
    154154
    155 const char *caca_get_color_name(unsigned int color)
    156 {
    157     static const char *color_names[16] =
     155const char *caca_get_color_name(enum caca_color color)
     156{
     157    static const char *color_names[] =
    158158    {
    159159        "black",
     
    176176
    177177    if(color < 0 || color > 15)
    178         return "unknown color";
     178        return "unknown";
    179179
    180180    return color_names[color];
     181}
     182
     183const char *caca_get_dithering_name(enum caca_dithering dithering)
     184{
     185    static const char *dithering_names[] =
     186    {
     187        "none",
     188        "ordered 4x4",
     189        "ordered 8x8",
     190        "random"
     191    };
     192
     193    if(dithering < 0 || dithering > 3)
     194        return "unknown";
     195
     196    return dithering_names[dithering];
    181197}
    182198
Note: See TracChangeset for help on using the changeset viewer.