1 /*
2  * This software is copyrighted as noted below.  It may be freely copied,
3  * modified, and redistributed, provided that the copyright notice is
4  * preserved on all copies.
5  *
6  * There is no warranty or other guarantee of fitness for this software,
7  * it is provided solely "as is".  Bug reports or fixes may be sent
8  * to the author, who may or may not act on them as he desires.
9  *
10  * You may not include this software in a program or other software product
11  * without supplying the source, or without informing the end-user that the
12  * source is available for no extra charge.
13  *
14  * If you modify this software, you should include a notice giving the
15  * name of the person performing the modification, the date of modification,
16  * and the reason for such modification.
17  */
18 /*
19  * lugfnts.c - define all prototypes of LUG subroutines.
20  *
21  * Author:      Raul Rivero
22  *              Mathematics Dept.
23  *              University of Oviedo
24  * Date:        Fri 9 Jul 1993
25  * Copyright (c) 1993, Raul Rivero
26  *
27  */
28 
29 #ifndef MY_DEFINE_PROTOTYPES
30 
31 #define MY_DEFINE_PROTOTYPES
32 
33 /*
34  * We need some of the lug header definitions.
35  */
36 #include <lug.h>
37 
38 /*
39  * Include all what functions needs.
40  */
41 #include <targa.h>
42 #include <alias.h>
43 #include <rla.h>
44 
45 /************************************************
46  *
47  * Interface (read/write) definitions.
48  *
49  */
50 
51 /* cnv.c */
52 
53 extern int
54 read_lug_file(
55 #ifdef USE_PROTOTYPES
56         char *,
57         bitmap_hdr *
58 #endif
59 );
60 
61 extern int
62 write_lug_file(
63 #ifdef USE_PROTOTYPES
64         char *,
65         bitmap_hdr *
66 #endif
67 );
68 
69 extern ifunptr
70 get_readlug_function(
71 #ifdef USE_PROTOTYPES
72         char *
73 #endif
74 );
75 
76 extern ifunptr
77 get_writelug_function(
78 #ifdef USE_PROTOTYPES
79         char *
80 #endif
81 );
82 
83 extern int
84 get_depth_writelug_function(
85 #ifdef USE_PROTOTYPES
86         char *
87 #endif
88 );
89 
90 extern int
91 get_index_function(
92 #ifdef USE_PROTOTYPES
93         char *
94 #endif
95 );
96 
97 extern int
98 get_real_index_function(
99 #ifdef USE_PROTOTYPES
100         char *
101 #endif
102 );
103 
104 
105 /* gif.c */
106 
107 extern int
108 read_gif_file(
109 #ifdef USE_PROTOTYPES
110         char *,
111         bitmap_hdr *
112 #endif
113 );
114 
115 extern int
116 read_gif(
117 #ifdef USE_PROTOTYPES
118         FILE *,
119         bitmap_hdr *
120 #endif
121 );
122 
123 extern int
124 uncode_gif(
125 #ifdef USE_PROTOTYPES
126         FILE *,
127         int,
128         int,
129         bitmap_hdr *
130 #endif
131 );
132 
133 extern int
134 read_code(
135 #ifdef USE_PROTOTYPES
136         byte *,
137         int,
138         int *,
139         int
140 #endif
141 );
142 
143 extern int
144 push_gif(
145 #ifdef USE_PROTOTYPES
146         byte *,
147         int,
148         int
149 #endif
150 );
151 
152 extern int
153 read_gif_hdr(
154 #ifdef USE_PROTOTYPES
155         FILE *
156 #endif
157 );
158 
159 extern byte
160 *read_gif_screen_hdr(
161 #ifdef USE_PROTOTYPES
162         FILE *,
163         int *,
164         int *
165 #endif
166 );
167 
168 extern byte
169 *read_gif_image_hdr(
170 #ifdef USE_PROTOTYPES
171         FILE *,
172         int *,
173         int *,
174         int *,
175         int *
176 #endif
177 );
178 
179 extern void
180 read_gif_extension(
181 #ifdef USE_PROTOTYPES
182         FILE *
183 #endif
184 );
185 
186 extern byte
187 *unblock(
188 #ifdef USE_PROTOTYPES
189         FILE *
190 #endif
191 );
192 
193 extern int
194 write_gif_file(
195 #ifdef USE_PROTOTYPES
196         char *,
197         bitmap_hdr *
198 #endif
199 );
200 
201 extern int
202 write_gif(
203 #ifdef USE_PROTOTYPES
204         FILE *,
205         bitmap_hdr *
206 #endif
207 );
208 
209 extern int
210 write_gif_hdr(
211 #ifdef USE_PROTOTYPES
212         FILE *
213 #endif
214 );
215 
216 extern int
217 write_gif_screen_hdr(
218 #ifdef USE_PROTOTYPES
219         FILE *,
220         bitmap_hdr *
221 #endif
222 );
223 
224 extern int
225 write_gif_cmap(
226 #ifdef USE_PROTOTYPES
227         FILE *,
228         bitmap_hdr *
229 #endif
230 );
231 
232 extern int
233 write_gif_graphics_ctrl_ext(
234 #ifdef USE_PROTOTYPES
235         FILE *,
236         bitmap_hdr *,
237         int
238 #endif
239 );
240 
241 extern int
242 write_gif_image_hdr(
243 #ifdef USE_PROTOTYPES
244         FILE *,
245         bitmap_hdr *
246 #endif
247 );
248 
249 extern void
250 set_write_gif89_flag();
251 
252 extern void
253 unset_write_gif89_flag();
254 
255 /* heightfield.c */
256 
257 extern int
258 write_hf_file(
259 #ifdef USE_PROTOTYPES
260         char *,
261         bitmap_hdr *
262 #endif
263 );
264 
265 extern int
266 write_hf(
267 #ifdef USE_PROTOTYPES
268         FILE *,
269         bitmap_hdr *,
270         double
271 #endif
272 );
273 
274 
275 /* jpeg.c */
276 
277 extern int
278 write_jpeg_file(
279 #ifdef USE_PROTOTYPES
280         char *,
281         bitmap_hdr *
282 #endif
283 );
284 
285 extern int
286 write_jpeg(
287 #ifdef USE_PROTOTYPES
288         FILE *,
289         bitmap_hdr *
290 #endif
291 );
292 
293 extern int
294 write_jpeg_opt(
295 #ifdef USE_PROTOTYPES
296         FILE *,
297         bitmap_hdr *,
298         int
299 #endif
300 );
301 
302 extern int
303 read_jpeg_file(
304 #ifdef USE_PROTOTYPES
305         char *,
306         bitmap_hdr *
307 #endif
308 );
309 
310 extern int
311 read_jpeg(
312 #ifdef USE_PROTOTYPES
313         FILE *,
314         bitmap_hdr *
315 #endif
316 );
317 
318 
319 /* pbm.c */
320 
321 extern int
322 read_pbm_file(
323 #ifdef USE_PROTOTYPES
324         char *,
325         bitmap_hdr *
326 #endif
327 );
328 
329 extern int
330 read_pbm(
331 #ifdef USE_PROTOTYPES
332         FILE *,
333         bitmap_hdr *
334 #endif
335 );
336 
337 extern int
338 write_pbm_file(
339 #ifdef USE_PROTOTYPES
340         char *,
341         bitmap_hdr *
342 #endif
343 );
344 
345 extern int
346 write_pbm(
347 #ifdef USE_PROTOTYPES
348         FILE *,
349         bitmap_hdr *
350 #endif
351 );
352 
353 extern int
354 skip_pbm(
355 #ifdef USE_PROTOTYPES
356         FILE *
357 #endif
358 );
359 
360 
361 /* pcx.c */
362 
363 extern int
364 read_pcx_file(
365 #ifdef USE_PROTOTYPES
366         char *,
367         bitmap_hdr *
368 #endif
369 );
370 
371 extern int
372 read_pcx(
373 #ifdef USE_PROTOTYPES
374         FILE *,
375         bitmap_hdr *
376 #endif
377 );
378 
379 extern int
380 decodePCX(
381 #ifdef USE_PROTOTYPES
382         FILE *,
383         byte *,
384         int
385 #endif
386 );
387 
388 extern int
389 write_pcx_file(
390 #ifdef USE_PROTOTYPES
391         char *,
392         bitmap_hdr *
393 #endif
394 );
395 
396 extern int
397 write_pcx(
398 #ifdef USE_PROTOTYPES
399         FILE *,
400         bitmap_hdr *
401 #endif
402 );
403 
404 extern int
405 write_pcx_header(
406 #ifdef USE_PROTOTYPES
407         FILE *,
408         int,
409         int
410 #endif
411 );
412 
413 extern int
414 write_pcx_cmap(
415 #ifdef USE_PROTOTYPES
416         FILE *,
417         int ,
418         byte *
419 #endif
420 );
421 
422 extern int
423 encodePCX(
424 #ifdef USE_PROTOTYPES
425         FILE *,
426         byte *,
427         int
428 #endif
429 );
430 
431 
432 /* pix.c */
433 
434 extern int
435 read_alias_file(
436 #ifdef USE_PROTOTYPES
437         char *,
438         bitmap_hdr *
439 #endif
440 );
441 
442 extern int
443 read_alias(
444 #ifdef USE_PROTOTYPES
445         FILE *,
446         bitmap_hdr *
447 #endif
448 );
449 
450 extern int
451 read_alias_header(
452 #ifdef USE_PROTOTYPES
453         FILE *,
454         alias_hdr *
455 #endif
456 );
457 
458 extern int
459 read_line_alias24(
460 #ifdef USE_PROTOTYPES
461         FILE *,
462         byte *,
463         byte *,
464         byte *,
465         register int
466 #endif
467 );
468 
469 extern int
470 read_line_alias(
471 #ifdef USE_PROTOTYPES
472         FILE *,
473         byte *,
474         register int
475 #endif
476 );
477 
478 extern int
479 create_alias_cmap(
480 #ifdef USE_PROTOTYPES
481         bitmap_hdr *
482 #endif
483 );
484 
485 extern int
486 uncode_alias24(
487 #ifdef USE_PROTOTYPES
488         byte *,
489         byte *,
490         byte *,
491         byte *,
492         byte *
493 #endif
494 );
495 
496 extern int
497 uncode_alias(
498 #ifdef USE_PROTOTYPES
499         byte *,
500         byte *,
501         byte *
502 #endif
503 );
504 
505 extern int
506 write_alias_file(
507 #ifdef USE_PROTOTYPES
508         char *,
509         bitmap_hdr *
510 #endif
511 );
512 
513 extern int
514 write_alias(
515 #ifdef USE_PROTOTYPES
516         FILE *,
517         bitmap_hdr *
518 #endif
519 );
520 
521 extern int
522 code_alias24(
523 #ifdef USE_PROTOTYPES
524         byte *,
525         byte *,
526         byte *,
527         int ,
528         FILE *
529 #endif
530 );
531 
532 
533 /* ps.c */
534 
535 extern int
536 write_ps_file(
537 #ifdef USE_PROTOTYPES
538         char *,
539         bitmap_hdr *
540 #endif
541 );
542 
543 extern int
544 write_ps_file_dimensions(
545 #ifdef USE_PROTOTYPES
546         char *,
547         bitmap_hdr *,
548         double,
549         double
550 #endif
551 );
552 
553 extern int
554 ImagenGrisesPs(
555 #ifdef USE_PROTOTYPES
556         int ,
557         int ,
558         byte *,
559         double ,
560         double ,
561         char *
562 #endif
563 );
564 
565 
566 /* raw.c */
567 
568 extern int
569 read24bitmap(
570 #ifdef USE_PROTOTYPES
571         int ,
572         int ,
573         FILE *,
574         FILE *,
575         FILE *,
576         bitmap_hdr *
577 #endif
578 );
579 
580 extern int
581 read_raw_file(
582 #ifdef USE_PROTOTYPES
583         char *,
584         bitmap_hdr *
585 #endif
586 );
587 
588 extern int
589 read_8bitmap_file(
590 #ifdef USE_PROTOTYPES
591         char *,
592         bitmap_hdr *,
593         int ,
594         int
595 #endif
596 );
597 
598 extern int
599 read8bitmap(
600 #ifdef USE_PROTOTYPES
601         FILE *,
602         bitmap_hdr *,
603         int,
604         int
605 #endif
606 );
607 
608 extern int
609 write24bitmap(
610 #ifdef USE_PROTOTYPES
611         FILE *,
612         FILE *,
613         FILE *,
614         bitmap_hdr *
615 #endif
616 );
617 
618 extern int
619 write_raw_file(
620 #ifdef USE_PROTOTYPES
621         char *,
622         bitmap_hdr *
623 #endif
624 );
625 
626 extern int
627 write_8bitmap_file(
628 #ifdef USE_PROTOTYPES
629         char *,
630         bitmap_hdr *
631 #endif
632 );
633 
634 extern int
635 write8bitmap(
636 #ifdef USE_PROTOTYPES
637         FILE *,
638         bitmap_hdr *
639 #endif
640 );
641 
642 
643 /* rgb.c */
644 
645 extern int
646 read_rgb_i_file(
647 #ifdef USE_PROTOTYPES
648         char *,
649         bitmap_hdr *
650 #endif
651 );
652 
653 extern int
654 read_rgb_file(
655 #ifdef USE_PROTOTYPES
656         char *,
657         bitmap_hdr *,
658         int ,
659         int
660 #endif
661 );
662 
663 extern int
664 read_rgb(
665 #ifdef USE_PROTOTYPES
666         FILE *,
667         bitmap_hdr *,
668         int,
669         int
670 #endif
671 );
672 
673 extern int
674 write_rgb_file(
675 #ifdef USE_PROTOTYPES
676         char *,
677         bitmap_hdr *
678 #endif
679 );
680 
681 extern int
682 write_rgb(
683 #ifdef USE_PROTOTYPES
684         FILE *,
685         bitmap_hdr *
686 #endif
687 );
688 
689 
690 /* rla.c */
691 
692 extern int
693 read_rla_file(
694 #ifdef USE_PROTOTYPES
695         char *,
696         bitmap_hdr *
697 #endif
698 );
699 
700 extern int
701 read_rla(
702 #ifdef USE_PROTOTYPES
703         FILE *,
704         bitmap_hdr *
705 #endif
706 );
707 
708 extern int
709 decodeRLA(
710 #ifdef USE_PROTOTYPES
711         byte *,
712         byte *,
713         int
714 #endif
715 );
716 
717 extern int
718 write_rla_file(
719 #ifdef USE_PROTOTYPES
720         char *,
721         bitmap_hdr *
722 #endif
723 );
724 
725 extern int
726 write_rla(
727 #ifdef USE_PROTOTYPES
728         FILE *,
729         bitmap_hdr *
730 #endif
731 );
732 
733 extern int
734 encodeRLA(
735 #ifdef USE_PROTOTYPES
736         byte *,
737         byte *,
738         int
739 #endif
740 );
741 
742 
743 /* rle.c */
744 
745 extern int
746 read_rle_file(
747 #ifdef USE_PROTOTYPES
748         char *,
749         bitmap_hdr *
750 #endif
751 );
752 
753 extern int
754 read_rle(
755 #ifdef USE_PROTOTYPES
756         FILE *,
757         bitmap_hdr *
758 #endif
759 );
760 
761 extern int
762 write_rle_file(
763 #ifdef USE_PROTOTYPES
764         char *,
765         bitmap_hdr *
766 #endif
767 );
768 
769 extern int
770 write_rle(
771 #ifdef USE_PROTOTYPES
772         FILE *,
773         bitmap_hdr *
774 #endif
775 );
776 
777 
778 /* sgi.c */
779 
780 extern int
781 read_sgi_file(
782 #ifdef USE_PROTOTYPES
783         char *,
784         bitmap_hdr *
785 #endif
786 );
787 
788 extern int
789 write_sgi_file(
790 #ifdef USE_PROTOTYPES
791         char *,
792         bitmap_hdr *
793 #endif
794 );
795 
796 
797 /* tga.c */
798 
799 extern int
800 read_tga_file(
801 #ifdef USE_PROTOTYPES
802         char *,
803         bitmap_hdr *
804 #endif
805 );
806 
807 extern int
808 read_tga(
809 #ifdef USE_PROTOTYPES
810         FILE *,
811         bitmap_hdr *
812 #endif
813 );
814 
815 extern int
816 read_tga24(
817 #ifdef USE_PROTOTYPES
818         FILE *,
819         byte *,
820         byte *,
821         byte *,
822         tga_hdr *
823 #endif
824 );
825 
826 extern int
827 read_tga_to24(
828 #ifdef USE_PROTOTYPES
829         FILE *,
830         byte *,
831         byte *,
832         byte *,
833         tga_hdr *,
834         byte *
835 #endif
836 );
837 
838 extern int
839 read_tga8(
840 #ifdef USE_PROTOTYPES
841         FILE *,
842         byte *,
843         tga_hdr *
844 #endif
845 );
846 
847 extern int
848 read_tga_header(
849 #ifdef USE_PROTOTYPES
850         FILE *,
851         tga_hdr *
852 #endif
853 );
854 
855 extern int
856 read_tga_data(
857 #ifdef USE_PROTOTYPES
858         byte *,
859         int ,
860         FILE *
861 #endif
862 );
863 
864 extern int
865 write_tga_file(
866 #ifdef USE_PROTOTYPES
867         char *,
868         bitmap_hdr *
869 #endif
870 );
871 
872 extern int
873 write_rle_tga_file(
874 #ifdef USE_PROTOTYPES
875         char *,
876         bitmap_hdr *
877 #endif
878 );
879 
880 extern int
881 write_tga(
882 #ifdef USE_PROTOTYPES
883         FILE *,
884         bitmap_hdr *,
885         int
886 #endif
887 );
888 
889 extern int
890 write_tga_header(
891 #ifdef USE_PROTOTYPES
892         FILE *,
893         bitmap_hdr *,
894         int
895 #endif
896 );
897 
898 extern int
899 write_tga_line24(
900 #ifdef USE_PROTOTYPES
901         FILE *,
902         byte *,
903         byte *,
904         byte *,
905         int
906 #endif
907 );
908 
909 extern int
910 write_tga_rle_line24(
911 #ifdef USE_PROTOTYPES
912         FILE *,
913         byte *,
914         byte *,
915         byte *,
916         int
917 #endif
918 );
919 
920 
921 /* tiff.c */
922 
923 extern int
924 read_tiff_file(
925 #ifdef USE_PROTOTYPES
926         char *,
927         bitmap_hdr *
928 #endif
929 );
930 
931 extern int
932 write_tiff_file(
933 #ifdef USE_PROTOTYPES
934         char *,
935         bitmap_hdr *
936 #endif
937 );
938 
939 
940 
941 /************************************************
942  *
943  * Internal library functions.
944  *
945  */
946 
947 /* bitmap.c */
948 
949 extern int
950 allocatebitmap(
951 #ifdef USE_PROTOTYPES
952         bitmap_hdr *,
953         int,
954         int,
955         int,
956         int
957 #endif
958 );
959 
960 extern int
961 freebitmap(
962 #ifdef USE_PROTOTYPES
963         bitmap_hdr *
964 #endif
965 );
966 
967 extern int
968 copy_bitmap(
969 #ifdef USE_PROTOTYPES
970         bitmap_hdr *,
971         bitmap_hdr *
972 #endif
973 );
974 
975 
976 /* error.c */
977 
978 extern char *
979 lugerrmsg(
980 #ifdef USE_PROTOTYPES
981         int
982 #endif
983 );
984 
985 extern int
986 Error(
987 #ifdef USE_PROTOTYPES
988         int
989 #endif
990 );
991 
992 /* general.c */
993 
994 extern int
995 no_bits(
996 #ifdef USE_PROTOTYPES
997         int
998 #endif
999 );
1000 
1001 extern char *
1002 basename(
1003 #ifdef USE_PROTOTYPES
1004         char *,
1005         char *
1006 #endif
1007 );
1008 
1009 extern short *
1010 bytetoshort(
1011 #ifdef USE_PROTOTYPES
1012         byte *,
1013         short *,
1014         int
1015 #endif
1016 );
1017 
1018 extern byte *
1019 shorttobyte(
1020 #ifdef USE_PROTOTYPES
1021         short *,
1022         byte *,
1023         int
1024 #endif
1025 );
1026 
1027 extern byte *
1028 floattobyte(
1029 #ifdef USE_PROTOTYPES
1030         float *,
1031         byte *,
1032         int
1033 #endif
1034 );
1035 
1036 extern float *
1037 bytetofloat(
1038 #ifdef USE_PROTOTYPES
1039         byte *,
1040         float *,
1041         int
1042 #endif
1043 );
1044 
1045 extern int
1046 Atoi(
1047 #ifdef USE_PROTOTYPES
1048         char *
1049 #endif
1050 );
1051 
1052 extern double
1053 Atod(
1054 #ifdef USE_PROTOTYPES
1055         char *
1056 #endif
1057 );
1058 
1059 extern int
1060 Uncompress(
1061 #ifdef USE_PROTOTYPES
1062         char *,
1063         char *
1064 #endif
1065 );
1066 
1067 extern int
1068 Compress(
1069 #ifdef USE_PROTOTYPES
1070         char *
1071 #endif
1072 );
1073 
1074 extern int
1075 compute_levels(
1076 #ifdef USE_PROTOTYPES
1077         int
1078 #endif
1079 );
1080 
1081 
1082 /* in_out.c */
1083 
1084 extern FILE *
1085 Fopen(
1086 #ifdef USE_PROTOTYPES
1087         char *,
1088         char *
1089 #endif
1090 );
1091 
1092 extern int
1093 exist_file(
1094 #ifdef USE_PROTOTYPES
1095         char *
1096 #endif
1097 );
1098 
1099 extern int
1100 Fclose(
1101 #ifdef USE_PROTOTYPES
1102         FILE *
1103 #endif
1104 );
1105 
1106 extern char *
1107 read_file(
1108 #ifdef USE_PROTOTYPES
1109         FILE *,
1110         int *
1111 #endif
1112 );
1113 
1114 long
1115 filelen(
1116 #ifdef USE_PROTOTYPES
1117         FILE *
1118 #endif
1119 );
1120 
1121 extern int
1122 getshortMSBF(
1123 #ifdef USE_PROTOTYPES
1124         FILE *
1125 #endif
1126 );
1127 
1128 extern int
1129 getshortLSBF(
1130 #ifdef USE_PROTOTYPES
1131         FILE *
1132 #endif
1133 );
1134 
1135 extern int
1136 putshortMSBF(
1137 #ifdef USE_PROTOTYPES
1138         int,
1139         FILE *
1140 #endif
1141 );
1142 
1143 extern int
1144 putshortLSBF(
1145 #ifdef USE_PROTOTYPES
1146         int,
1147         FILE *
1148 #endif
1149 );
1150 
1151 
1152 /* memory.c */
1153 
1154 extern char *
1155 Malloc(
1156 #ifdef USE_PROTOTYPES
1157         int
1158 #endif
1159 );
1160 
1161 extern int
1162 Free(
1163 #ifdef USE_PROTOTYPES
1164         void *
1165 #endif
1166 );
1167 
1168 
1169 
1170 /************************************************
1171  *
1172  * Functions to show images.
1173  *
1174  */
1175 
1176 /* viewers */
1177 
1178 extern int
1179 show_bitmap(
1180 #ifdef USE_PROTOTYPES
1181         char *,
1182         bitmap_hdr *,
1183         int
1184 #endif
1185 );
1186 
1187 extern int
1188 write_vfr(
1189 #ifdef USE_PROTOTYPES
1190         bitmap_hdr *,
1191         int,
1192         char *
1193 #endif
1194 );
1195 
1196 extern int
1197 show_bitmap_x11(
1198 #ifdef USE_PROTOTYPES
1199         char *,
1200         bitmap_hdr *
1201 #endif
1202 );
1203 
1204 
1205 
1206 /************************************************
1207  *
1208  * Digital images editing functions.
1209  *
1210  */
1211 
1212 /* blur.c */
1213 
1214 extern int
1215 blur_bitmap(
1216 #ifdef USE_PROTOTYPES
1217         bitmap_hdr *,
1218         bitmap_hdr *
1219 #endif
1220 );
1221 
1222 byte *
1223 blur(
1224 #ifdef USE_PROTOTYPES
1225         byte *,
1226         int,
1227         int
1228 #endif
1229 );
1230 
1231 /* convolve.c */
1232 
1233 extern int
1234 convolve_bitmap(
1235 #ifdef USE_PROTOTYPES
1236         bitmap_hdr *,
1237 	bitmap_hdr *,
1238 	double *
1239 #endif
1240 );
1241 
1242 byte *
1243 convolve(
1244 #ifdef USE_PROTOTYPES
1245         byte *,
1246         int,
1247 	int,
1248 	double *
1249 #endif
1250 );
1251 
1252 /* cut.c */
1253 
1254 extern int
1255 cut_bitmap(
1256 #ifdef USE_PROTOTYPES
1257         bitmap_hdr *,
1258         bitmap_hdr *,
1259         int,
1260         int,
1261         int,
1262         int
1263 #endif
1264 );
1265 
1266 /* change.c */
1267 
1268 extern int
1269 changecolor(
1270 #ifdef USE_PROTOTYPES
1271         bitmap_hdr *,
1272         bitmap_hdr *,
1273         int,
1274         int,
1275         int,
1276         int,
1277         int,
1278         int,
1279         int
1280 #endif
1281 );
1282 
1283 
1284 /* chroma.c */
1285 
1286 extern int
1287 chroma_bitmaps(
1288 #ifdef USE_PROTOTYPES
1289         bitmap_hdr *,
1290         bitmap_hdr *,
1291         bitmap_hdr *
1292 #endif
1293 );
1294 
1295 extern int
1296 chroma(
1297 #ifdef USE_PROTOTYPES
1298         bitmap_hdr *,
1299         bitmap_hdr *
1300 #endif
1301 );
1302 
1303 
1304 /* dither.c */
1305 
1306 extern int
1307 dither_image(
1308 #ifdef USE_PROTOTYPES
1309         bitmap_hdr *,
1310         bitmap_hdr *,
1311         int,
1312         double
1313 #endif
1314 );
1315 
1316 void
1317 create_dithermap(
1318 #ifdef USE_PROTOTYPES
1319         int,
1320         double,
1321         byte [][3],
1322         int [256],
1323         int [256],
1324         int [16][16]
1325 #endif
1326 );
1327 
1328 void
1329 create_square(
1330 #ifdef USE_PROTOTYPES
1331         double,
1332         int [256],
1333         int [256],
1334         int [16][16]
1335 #endif
1336 );
1337 
1338 /* flip.c */
1339 
1340 extern int
1341 flip_image(
1342 #ifdef USE_PROTOTYPES
1343         bitmap_hdr *,
1344         bitmap_hdr *
1345 #endif
1346 );
1347 
1348 byte *
1349 flip(
1350 #ifdef USE_PROTOTYPES
1351         byte *,
1352         int,
1353         int
1354 #endif
1355 );
1356 
1357 
1358 /* gamma.c */
1359 
1360 extern int
1361 gamma_correction(
1362 #ifdef USE_PROTOTYPES
1363         bitmap_hdr *,
1364         bitmap_hdr *,
1365         double
1366 #endif
1367 );
1368 
1369 
1370 /* histoequalization.c */
1371 
1372 
1373 extern int
1374 histogram_equalization(
1375 #ifdef USE_PROTOTYPES
1376         bitmap_hdr *,
1377         bitmap_hdr *
1378 #endif
1379 );
1380 
1381 
1382 /* hsl.c */
1383 
1384 extern int
1385 hsl_to_rgb_buffer(
1386 #ifdef USE_PROTOTYPES
1387         double *,
1388         double *,
1389         double *,
1390         byte *,
1391         byte *,
1392         byte *,
1393         int
1394 #endif
1395 );
1396 
1397 extern int
1398 rgb_to_hsl_buffer(
1399 #ifdef USE_PROTOTYPES
1400         byte *,
1401         byte *,
1402         byte *,
1403         double *,
1404         double *,
1405         double *,
1406         int
1407 #endif
1408 );
1409 
1410 extern int
1411 RGB_to_HSL(
1412 #ifdef USE_PROTOTYPES
1413         byte,
1414         byte,
1415         byte,
1416         double *,
1417         double *,
1418         double *
1419 #endif
1420 );
1421 
1422 extern int
1423 HSL_to_RGB(
1424 #ifdef USE_PROTOTYPES
1425         double,
1426         double,
1427         double,
1428         byte *,
1429         byte *,
1430         byte *
1431 #endif
1432 );
1433 
1434 
1435 /* mask.c */
1436 
1437 extern int
1438 chroma_mask(
1439 #ifdef USE_PROTOTYPES
1440         bitmap_hdr *,
1441         bitmap_hdr *,
1442         bitmap_hdr *,
1443         bitmap_hdr *
1444 #endif
1445 );
1446 
1447 extern int
1448 chroma_shadow_mask(
1449 #ifdef USE_PROTOTYPES
1450         bitmap_hdr *,
1451         bitmap_hdr *,
1452         bitmap_hdr *,
1453         bitmap_hdr *
1454 #endif
1455 );
1456 
1457 extern int
1458 mask_change_color(
1459 #ifdef USE_PROTOTYPES
1460         bitmap_hdr *,
1461         bitmap_hdr *,
1462         bitmap_hdr *,
1463         int,
1464         int,
1465         int
1466 #endif
1467 );
1468 
1469 extern int
1470 mask_change_to_bw(
1471 #ifdef USE_PROTOTYPES
1472         bitmap_hdr *,
1473         bitmap_hdr *,
1474         bitmap_hdr *
1475 #endif
1476 );
1477 
1478 extern int
1479 mask_darken_color(
1480 #ifdef USE_PROTOTYPES
1481         bitmap_hdr *,
1482         bitmap_hdr *,
1483         bitmap_hdr *
1484 #endif
1485 );
1486 
1487 extern int
1488 fade_mask(
1489 #ifdef USE_PROTOTYPES
1490         bitmap_hdr *,
1491         bitmap_hdr *,
1492         bitmap_hdr *,
1493         bitmap_hdr *
1494 #endif
1495 );
1496 
1497 
1498 /* fade.c*/
1499 
1500 extern int
1501 medianfilter(
1502 #ifdef USE_PROTOTYPES
1503         bitmap_hdr *,
1504         bitmap_hdr *
1505 #endif
1506 );
1507 
1508 byte *
1509 filternoise(
1510 #ifdef USE_PROTOTYPES
1511         byte *,
1512         int,
1513         int
1514 #endif
1515 );
1516 
1517 extern int
1518 med3x3(
1519 #ifdef USE_PROTOTYPES
1520         byte *,
1521         byte *,
1522         byte *
1523 #endif
1524 );
1525 
1526 
1527 /* mirror.c */
1528 
1529 extern int
1530 mirror_image(
1531 #ifdef USE_PROTOTYPES
1532         bitmap_hdr *,
1533         bitmap_hdr *
1534 #endif
1535 );
1536 
1537 byte *
1538 mirror(
1539 #ifdef USE_PROTOTYPES
1540         byte *,
1541         int,
1542         int
1543 #endif
1544 );
1545 
1546 
1547 /* paste.c */
1548 
1549 extern int
1550 paste(
1551 #ifdef USE_PROTOTYPES
1552         bitmap_hdr *,
1553         bitmap_hdr *,
1554         int,
1555         int
1556 #endif
1557 );
1558 
1559 extern int
1560 center_image(
1561 #ifdef USE_PROTOTYPES
1562         bitmap_hdr *,
1563         bitmap_hdr *
1564 #endif
1565 );
1566 
1567 
1568 /* quantize.c */
1569 
1570 extern int
1571 quantize(
1572 #ifdef USE_PROTOTYPES
1573         bitmap_hdr *,
1574         bitmap_hdr *,
1575         int
1576 #endif
1577 );
1578 
1579 
1580 /* rotate.c */
1581 
1582 extern int
1583 rotate_bitmap(
1584 #ifdef USE_PROTOTYPES
1585         bitmap_hdr *,
1586         bitmap_hdr *,
1587         double
1588 #endif
1589 );
1590 
1591 extern int
1592 rotate90_image(
1593 #ifdef USE_PROTOTYPES
1594         bitmap_hdr *,
1595         bitmap_hdr *
1596 #endif
1597 );
1598 
1599 byte *
1600 rotate90(
1601 #ifdef USE_PROTOTYPES
1602         byte *,
1603         int,
1604         int
1605 #endif
1606 );
1607 
1608 
1609 /* sharpen.c */
1610 
1611 extern int
1612 sharpen_bitmap(
1613 #ifdef USE_PROTOTYPES
1614         bitmap_hdr *,
1615         bitmap_hdr *
1616 #endif
1617 );
1618 
1619 
1620 /* slowzoom.c */
1621 
1622 extern int
1623 slow_adjust_bitmap(
1624 #ifdef USE_PROTOTYPES
1625         bitmap_hdr *,
1626         bitmap_hdr *,
1627         int,
1628         int
1629 #endif
1630 );
1631 
1632 
1633 /* solid.c */
1634 
1635 extern int
1636 create_solid_image(
1637 #ifdef USE_PROTOTYPES
1638         bitmap_hdr *,
1639         int,
1640         int,
1641         byte,
1642         byte,
1643         byte
1644 #endif
1645 );
1646 
1647 
1648 /* to24 */
1649 
1650 extern int
1651 to24(
1652 #ifdef USE_PROTOTYPES
1653         bitmap_hdr *,
1654         bitmap_hdr *
1655 #endif
1656 );
1657 
1658 
1659 /* tobw.c */
1660 
1661 extern int
1662 tobw(
1663 #ifdef USE_PROTOTYPES
1664         bitmap_hdr *,
1665         bitmap_hdr *
1666 #endif
1667 );
1668 
1669 extern int
1670 to_raw_bw(
1671 #ifdef USE_PROTOTYPES
1672         bitmap_hdr *,
1673         bitmap_hdr *
1674 #endif
1675 );
1676 
1677 byte *
1678 create_bw_pallete();
1679 
1680 byte *
1681 cmap_to_bw(
1682 #ifdef USE_PROTOTYPES
1683         bitmap_hdr *image
1684 #endif
1685 );
1686 
1687 extern int
1688 isagrayscaled(
1689 #ifdef USE_PROTOTYPES
1690         bitmap_hdr *
1691 #endif
1692 );
1693 
1694 extern int
1695 rgbtobw(
1696 #ifdef USE_PROTOTYPES
1697         byte *,
1698         byte *,
1699         byte *,
1700         byte *,
1701         int
1702 #endif
1703 );
1704 
1705 
1706 /* tohalftone.c */
1707 
1708 extern int
1709 tohalftone(
1710 #ifdef USE_PROTOTYPES
1711         bitmap_hdr *,
1712         bitmap_hdr *
1713 #endif
1714 );
1715 
1716 extern int
1717 bw_to_halftone(
1718 #ifdef USE_PROTOTYPES
1719         int,
1720         int,
1721         byte
1722 #endif
1723 );
1724 
1725 byte *
1726 create_halftone_pallete();
1727 
1728 /* toinverse.c */
1729 
1730 extern int
1731 toinverse(
1732 #ifdef USE_PROTOTYPES
1733         bitmap_hdr *,
1734         bitmap_hdr *
1735 #endif
1736 );
1737 
1738 byte *
1739 cmap_to_inverse(
1740 #ifdef USE_PROTOTYPES
1741         bitmap_hdr *
1742 #endif
1743 );
1744 
1745 extern int
1746 inverse(
1747 #ifdef USE_PROTOTYPES
1748         byte *,
1749         int
1750 #endif
1751 );
1752 
1753 
1754 /* zoom.c */
1755 
1756 extern int
1757 adjust_bitmap(
1758 #ifdef USE_PROTOTYPES
1759         bitmap_hdr *,
1760         bitmap_hdr *,
1761         int,
1762         int,
1763         int
1764 #endif
1765 );
1766 
1767 byte *
1768 zoom(
1769 #ifdef USE_PROTOTYPES
1770         int,
1771         int,
1772         int,
1773         int,
1774         register byte *,
1775         int
1776 #endif
1777 );
1778 
1779 
1780 
1781 #endif  /* MY_DEFINE_PROTOTYPES */
1782