2 Header file for swfoutput.cc (and swfoutput_x11.cc).
4 Part of the swftools package.
6 Copyright (c) 2001,2002,2003 Matthias Kramm <kramm@quiss.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
22 #ifndef __swfoutput_h__
23 #define __swfoutput_h__
26 #include "../lib/rfxswf.h"
28 typedef long int twip;
31 double m11,m12,m21,m22,m13,m23;
43 double fontm11,fontm12,fontm21,fontm22;
52 /* outline definition, adapted from t1lib.h */
54 /* A fractional point */
60 /* A straight outline segment, stroked or not stroked */
61 typedef struct pathsegment {
62 char type; /* type of segment (line or move) */
63 unsigned char flag; /* type1 rasterizer internal stuff */
64 short references; /* type1 rasterizer internal stuff */
65 unsigned char size; /* size of the structure */
66 unsigned char context; /* index to device context */
67 struct pathsegment *link; /* pointer to next structure in linked list */
68 struct pathsegment *last; /* pointer to last structure in list */
69 SWF_PATHPOINT dest; /* relative ending location of path segment */
72 /* A third order bezier segment */
73 typedef struct bezierpathsegment {
74 char type; /* type of segment (bezier) */
75 unsigned char flag; /* type1 rasterizer internal stuff */
76 short references; /* type1 rasterizer internal stuff */
77 unsigned char size; /* as with any 'segment' type */
78 unsigned char context; /* as with any 'segment' type */
79 SWF_PATHSEGMENT *link; /* as with any 'segment' type */
80 SWF_PATHSEGMENT *last; /* as with any 'segment' type */
81 SWF_PATHPOINT dest; /* ending point (D) */
82 SWF_PATHPOINT B; /* control point B */
83 SWF_PATHPOINT C; /* control point C */
86 typedef SWF_PATHSEGMENT SWF_OUTLINE;
88 #define SWF_PATHTYPE_LINE 0x10
89 #define SWF_PATHTYPE_BEZIER 0x12
90 #define SWF_PATHTYPE_MOVE 0x15
93 #define DRAWMODE_STROKE 1
94 #define DRAWMODE_FILL 2
95 #define DRAWMODE_EOFILL 3
96 #define DRAWMODE_CLIP 4
97 #define DRAWMODE_EOCLIP 5
99 void swfoutput_setparameter(char*name, char*value);
101 void swfoutput_init(struct swfoutput*);
102 int swfoutput_save(struct swfoutput*, char*filename);
103 void swfoutput_newpage(struct swfoutput*, int pageNum, int movex, int movey, int x1, int y1, int x2, int y2);
104 void swfoutput_setfont(struct swfoutput*, char*fontid, char*filename);
105 int swfoutput_queryfont(struct swfoutput*, char*fontid);
106 int getCharID(SWFFONT *font, int charnr, char *charname, int u);
108 void swfoutput_setdrawmode(struct swfoutput*, int drawmode);
109 void swfoutput_setfillcolor(struct swfoutput*, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
110 void swfoutput_setstrokecolor(struct swfoutput*, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
111 void swfoutput_setfontmatrix(struct swfoutput*,double,double,double,double);
112 void swfoutput_setlinewidth(struct swfoutput*, double linewidth);
114 int swfoutput_drawchar(struct swfoutput*,double x,double y,char*a, int charnr, int u);
115 void swfoutput_drawpath(struct swfoutput*, SWF_OUTLINE*outline, struct swfmatrix*m);
116 #define LINE_CAP_BUTT 0
117 #define LINE_CAP_ROUND 1
118 #define LINE_CAP_SQUARE 2
119 #define LINE_JOIN_MITER 0
120 #define LINE_JOIN_ROUND 1
121 #define LINE_JOIN_BEVEL 2
122 void swfoutput_drawpath2poly(struct swfoutput*, SWF_OUTLINE*outline, struct swfmatrix*m, int line_join, int line_cap, double line_width, double miter_limit);
123 void swfoutput_startclip(struct swfoutput*, SWF_OUTLINE*outline, struct swfmatrix*m);
124 void swfoutput_endclip(struct swfoutput*);
125 int swfoutput_drawimagejpeg(struct swfoutput*, RGBA*pic, int sizex,int sizey,
129 double x4,double y4);
130 int swfoutput_drawimagelossless(struct swfoutput*, RGBA*pic, int sizex, int sizey,
134 double x4,double y4);
135 int swfoutput_drawimagelosslessN(struct swfoutput*, U8*pic, RGBA*pal, int sizex, int sizey,
139 double x4,double y4, int n);
140 void swfoutput_drawimageagain(struct swfoutput*, int id, int sizex, int sizey,
144 double x4,double y4);
146 void swfoutput_linktopage(struct swfoutput*, int page, swfcoord*points);
147 void swfoutput_linktourl(struct swfoutput*, char*url, swfcoord*points);
148 void swfoutput_namedlink(struct swfoutput*obj, char*name, swfcoord*points);
150 void swfoutput_destroy(struct swfoutput*);
152 #endif //__swfoutput_h__