-#define COMPARE1(x,y) \
-{ \
- if (pattern_image[x][y] <= threshold) opacity++; \
-}
-
-#define COMPARE2(x,y) \
-{ \
- if (pattern_image[x][y] >= threshold) opacity++; \
-}
-
-// components is always 4
-#define BLEND_ONLY_4_NORMAL(temp_type, type, max, chroma_offset,x,y) \
-{ \
- const int bits = sizeof(type) * 8; \
- temp_type blend_opacity = (temp_type)(alpha * ((temp_type)1 << bits) + 0.5); \
- temp_type blend_transparency = ((temp_type)1 << bits) - blend_opacity; \
- \
- col = y * 4; \
- type* in_row = (type*)incoming->get_rows()[x]; \
- type* output = (type*)outgoing->get_rows()[x]; \
- \
- output[col] = ((temp_type)in_row[col] * blend_opacity + output[col] * blend_transparency) >> bits; \
- output[col+1] = ((temp_type)in_row[col+1] * blend_opacity + output[col+1] * blend_transparency) >> bits; \
- output[col+2] = ((temp_type)in_row[col+2] * blend_opacity + output[col+2] * blend_transparency) >> bits; \
-}
-
-
-// components is always 3
-#define BLEND_ONLY_3_NORMAL(temp_type, type, max, chroma_offset,x,y) \
-{ \
- const int bits = sizeof(type) * 8; \
- temp_type blend_opacity = (temp_type)(alpha * ((temp_type)1 << bits) + 0.5); \
- temp_type blend_transparency = ((temp_type)1 << bits) - blend_opacity; \
- \
- col = y * 3; \
- type* in_row = (type*)incoming->get_rows()[x]; \
- type* output = (type*)outgoing->get_rows()[x]; \
- \
- output[col] = ((temp_type)in_row[col] * blend_opacity + output[col] * blend_transparency) >> bits; \
- output[col+1] = ((temp_type)in_row[col+1] * blend_opacity + output[col+1] * blend_transparency) >> bits; \
- output[col+2] = ((temp_type)in_row[col+2] * blend_opacity + output[col+2] * blend_transparency) >> bits; \
-}
-
-/* opacity is defined as opacity of incoming frame */
-#define BLEND(x,y,total) \
-{ \
- float pixel_opacity = (float)opacity / total; \
- float alpha = pixel_opacity; \
- float pixel_transparency = 1.0 - pixel_opacity; \
- int col; \
- \
- if (pixel_opacity > 0.0) \
- { \
- switch(incoming->get_color_model()) \
- { \
- case BC_RGB_FLOAT: \
- { \
- float *in_row = (float*)incoming->get_rows()[x]; \
- float *out_row = (float*)outgoing->get_rows()[x]; \
- col = y * 3; \
- out_row[col] = in_row[col] * pixel_opacity + \
- out_row[col] * pixel_transparency; \
- out_row[col+1] = in_row[col+1] * pixel_opacity + \
- out_row[col+1] * pixel_transparency; \
- out_row[col+2] = in_row[col+2] * pixel_opacity + \
- out_row[col+2] * pixel_transparency; \
- break; \
- } \
- case BC_RGBA_FLOAT: \
- { \
- float *in_row = (float*)incoming->get_rows()[x]; \
- float *out_row = (float*)outgoing->get_rows()[x]; \
- col = y * 4; \
- out_row[col] = in_row[col] * pixel_opacity + \
- out_row[col] * pixel_transparency; \
- out_row[col+1] = in_row[col+1] * pixel_opacity + \
- out_row[col+1] * pixel_transparency; \
- out_row[col+2] = in_row[col+2] * pixel_opacity + \
- out_row[col+2] * pixel_transparency; \
- break; \
- } \
- case BC_RGB888: \
- BLEND_ONLY_3_NORMAL(uint32_t, unsigned char, 0xff, 0,x,y); \
- break; \
- case BC_YUV888: \
- BLEND_ONLY_3_NORMAL(int32_t, unsigned char, 0xff, 0x80,x,y); \
- break; \
- case BC_RGBA8888: \
- BLEND_ONLY_4_NORMAL(uint32_t, unsigned char, 0xff, 0,x,y); \
- break; \
- case BC_YUVA8888: \
- BLEND_ONLY_4_NORMAL(int32_t, unsigned char, 0xff, 0x80,x,y); \
- break; \
- case BC_RGB161616: \
- BLEND_ONLY_3_NORMAL(uint64_t, uint16_t, 0xffff, 0,x,y); \
- break; \
- case BC_YUV161616: \
- BLEND_ONLY_3_NORMAL(int64_t, uint16_t, 0xffff, 0x8000,x,y); \
- break; \
- case BC_RGBA16161616: \
- BLEND_ONLY_4_NORMAL(uint64_t, uint16_t, 0xffff, 0,x,y); \
- break; \
- case BC_YUVA16161616: \
- BLEND_ONLY_4_NORMAL(int64_t, uint16_t, 0xffff, 0x8000,x,y); \
- break; \
- } \
- } \
-}
-
-int ShapeWipeMain::process_realtime(VFrame *incoming, VFrame *outgoing)