10 // define for localhost environment
11 #define errorFileSize 3992
12 #define errorFileName "error.png"
13 #define pngFilePath "/var/www/v0.4/"
14 #define partsdbFileName "/var/www/kagedb/partsdb"
15 #define idsdbFileName "/var/www/kagedb/idsdb"
16 #define aliasdbFileName "/var/www/kagedb/aliasdb"
21 #define canvasWidth 400
22 #define canvasHeight 400
24 #define min(x1,x2) (((x1) > (x2))? (x2):(x1))
25 #define max(x1,x2) (((x1) > (x2))? (x1):(x2))
33 png_bytepp kageCanvas;
39 KGString *kResultText;
42 void generateGlyph(const KGString *in, KGString *out);
43 void searchPartsData(const KGString *in, KGString *out);
44 void searchAliasData(const KGString *in, KGString *out);
45 void searchCacheData(const KGString *in, KGString *out);
46 void doCombine(const KGString *in, KGString *out);
47 void drawGlyph(const KGString *in, const int mode);
48 KGString* finalAdjustment(const KGString *in);
50 int isIDS(const KGString *in);
51 void divideInto2(const KGString *in, KGString *partIDS1, KGString *partIDS3);
52 void divideInto3(const KGString *in, KGString *partIDS1, KGString *partIDS2, KGString *partIDS3);
53 void addStrokeWithTransform(const KGString *stroke, const int num, const int *tf, KGString *out, int mode);
54 void convertArray(int *buf, KGString *out, int size, int mode);
55 int * convertStroke(const char *in, int *a, int *size);
56 void convert99(const KGString *in, KGString *out);
57 void convert99calc(const char *in, KGString *out);
59 void DotsWidth(int *dlx, int *drx);
60 void DotsHeight(int *dly, int *dry);
61 void PartsWidth(const KGString *in, int *lx, int *rx);
62 void PartsHeight(const KGString *in, int *ly, int *ry);
63 KGString * CalcSizes(const KGString *in, int mode);
65 void CalcOptions(const KGString *in, int *mitsudo, int *flag, double *yoko, double *tate);
66 void DoDrawParts(const KGString *in, const int lx1, const double rf1, const int ly1, const double rfy1);
67 void DoDrawMixFont(const KGString *in1, const int lx1, const double rf1, const KGString *in2, const int lx2, const double rf2, const int ly1, const double rfy1, const int ly2, const double rfy2);
69 void combineYoko2(const KGString *parts1, const KGString *parts3, int *result);
70 void combineYoko3(const KGString *parts1, const KGString *parts2, const KGString *parts3, int *result);
71 void combineTate2(const KGString *parts1, const KGString *parts3, int *result);
72 void combineTate3(const KGString *parts1, const KGString *parts2, const KGString *parts3, int *result);
73 void combineHame2(KGString *parts1, KGString *parts3, int *result, int surround);
74 //void combineHame2(const KGString *parts1, const KGString *parts3, int *result, int surround);
78 void searchPartsData(const KGString *in, KGString *out);
79 void searchAliasData(const KGString *in, KGString *out);
81 png_bytepp initPng(int width, int height);
82 int closePng(int width, int height, png_bytepp canvas);
83 int writePng(int width, int height, png_bytepp image, FILE *fp);
85 void fillPolygon(kPoint *p, int number, int col, unsigned char **image);