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);
49 int isIDS(const KGString *in);
50 void divideInto2(const KGString *in, KGString *partIDS1, KGString *partIDS3);
51 void divideInto3(const KGString *in, KGString *partIDS1, KGString *partIDS2, KGString *partIDS3);
52 void addStrokeWithTransform(const KGString *stroke, const int num, const int *tf, KGString *out, int mode);
53 void convertArray(int *buf, KGString *out, int size, int mode);
54 int * convertStroke(const char *in, int *a, int *size);
55 void convert99(const KGString *in, KGString *out);
56 void convert99calc(const char *in, KGString *out);
58 void DotsWidth(int *dlx, int *drx);
59 void DotsHeight(int *dly, int *dry);
60 void PartsWidth(const KGString *in, int *lx, int *rx);
61 void PartsHeight(const KGString *in, int *ly, int *ry);
62 KGString * CalcSizes(const KGString *in, int mode);
64 void CalcOptions(const KGString *in, int *mitsudo, int *flag, double *yoko, double *tate);
65 void DoDrawParts(const KGString *in, const int lx1, const double rf1, const int ly1, const double rfy1);
66 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);
68 void combineYoko2(const KGString *parts1, const KGString *parts3, int *result);
69 void combineYoko3(const KGString *parts1, const KGString *parts2, const KGString *parts3, int *result);
70 void combineTate2(const KGString *parts1, const KGString *parts3, int *result);
71 void combineTate3(const KGString *parts1, const KGString *parts2, const KGString *parts3, int *result);
72 void combineHame2(const KGString *parts1, const KGString *parts3, int *result, int surround);
76 void searchPartsData(const KGString *in, KGString *out);
77 void searchAliasData(const KGString *in, KGString *out);
79 png_bytepp initPng(int width, int height);
80 int closePng(int width, int height, png_bytepp canvas);
81 int writePng(int width, int height, png_bytepp image, FILE *fp);
83 void fillPolygon(kPoint *p, int number, int col, unsigned char **image);