Last change
on this file since 3120 was
3120,
checked in by nico, 12 years ago
|
- Improve function "caca_dither_bitmap_gd"
- Add php binding for "caca_create_dither"
- Add new sample program "dithering.php"
|
-
Property svn:executable set to
*
|
File size:
479 bytes
|
Line | |
---|
1 | #!/usr/bin/php5 |
---|
2 | <? |
---|
3 | $img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png"); |
---|
4 | //$img = imagecreatefromjpeg("/home/nicolas/images/Clown Fish-mini.jpg"); |
---|
5 | $canvas = caca_create_canvas(0, 0); |
---|
6 | |
---|
7 | $dither = caca_create_dither(16, 128, 128, 3 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000); |
---|
8 | caca_set_dither_gamma($dither, -1.0); |
---|
9 | |
---|
10 | if (caca_dither_bitmap_gd($canvas, 0, 0, 30, 30, $dither, $img)) { |
---|
11 | $dp = caca_create_display($canvas); |
---|
12 | caca_refresh_display($dp); |
---|
13 | sleep(5); |
---|
14 | } |
---|
15 | |
---|
Note: See
TracBrowser
for help on using the repository browser.