Ignore:
Timestamp:
May 21, 2009, 10:55:21 PM (11 years ago)
Author:
Sam Hocevar
Message:

Add caca_export_area_to_memory() to export only a selected part of the
current canvas. This is useful to export dirty rectangles. Accordingly,
add caca_import_area_from_memory() and caca_import_area_from_file().

Location:
libcaca/trunk/src
Files:
4 edited

Legend:

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

    r2821 r3495  
    11/*
    22 *  event         event lister for libcaca
    3  *  Copyright (c) 2004 Sam Hocevar <sam@zoy.org>
     3 *  Copyright (c) 2004-2009 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    5656        {
    5757            image = caca_create_canvas(0, 0);
    58             if(caca_import_file(image, argv[file], "ansi") < 0)
     58            if(caca_import_canvas_from_file(image, argv[file], "ansi") < 0)
    5959            {
    6060                fprintf(stderr, "%s: invalid file `%s'.\n", argv[0], argv[1]);
  • libcaca/trunk/src/cacaplay.c

    r3474 r3495  
    11/*
    22 *  cacaplay      caca file player
    3  *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
     3 *  Copyright (c) 2006-2009 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    9090        }
    9191
    92         bytes = caca_import_memory(app, buf, total, "caca");
     92        bytes = caca_import_canvas_from_memory(app, buf, total, "caca");
    9393
    9494        if(bytes > 0)
  • libcaca/trunk/src/cacaserver.c

    r3412 r3495  
    22 *  cacaserver    Colour ASCII-Art library
    33 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
    4  *                2006 Sam Hocevar <sam@zoy.org>
     4 *                2006-2009 Sam Hocevar <sam@hocevar.net>
    55 *                All Rights Reserved
    66 *
     
    214214        }
    215215
    216         while(caca_import_memory(server->canvas, server->input,
    217                                   server->read, "caca") < 0)
     216        while(caca_import_canvas_from_memory(server->canvas, server->input,
     217                                             server->read, "caca") < 0)
    218218        {
    219219            memmove(server->input, server->input + 1, server->read - 1);
     
    225225            ssize_t needed, wanted;
    226226
    227             needed = caca_import_memory(server->canvas, server->input,
    228                                          server->read, "caca");
     227            needed = caca_import_canvas_from_memory(server->canvas,
     228                                                    server->input,
     229                                                    server->read, "caca");
    229230            if(needed < 0)
    230231                goto restart;
     
    253254        /* Get ANSI representation of the image and skip the end-of buffer
    254255         * linefeed ("\r\n", 2 byte) */
    255         server->buffer = caca_export_memory(server->canvas, "utf8cr",
    256                                              &server->buflen);
     256        server->buffer = caca_export_canvas_to_memory(server->canvas, "utf8cr",
     257                                                      &server->buflen);
    257258        server->buflen -= 2;
    258259
  • libcaca/trunk/src/img2txt.c

    r2833 r3495  
    11/*
    22 *  img2txt       image to text converter
    3  *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
     3 *  Copyright (c) 2006-2009 Sam Hocevar <sam@hocevar.net>
    44 *                2007 Jean-Yves Lamoureux <jylam@lnxscene.org>
    55 *                All Rights Reserved
     
    8282    printf(
    8383    "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n"
    84     "Internet: <sam@zoy.org> <jylam@lnxscene.org> Version: %s, date: %s\n"
     84    "Internet: <sam@hocevar.net> <jylam@lnxscene.org> Version: %s, date: %s\n"
    8585    "\n"
    8686    "img2txt, along with its documentation, may be freely copied and distributed.\n"
     
    225225    unload_image(i);
    226226
    227     export = caca_export_memory(cv, format?format:"ansi", &len);
     227    export = caca_export_canvas_to_memory(cv, format?format:"ansi", &len);
    228228    if(!export)
    229229    {
Note: See TracChangeset for help on using the changeset viewer.