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/examples/text.c

    r2821 r3495  
    11/*
    22 *  text          canvas text import/export
    3  *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
     3 *  Copyright (c) 2006-2009 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    4242
    4343    pig = caca_create_canvas(0, 0);
    44     caca_import_memory(pig, STRING, strlen(STRING), "text");
     44    caca_import_canvas_from_memory(pig, STRING, strlen(STRING), "text");
    4545
    4646    cv = caca_create_canvas(caca_get_canvas_width(pig) * 2,
     
    7777    }
    7878
    79     buffer = caca_export_memory(cv, "utf8", &len);
     79    buffer = caca_export_canvas_to_memory(cv, "utf8", &len);
    8080    fwrite(buffer, len, 1, stdout);
    8181    free(buffer);
    8282
    8383    caca_rotate_left(cv);
    84     buffer = caca_export_memory(cv, "utf8", &len);
     84    buffer = caca_export_canvas_to_memory(cv, "utf8", &len);
    8585    fwrite(buffer, len, 1, stdout);
    8686    free(buffer);
Note: See TracChangeset for help on using the changeset viewer.