loaders: PNG: Handle gamma on 16bpp conversion
[gfxprim.git] / libs / filters / GP_BrightnessContrast.gen.c.t
blobc25c5b10d5cbf6a8ebc81d26d1a43de20d7a6bf0
1 @ include source.t
2 /*
3  * Brightness and Contrast Point filter
4  *
5  * Copyright (C) 2009-2014 Cyril Hrubis <metan@ucw.cz>
6  */
8 #include "core/GP_Clamp.h"
10 @ include point_filter.t
11 @ def filter_op_brightness_contrast(val, val_max):
12 GP_CLAMP_GENERIC(c * {{ val }} + b * {{ val_max }} + 0.5, 0, {{ val_max }})
13 @ end
15 {@ filter_point('BrightnessContrast', filter_op_brightness_contrast, 'float b, float c', 'b, c') @}