3 * Multiply filter -- Multiplies two images.
5 * Copyright (C) 2012-2014 Cyril Hrubis <metan@ucw.cz>
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 + {{ (2 ** chan_size - 1) // 2}})/ ({{ 2 ** chan_size - 1}});
14 GP_CLAMP_GENERIC({{ chan_name }}, 0, {{ 2 ** chan_size - 1 }});
17 {@ filter_arithmetic('Multiply', filter_op) @}