- swfoutput_internal*i = (swfoutput_internal*)obj->internal;
-
- RGBA*newpic=0;
-
- double l1 = sqrt((x4-x1)*(x4-x1) + (y4-y1)*(y4-y1));
- double l2 = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
-
- gfxline_t p1,p2,p3,p4,p5;
- p1.type=gfx_moveTo;p1.x=x1; p1.y=y1;p1.next=&p2;
- p2.type=gfx_lineTo;p2.x=x2; p2.y=y2;p2.next=&p3;
- p3.type=gfx_lineTo;p3.x=x3; p3.y=y3;p3.next=&p4;
- p4.type=gfx_lineTo;p4.x=x4; p4.y=y4;p4.next=&p5;
- p5.type=gfx_lineTo;p5.x=x1; p5.y=y1;p5.next=0;
-
- {p1.x = (int)(p1.x*20)/20.0;
- p1.y = (int)(p1.y*20)/20.0;
- p2.x = (int)(p2.x*20)/20.0;
- p2.y = (int)(p2.y*20)/20.0;
- p3.x = (int)(p3.x*20)/20.0;
- p3.y = (int)(p3.y*20)/20.0;
- p4.x = (int)(p4.x*20)/20.0;
- p4.y = (int)(p4.y*20)/20.0;
- p5.x = (int)(p5.x*20)/20.0;
- p5.y = (int)(p5.y*20)/20.0;
- }
-
- float m00,m10,tx;
- float m01,m11,ty;
-
- gfxmatrix_t m;
- m.m00 = (p4.x-p1.x)/sizex; m.m10 = (p2.x-p1.x)/sizey;
- m.m01 = (p4.y-p1.y)/sizex; m.m11 = (p2.y-p1.y)/sizey;
- m.tx = p1.x - 0.5;
- m.ty = p1.y - 0.5;
-
- gfximage_t img;
- img.data = (gfxcolor_t*)data;
- img.width = sizex;
- img.height = sizey;
-
- if(type == IMAGE_TYPE_JPEG)
- /* TODO: pass image_dpi to device instead */
- i->device.setparameter(&i->device, "next_bitmap_is_jpeg", "1");
-
- i->device.fillbitmap(&i->device, &p1, &img, &m, 0);
-}
-
-void swfoutput_drawimagejpeg(struct swfoutput*obj, RGBA*mem, int sizex,int sizey,
- double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4)
-{
- swfoutput_drawimage(obj,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_JPEG);
-}
-
-void swfoutput_drawimagelossless(struct swfoutput*obj, RGBA*mem, int sizex,int sizey,
- double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4)
-{
- swfoutput_drawimage(obj,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_LOSSLESS);
-}