-#define CENTER_H xS(20)
-#define CENTER_W yS(20)
-#define DRAW_CENTER(components, type, max) \
-{ \
- type **rows = (type**)get_output()->get_rows(); \
- if( (center_x >= 0 && center_x < w) && (center_y >= 0 && center_y < h) ) \
- { \
- for(int i = center_x - CENTER_W / 2; i <= center_x + CENTER_W / 2; i++) \
- { \
- if(i >= 0 && i < w) \
- { \
- type *hrow = rows[center_y] + components * i; \
- hrow[0] = max - hrow[0]; \
- hrow[1] = max - hrow[1]; \
- hrow[2] = max - hrow[2]; \
- hrow += components; \
- } \
- } \
- \
- for(int i = center_y - CENTER_W / 2; i <= center_y + CENTER_W / 2; i++) \
- { \
- if(i >= 0 && i < h) \
- { \
- type *vrow = rows[i] + center_x * components; \
- vrow[0] = max - vrow[0]; \
- vrow[1] = max - vrow[1]; \
- vrow[2] = max - vrow[2]; \
- } \
- } \
- } \
-}
-
- if(config.draw_pivot)
- {
- int center_x = (int)(config.pivot_x * w / 100); \
- int center_y = (int)(config.pivot_y * h / 100); \
-
-//printf("RotateEffect::process_buffer %d %d %d\n", __LINE__, center_x, center_y);
- switch(get_output()->get_color_model())
- {
- case BC_RGB_FLOAT:
- DRAW_CENTER(3, float, 1.0)
- break;
- case BC_RGBA_FLOAT:
- DRAW_CENTER(4, float, 1.0)
- break;
- case BC_RGB888:
- DRAW_CENTER(3, unsigned char, 0xff)
- break;
- case BC_RGBA8888:
- DRAW_CENTER(4, unsigned char, 0xff)
- break;
- case BC_YUV888:
- DRAW_CENTER(3, unsigned char, 0xff)
- break;
- case BC_YUVA8888:
- DRAW_CENTER(4, unsigned char, 0xff)
- break;
- }
+ if(config.draw_pivot) {
+ VFrame *vframe = get_output();
+ int w = vframe->get_w(), h = vframe->get_h();
+ int mx = w > h ? w : h;
+ int lw = mx/400 + 1, cxy = mx/80;
+ int center_x = (int)(config.pivot_x * w/100);
+ int center_y = (int)(config.pivot_y * h/100);
+ int x1 = center_x - cxy, x2 = center_x + cxy;
+ int y1 = center_y - cxy, y2 = center_y + cxy;
+ vframe->set_pixel_color(WHITE);
+ for( int i=0; i<lw; ++i )
+ frame->draw_line(x1-i,center_y-i, x2-i,center_y-i);
+ vframe->set_pixel_color(BLACK);
+ for( int i=1; i<=lw; ++i )
+ frame->draw_line(x1+i,center_y+i, x2+i,center_y+i);
+ vframe->set_pixel_color(WHITE);
+ for( int i=0; i<lw; ++i )
+ frame->draw_line(center_x-i,y1-i, center_x-i,y2-i);
+ vframe->set_pixel_color(BLACK);
+ for( int i=1; i<=lw; ++i )
+ frame->draw_line(center_x+i,y1+i, center_x+i,y2+i);