Changeset 1876


Ignore:
Timestamp:
11/04/07 10:56:40 (6 years ago)
Author:
sam
Message:
  • cucul_get_dither_brightness() is no longer a stub.
  • Implemented missing cucul_get_dither_contrast().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/dither.c

    r1870 r1876  
    126126    void (*get_hsv)(cucul_dither_t *, char *, int, int); 
    127127    int red[256], green[256], blue[256], alpha[256]; 
    128     float gamma; 
     128 
     129    /* Colour features */ 
     130    float gamma, brightness, contrast; 
    129131    int gammatab[4097]; 
    130132 
     
    325327    } 
    326328 
     329    /* Default gamma value */ 
     330    d->gamma = 1.0; 
     331    for(i = 0; i < 4096; i++) 
     332        d->gammatab[i] = i; 
     333 
     334    /* Default colour properties */ 
     335    d->brightness = 1.0; 
     336    d->contrast = 1.0; 
     337 
    327338    /* Default features */ 
    328339    d->invert = 0; 
    329340    d->antialias = 1; 
    330  
    331     /* Default gamma value */ 
    332     for(i = 0; i < 4096; i++) 
    333         d->gammatab[i] = i; 
    334341 
    335342    /* Default colour mode */ 
     
    416423{ 
    417424    /* FIXME */ 
     425    d->brightness = brightness; 
     426 
    418427    return 0; 
    419428} 
     
    430439float cucul_get_dither_brightness(cucul_dither_t *d) 
    431440{ 
    432     /* FIXME */ 
    433     return 0.0; 
     441    return d->brightness; 
    434442} 
    435443 
     
    500508{ 
    501509    /* FIXME */ 
     510    d->contrast = contrast; 
     511 
    502512    return 0; 
     513} 
     514 
     515/** \brief Get the contrast of a dither object. 
     516 * 
     517 *  Get the contrast of the given dither object. 
     518 * 
     519 *  This function never fails. 
     520 * 
     521 *  \param d Dither object. 
     522 *  \return Contrast value. 
     523 */ 
     524float cucul_get_dither_contrast(cucul_dither_t *d) 
     525{ 
     526    return d->contrast; 
    503527} 
    504528 
Note: See TracChangeset for help on using the changeset viewer.