Last change
on this file since 3122 was
3122,
checked in by nico, 14 years ago
|
- Add working sample program dithering.php (open logo-caca.png with Gd and
render it with caca caca_dither_bitmap_gd)
- Add a function to fetch a buffer of gd pixels in php_caca.c
|
-
Property svn:executable set to
*
|
File size:
468 bytes
|
Line | |
---|
1 | #!/usr/bin/php5 |
---|
2 | <? |
---|
3 | $img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png"); |
---|
4 | $canvas = caca_create_canvas(0, 0); |
---|
5 | |
---|
6 | $dither = caca_create_dither(32, 128, 128, 4 * 128, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000); |
---|
7 | |
---|
8 | $display = caca_create_display($canvas); |
---|
9 | caca_set_display_time($display, 80000); |
---|
10 | |
---|
11 | caca_dither_bitmap_gd($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img); |
---|
12 | caca_refresh_display($display); |
---|
13 | |
---|
14 | sleep(5); |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
Note: See
TracBrowser
for help on using the repository browser.