1 #ifndef __OVERLAYNEAREST_H__
2 #define __OVERLAYNEAREST_H__
3 #include "overlayframe.h"
5 #define XBLEND_3NN(FN, temp_type, type, max, components, ofs, round) { \
6 temp_type opcty = fade * max + round, trnsp = max - opcty; \
7 type** output_rows = (type**)output->get_rows(); \
8 type** input_rows = (type**)input->get_rows(); \
11 for( int i=pkg->out_row1; i<pkg->out_row2; ++i ) { \
12 int *lx = engine->in_lookup_x; \
13 type* in_row = input_rows[*ly++]; \
14 type* output = output_rows[i] + ox; \
15 for( int j=ow; --j>=0; ) { \
17 if( components == 4 ) { \
18 temp_type r, g, b, a; \
19 ALPHA4_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
20 ALPHA4_STORE(output, ofs, max); \
24 ALPHA3_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
25 ALPHA3_STORE(output, ofs, max); \
27 output += components; \