2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published
4 * by the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * General Public License for more details.
12 * You should have received a copy of the GNU General Public
13 * License along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 #ifndef __OVERLAYNEAREST_H__
20 #define __OVERLAYNEAREST_H__
21 #include "overlayframe.h"
23 #define XBLEND_3NN(FN, temp_type, type, max, components, ofs, round) { \
24 temp_type opcty = fade * max + round, trnsp = max - opcty; \
25 type** output_rows = (type**)output->get_rows(); \
26 type** input_rows = (type**)input->get_rows(); \
29 for( int i=pkg->out_row1; i<pkg->out_row2; ++i ) { \
30 int *lx = engine->in_lookup_x; \
31 type* in_row = input_rows[*ly++]; \
32 type* output = output_rows[i] + ox; \
33 for( int j=ow; --j>=0; ) { \
35 if( components == 4 ) { \
36 temp_type r, g, b, a; \
37 ALPHA4_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
38 ALPHA4_STORE(output, ofs, max); \
42 ALPHA3_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
43 ALPHA3_STORE(output, ofs, max); \
45 output += components; \