Changeset 690 for libcaca/trunk
- Timestamp:
- Mar 24, 2006, 8:34:45 PM (15 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/bitmap.c
r672 r690 150 150 float gamma; 151 151 int gammatab[4097]; 152 unsigned char invert; 152 153 }; 153 154 #endif … … 314 315 bitmap->gammatab[i] = i; 315 316 317 /* No color inversion by default */ 318 bitmap->invert = 0; 319 316 320 return bitmap; 317 321 } … … 379 383 bitmap->gammatab[i] = 4096.0 * gammapow((float)i / 4096.0, 1.0 / gamma); 380 384 } 385 386 387 /** 388 * \brief Invert colors of bitmap 389 * 390 * Invert colors of bitmap 391 * 392 * \param bitmap Bitmap object. 393 * \param value 0 for normal behaviour, 1 for invert 394 */ 395 void cucul_set_bitmap_invert(struct cucul_bitmap *bitmap, unsigned char value) 396 { 397 bitmap->invert = (value==0)?0:1; 398 } 399 400 381 401 382 402 /** … … 782 802 } 783 803 804 if(bitmap->invert) { 805 outfg = 15-outfg; 806 outbg = 15-outfg; 807 } 808 784 809 /* Now output the character */ 785 810 cucul_set_color(qq, outfg, outbg); -
libcaca/trunk/cucul/cucul.h
r678 r690 224 224 void cucul_set_bitmap_gamma(struct cucul_bitmap *, float); 225 225 void cucul_draw_bitmap(cucul_t *, int, int, int, int, struct cucul_bitmap const *, void *); 226 void cucul_set_bitmap_invert(struct cucul_bitmap *, unsigned char); 226 227 void cucul_free_bitmap(struct cucul_bitmap *); 227 228 /* @} */ -
libcaca/trunk/test/demo.c
r689 r690 494 494 *dest++ = (x << 16) | (y << 8) | (z); 495 495 } 496 496 cucul_set_bitmap_invert(bitmap, 1); 497 497 //bitmap = cucul_create_bitmap(16, 256, 256, 2 * 256, 0xf800, 0x07e0, 0x001f, 0x0000); 498 498 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); … … 541 541 542 542 bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); 543 cucul_set_bitmap_invert(bitmap, 1); 543 544 cucul_draw_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, bitmap, (char *)buffer); 544 545 cucul_free_bitmap(bitmap);
Note: See TracChangeset
for help on using the changeset viewer.