Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

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

    r2313 r2821  
    3434#endif
    3535
    36 #include "cucul.h"
     36#include "caca.h"
    3737
    3838#include "common-image.h"
     
    5858    fprintf(stderr, "  -g, --gamma=GAMMA\t\tGamma of resulting image\n");
    5959    fprintf(stderr, "  -d, --dither=DITHER\t\tDithering algorithm to use :\n");
    60     list = cucul_get_dither_algorithm_list(NULL);
     60    list = caca_get_dither_algorithm_list(NULL);
    6161    while(*list)
    6262    {
     
    6666
    6767    fprintf(stderr, "  -f, --format=FORMAT\t\tFormat of the resulting image :\n");
    68     list = cucul_get_export_list();
     68    list = caca_get_export_list();
    6969    while(*list)
    7070    {
     
    8989    "        http://libcaca.zoy.org/ in the libcaca package.\n"
    9090    "\n",
    91     cucul_get_version(), __DATE__);
     91    caca_get_version(), __DATE__);
    9292}
    9393int main(int argc, char **argv)
    9494{
    95     /* libcucul context */
    96     cucul_canvas_t *cv;
     95    /* libcaca context */
     96    caca_canvas_t *cv;
    9797    void *export;
    9898    size_t len;
     
    175175
    176176
    177     cv = cucul_create_canvas(0, 0);
     177    cv = caca_create_canvas(0, 0);
    178178    if(!cv)
    179179    {
    180         fprintf(stderr, "%s: unable to initialise libcucul\n", argv[0]);
     180        fprintf(stderr, "%s: unable to initialise libcaca\n", argv[0]);
    181181        return 1;
    182182    }
     
    186186    {
    187187        fprintf(stderr, "%s: unable to load %s\n", argv[0], argv[argc-1]);
    188         cucul_free_canvas(cv);
     188        caca_free_canvas(cv);
    189189        return 1;
    190190    }
     
    206206
    207207
    208     cucul_set_canvas_size(cv, cols, lines);
    209     cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    210     cucul_clear_canvas(cv);
    211     if(cucul_set_dither_algorithm(i->dither, dither?dither:"fstein"))
     208    caca_set_canvas_size(cv, cols, lines);
     209    caca_set_color_ansi(cv, CACA_DEFAULT, CACA_TRANSPARENT);
     210    caca_clear_canvas(cv);
     211    if(caca_set_dither_algorithm(i->dither, dither?dither:"fstein"))
    212212    {
    213213        fprintf(stderr, "%s: Can't dither image with algorithm '%s'\n", argv[0], dither);
    214214        unload_image(i);
    215         cucul_free_canvas(cv);
     215        caca_free_canvas(cv);
    216216        return -1;
    217217    }
    218218
    219     if(brightness!=-1) cucul_set_dither_brightness (i->dither, brightness);
    220     if(contrast!=-1) cucul_set_dither_contrast (i->dither, contrast);
    221     if(gamma!=-1) cucul_set_dither_gamma (i->dither, gamma);
    222 
    223     cucul_dither_bitmap(cv, 0, 0, cols, lines, i->dither, i->pixels);
     219    if(brightness!=-1) caca_set_dither_brightness (i->dither, brightness);
     220    if(contrast!=-1) caca_set_dither_contrast (i->dither, contrast);
     221    if(gamma!=-1) caca_set_dither_gamma (i->dither, gamma);
     222
     223    caca_dither_bitmap(cv, 0, 0, cols, lines, i->dither, i->pixels);
    224224
    225225    unload_image(i);
    226226
    227     export = cucul_export_memory(cv, format?format:"ansi", &len);
     227    export = caca_export_memory(cv, format?format:"ansi", &len);
    228228    if(!export)
    229229    {
     
    236236    }
    237237
    238     cucul_free_canvas(cv);
     238    caca_free_canvas(cv);
    239239
    240240    return 0;
Note: See TracChangeset for help on using the changeset viewer.