X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Foverlaydirect.h;fp=cinelerra-5.1%2Fcinelerra%2Foverlaydirect.h;h=ebdc30f883f1e3a489ecadfaec9bd29bd76da8c0;hb=15411d7912d8aa1b9bea6ba8862517b058861771;hp=0000000000000000000000000000000000000000;hpb=cb1a1530246ad67fb9be9aa2dbba5b88eb63e933;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/overlaydirect.h b/cinelerra-5.1/cinelerra/overlaydirect.h new file mode 100644 index 00000000..ebdc30f8 --- /dev/null +++ b/cinelerra-5.1/cinelerra/overlaydirect.h @@ -0,0 +1,30 @@ +#ifndef __OVERLAYDIRECT_H__ +#define __OVERLAYDIRECT_H__ +#include "overlayframe.h" + +#define XBLEND(FN, temp_type, type, max, components, ofs, round) { \ + temp_type opcty = fade * max + round, trnsp = max - opcty; \ + type** output_rows = (type**)output->get_rows(); \ + type** input_rows = (type**)input->get_rows(); \ + ix *= components; ox *= components; \ + \ + for( int i=pkg->out_row1; iout_row2; ++i ) { \ + type* in_row = input_rows[i + iy] + ix; \ + type* output = output_rows[i] + ox; \ + for( int j=ow; --j>=0; ) { \ + if( components == 4 ) { \ + temp_type r, g, b, a; \ + ALPHA4_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \ + ALPHA4_STORE(output, ofs, max); \ + } \ + else { \ + temp_type r, g, b; \ + ALPHA3_BLEND(FN, temp_type, in_row, output, max, ofs, ofs, round); \ + ALPHA3_STORE(output, ofs, max); \ + } \ + in_row += components; output += components; \ + } \ + } \ +} break + +#endif