Reported by Fedora team for gcc-13 and Andrew created patch here
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / overlaynearest.h
1 #ifndef __OVERLAYNEAREST_H__
2 #define __OVERLAYNEAREST_H__
3 #include "overlayframe.h"
4
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(); \
9         ox *= components; \
10  \
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; ) { \
16                         in_row += *lx++; \
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); \
21                         } \
22                         else { \
23                                 temp_type r, g, b; \
24                                 ALPHA3_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
25                                 ALPHA3_STORE(output, ofs, max); \
26                         } \
27                         output += components; \
28                 } \
29         } \
30 } break
31
32 #endif