Changeset 1870 for libcaca/trunk/cucul/dither.c
- Timestamp:
- 11/03/07 23:59:53 (6 years ago)
- File:
-
- 1 edited
-
libcaca/trunk/cucul/dither.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/dither.c
r1833 r1870 419 419 } 420 420 421 /** \brief Get the brightness of a dither object. 422 * 423 * Get the brightness of the given dither object. 424 * 425 * This function never fails. 426 * 427 * \param d Dither object. 428 * \return Brightness value. 429 */ 430 float cucul_get_dither_brightness(cucul_dither_t *d) 431 { 432 /* FIXME */ 433 return 0.0; 434 } 435 421 436 /** \brief Set the gamma of a dither object. 422 437 * 423 * Set the gamma of dither. 438 * Set the gamma of the given dither object. A negative value causes 439 * colour inversion. 424 440 * 425 441 * If an error occurs, -1 is returned and \b errno is set accordingly: … … 433 449 { 434 450 /* FIXME: we don't need 4096 calls to gammapow(), we could just compute 435 * 128of them and do linear interpolation for the rest. This will451 * a few of them and do linear interpolation for the rest. This will 436 452 * probably speed up things a lot. */ 437 453 int i; 438 454 439 if(gamma <= 0.0) 455 if(gamma < 0.0) 456 { 457 d->invert = 1; 458 gamma = -gamma; 459 } 460 else if(gamma == 0.0) 440 461 { 441 462 seterrno(EINVAL); … … 451 472 } 452 473 453 /** \brief Invert colors of dither454 * 455 * Invert colors of dither.474 /** \brief Get the gamma of a dither object. 475 * 476 * Get the gamma of the given dither object. 456 477 * 457 478 * This function never fails. 458 479 * 459 480 * \param d Dither object. 460 * \param value 0 for normal behaviour, 1 for invert 461 * \return This function always returns 0. 462 */ 463 int cucul_set_dither_invert(cucul_dither_t *d, int value) 464 { 465 d->invert = value ? 1 : 0; 466 467 return 0; 481 * \return Gamma value. 482 */ 483 float cucul_get_dither_gamma(cucul_dither_t *d) 484 { 485 return d->gamma; 468 486 } 469 487
Note: See TracChangeset
for help on using the changeset viewer.
