add missing GPL information in guicast program files
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / overlaydirect.h
1 #ifndef __OVERLAYDIRECT_H__
2 #define __OVERLAYDIRECT_H__
3 #include "overlayframe.h"
4
5 #define XBLEND(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         ix *= components;  ox *= components; \
10  \
11         for( int i=pkg->out_row1; i<pkg->out_row2; ++i ) { \
12                 type* in_row = input_rows[i + iy] + ix; \
13                 type* output = output_rows[i] + ox; \
14                 for( int j=ow; --j>=0; ) { \
15                         if( components == 4 ) { \
16                                 temp_type r, g, b, a; \
17                                 ALPHA4_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
18                                 ALPHA4_STORE(output, ofs, max); \
19                         } \
20                         else { \
21                                 temp_type r, g, b; \
22                                 ALPHA3_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \
23                                 ALPHA3_STORE(output, ofs, max); \
24                         } \
25                         in_row += components;  output += components; \
26                 } \
27         } \
28 } break
29
30 #endif