loaders: JPG: Fix bussy loop on corrupted file.
[gfxprim.git] / libs / filters / GP_Addition.gen.c.t
blob683e9fafff381663b3ac8491ffdec2c48c03405a
1 @ include source.t
2 /*
3  * Addition filter -- Addition of two bitmaps.
4  *
5  * Copyright (C) 2012-2014 Cyril Hrubis <metan@ucw.cz>
6  */
8 #include "core/GP_Clamp.h"
10 @ include arithmetic_filter.t
12 @ def filter_op(chan_name, chan_size):
13 {{ chan_name }} = {{ chan_name }}_A + {{ chan_name }}_B;
14 GP_CLAMP_GENERIC({{ chan_name }}, 0, {{ 2 ** chan_size - 1 }});
15 @ end
17 {@ filter_arithmetic('Addition', filter_op) @}