Changeset 734 for libcaca/trunk/test
- Timestamp:
- Apr 10, 2006, 10:02:38 PM (15 years ago)
- Location:
- libcaca/trunk/test
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/test/demo.c
r711 r734 484 484 static void demo_render(void) 485 485 { 486 struct cucul_ bitmap *bitmap;486 struct cucul_dither *dither; 487 487 //short buffer[256*256]; 488 488 //short *dest = buffer; … … 501 501 *dest++ = (x << 16) | (y << 8) | (z); 502 502 } 503 cucul_set_ bitmap_invert(bitmap, 1);504 // bitmap = cucul_create_bitmap(16, 256, 256, 2 * 256, 0xf800, 0x07e0, 0x001f, 0x0000);505 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);506 cucul_d raw_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,507 bitmap, buffer);508 cucul_free_ bitmap(bitmap);503 cucul_set_dither_invert(dither, 1); 504 //dither = cucul_create_dither(16, 256, 256, 2 * 256, 0xf800, 0x07e0, 0x001f, 0x0000); 505 dither = cucul_create_dither(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); 506 cucul_dither_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, 507 dither, buffer); 508 cucul_free_dither(dither); 509 509 } 510 510 #endif … … 514 514 static void demo_render(void) 515 515 { 516 struct cucul_ bitmap *bitmap;516 struct cucul_dither *dither; 517 517 int buffer[256*256]; 518 518 int *dest; … … 547 547 draw_circle(buffer, xo, yo, z, 0x000000ff, 200); 548 548 549 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);550 cucul_set_ bitmap_invert(bitmap, 1);551 cucul_d raw_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, bitmap, (char *)buffer);552 cucul_free_ bitmap(bitmap);549 dither = cucul_create_dither(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); 550 cucul_set_dither_invert(dither, 1); 551 cucul_dither_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, dither, (char *)buffer); 552 cucul_free_dither(dither); 553 553 } 554 554 -
libcaca/trunk/test/export.c
r706 r734 36 36 { 37 37 cucul_t *qq; 38 struct cucul_ bitmap *bitmap;38 struct cucul_dither *dither; 39 39 struct cucul_export *buffer; 40 40 int x, y; … … 73 73 } 74 74 75 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256,75 dither = cucul_create_dither(32, 256, 256, 4 * 256, 76 76 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); 77 cucul_d raw_bitmap(qq, 0, 0,78 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,79 bitmap, pixels);80 cucul_free_ bitmap(bitmap);77 cucul_dither_bitmap(qq, 0, 0, 78 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, 79 dither, pixels); 80 cucul_free_dither(dither); 81 81 82 82 cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK); -
libcaca/trunk/test/gamma.c
r710 r734 37 37 cucul_t *qq, *gg, *mask; 38 38 caca_t *kk; 39 struct cucul_ bitmap*left, *right;39 struct cucul_dither *left, *right; 40 40 float gam = 1.0; 41 41 int x; … … 55 55 } 56 56 57 left = cucul_create_ bitmap(32, 256, 4, 4 * 256,57 left = cucul_create_dither(32, 256, 4, 4 * 256, 58 58 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); 59 right = cucul_create_ bitmap(32, 256, 4, 4 * 256,59 right = cucul_create_dither(32, 256, 4, 4 * 256, 60 60 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); 61 61 caca_set_delay(kk, 20000); … … 81 81 cucul_set_size(mask, cucul_get_width(qq), cucul_get_height(qq)); 82 82 83 /* Draw the regular bitmapon the main canvas */84 cucul_d raw_bitmap(qq, 0, 0,85 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,86 left, buffer);83 /* Draw the regular dither on the main canvas */ 84 cucul_dither_bitmap(qq, 0, 0, 85 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, 86 left, buffer); 87 87 88 /* Draw the gamma-modified bitmapon the spare canvas */89 cucul_set_ bitmap_gamma(right, gam);90 cucul_d raw_bitmap(gg, 0, 0,91 cucul_get_width(gg) - 1, cucul_get_height(gg) - 1,92 right, buffer);88 /* Draw the gamma-modified dither on the spare canvas */ 89 cucul_set_dither_gamma(right, gam); 90 cucul_dither_bitmap(gg, 0, 0, 91 cucul_get_width(gg) - 1, cucul_get_height(gg) - 1, 92 right, buffer); 93 93 94 94 /* Draw something on the mask */ … … 112 112 } 113 113 114 cucul_free_ bitmap(left);115 cucul_free_ bitmap(right);114 cucul_free_dither(left); 115 cucul_free_dither(right); 116 116 117 117 caca_detach(kk); -
libcaca/trunk/test/hsv.c
r710 r734 33 33 caca_t *kk; 34 34 35 struct cucul_ bitmap *bitmap;35 struct cucul_dither *dither; 36 36 int x, y; 37 37 … … 45 45 } 46 46 47 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256,47 dither = cucul_create_dither(32, 256, 256, 4 * 256, 48 48 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); 49 cucul_d raw_bitmap(qq, 0, 0,50 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,51 bitmap, buffer);52 cucul_free_ bitmap(bitmap);49 cucul_dither_bitmap(qq, 0, 0, 50 cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, 51 dither, buffer); 52 cucul_free_dither(dither); 53 53 54 54 caca_display(kk);
Note: See TracChangeset
for help on using the changeset viewer.