浏览代码

* src/bitmap.c:

+ Renamed gammaval into gamma.
    + Fixed Doxygen comments.
tags/v0.99.beta14
Sam Hocevar sam 19 年前
父节点
当前提交
f42fd33636
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. +6
    -6
      src/bitmap.c

+ 6
- 6
src/bitmap.c 查看文件

@@ -170,7 +170,7 @@ struct caca_bitmap
int rleft, gleft, bleft, aleft; int rleft, gleft, bleft, aleft;
void (*get_hsv)(struct caca_bitmap *, char *, int, int); void (*get_hsv)(struct caca_bitmap *, char *, int, int);
int red[256], green[256], blue[256], alpha[256]; int red[256], green[256], blue[256], alpha[256];
float gammaval;
float gamma;
int gammatab[4097]; int gammatab[4097];
}; };
#endif #endif
@@ -325,19 +325,19 @@ void caca_set_bitmap_palette(struct caca_bitmap *bitmap,
* Set the gamma of bitmap. * Set the gamma of bitmap.
* *
* \param bitmap Bitmap object. * \param bitmap Bitmap object.
* \param red Gamma value.
* \param gamma Gamma value.
*/ */
void caca_set_bitmap_gamma(struct caca_bitmap *bitmap, float gammaval)
void caca_set_bitmap_gamma(struct caca_bitmap *bitmap, float gamma)
{ {
int i; int i;


if(gammaval <= 0.0)
if(gamma <= 0.0)
return; return;


bitmap->gammaval = gammaval;
bitmap->gamma = gamma;


for(i = 0; i < 4096; i++) for(i = 0; i < 4096; i++)
bitmap->gammatab[i] = 4096.0 * caca_powf((float)i / 4096.0, 1.0 / gammaval);
bitmap->gammatab[i] = 4096.0 * caca_powf((float)i / 4096.0, 1.0 / gamma);
} }


/** /**


正在加载...
取消
保存