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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.