… | |
… | |
37 | sec->blue,NULL); |
37 | sec->blue,NULL); |
38 | return image; |
38 | return image; |
39 | } |
39 | } |
40 | |
40 | |
41 | |
41 | |
|
|
42 | static int psiconv_gen_image_clipart(FILE *of, psiconv_clipart_f f, |
|
|
43 | const char *dest) |
|
|
44 | { |
|
|
45 | #if IMAGEMAGICK |
|
|
46 | psiconv_clipart_section section; |
|
|
47 | MagickInfo *mi = GetMagickInfo(dest); |
|
|
48 | ImageInfo image_info; |
|
|
49 | Image *image = NULL; |
|
|
50 | Image *last_image = NULL; |
|
|
51 | Image *this_image; |
|
|
52 | int i; |
|
|
53 | |
|
|
54 | if ((psiconv_list_length(f->sections) < 1) || |
|
|
55 | ((psiconv_list_length(f->sections)) > 1 && ! (mi->adjoin))) |
|
|
56 | #endif |
|
|
57 | return -1; |
|
|
58 | #if IMAGEMAGICK |
|
|
59 | for (i = 0; i < psiconv_list_length(f->sections); i++) { |
|
|
60 | section = psiconv_list_get(f->sections,i); |
|
|
61 | this_image = get_paint_data_section(section->picture); |
|
|
62 | if (! image) { |
|
|
63 | image = this_image; |
|
|
64 | last_image = image; |
|
|
65 | } else { |
|
|
66 | last_image->next=this_image; |
|
|
67 | this_image->previous=last_image; |
|
|
68 | this_image->scene=i; |
|
|
69 | last_image=this_image; |
|
|
70 | } |
|
|
71 | } |
|
|
72 | |
|
|
73 | GetImageInfo(&image_info); |
|
|
74 | image_info.file = of; |
|
|
75 | strcpy(image->magick, dest); |
|
|
76 | image_info.adjoin=1; |
|
|
77 | WriteImage(&image_info,image); |
|
|
78 | return 0; |
|
|
79 | #endif |
|
|
80 | } |
|
|
81 | |
42 | static int psiconv_gen_image_mbm(FILE *of, psiconv_mbm_f f, const char *dest) |
82 | static int psiconv_gen_image_mbm(FILE *of, psiconv_mbm_f f, const char *dest) |
43 | { |
83 | { |
44 | #if IMAGEMAGICK |
84 | #if IMAGEMAGICK |
45 | psiconv_paint_data_section section; |
85 | psiconv_paint_data_section section; |
46 | MagickInfo *mi = GetMagickInfo(dest); |
86 | MagickInfo *mi = GetMagickInfo(dest); |
… | |
… | |
54 | ((psiconv_list_length(f->sections)) > 1 && ! (mi->adjoin))) |
94 | ((psiconv_list_length(f->sections)) > 1 && ! (mi->adjoin))) |
55 | #endif |
95 | #endif |
56 | return -1; |
96 | return -1; |
57 | #if IMAGEMAGICK |
97 | #if IMAGEMAGICK |
58 | for (i = 0; i < psiconv_list_length(f->sections); i++) { |
98 | for (i = 0; i < psiconv_list_length(f->sections); i++) { |
59 | section = psiconv_list_get(f->sections,0); |
99 | section = psiconv_list_get(f->sections,i); |
60 | this_image = get_paint_data_section(section); |
100 | this_image = get_paint_data_section(section); |
61 | if (! image) { |
101 | if (! image) { |
62 | image = image; |
102 | image = this_image; |
63 | last_image = image; |
103 | last_image = image; |
64 | } else { |
104 | } else { |
65 | last_image->next=this_image; |
105 | last_image->next=this_image; |
66 | this_image->previous=last_image; |
106 | this_image->previous=last_image; |
|
|
107 | this_image->scene=i; |
|
|
108 | last_image=this_image; |
67 | } |
109 | } |
68 | } |
110 | } |
69 | |
111 | |
70 | GetImageInfo(&image_info); |
112 | GetImageInfo(&image_info); |
71 | image_info.file = of; |
113 | image_info.file = of; |
72 | strcpy(image->magick, dest); |
114 | strcpy(image->magick, dest); |
|
|
115 | image_info.adjoin=1; |
73 | WriteImage(&image_info,image); |
116 | WriteImage(&image_info,image); |
74 | return 0; |
117 | return 0; |
75 | #endif |
118 | #endif |
76 | } |
119 | } |
77 | |
120 | |
… | |
… | |
93 | static int psiconv_gen_image(FILE * of, const psiconv_file file, |
136 | static int psiconv_gen_image(FILE * of, const psiconv_file file, |
94 | const char *dest) |
137 | const char *dest) |
95 | { |
138 | { |
96 | if (file->type == psiconv_mbm_file) |
139 | if (file->type == psiconv_mbm_file) |
97 | return psiconv_gen_image_mbm(of,(psiconv_mbm_f) file->file,dest); |
140 | return psiconv_gen_image_mbm(of,(psiconv_mbm_f) file->file,dest); |
|
|
141 | if (file->type == psiconv_clipart_file) |
|
|
142 | return psiconv_gen_image_clipart(of,(psiconv_clipart_f) file->file,dest); |
98 | else if (file->type == psiconv_sketch_file) { |
143 | else if (file->type == psiconv_sketch_file) { |
99 | psiconv_gen_image_sketch(of,(psiconv_sketch_f) file->file,dest); |
144 | psiconv_gen_image_sketch(of,(psiconv_sketch_f) file->file,dest); |
100 | return 0; |
145 | return 0; |
101 | } else |
146 | } else |
102 | return -1; |
147 | return -1; |