87
89
/* Input display type.
89
91
im_type_desc im__input_display = {
90
IM_TYPE_DISPLAY, /* Its a display */
91
0, /* No storage needed */
92
IM_TYPE_ARG, /* It requires a command-line arg */
93
input_display_init, /* Init function */
94
NULL /* Destroy function */
92
IM_TYPE_DISPLAY, /* It's a display */
93
0, /* No storage needed */
94
IM_TYPE_ARG, /* It requires a command-line arg */
95
input_display_init, /* Init function */
96
NULL /* Destroy function */
97
99
/* Output display type.
99
101
im_type_desc im__output_display = {
100
IM_TYPE_DISPLAY, /* Its a display */
102
IM_TYPE_DISPLAY, /* It's a display */
101
103
sizeof( struct im_col_display ),/* Memory to allocate */
102
IM_TYPE_OUTPUT, /* Output object */
103
NULL, /* Init function */
104
NULL /* Destroy function */
104
IM_TYPE_OUTPUT, /* Output object */
105
NULL, /* Init function */
106
NULL /* Destroy function */
107
109
/* Init function for input images.
112
114
IMAGE **im = (IMAGE **) obj;
114
return( !(*im = im_open( str, "r" )) );
116
return( !(*im = im_open( str, "rd" )) );
117
119
/* Input image type.
119
121
im_type_desc im__input_image = {
120
IM_TYPE_IMAGE, /* Its an image */
121
0, /* No storage needed */
122
IM_TYPE_ARG, /* It requires a command-line arg */
122
IM_TYPE_IMAGE, /* It's an image */
123
0, /* No storage needed */
124
IM_TYPE_ARG, /* It requires a command-line arg */
123
125
(im_init_obj_fn) input_image_init,/* Init function */
124
(im_dest_obj_fn) im_close/* Destroy function */
126
(im_dest_obj_fn) im_close /* Destroy function */
127
129
/* Init function for output images.
137
139
/* Output image type.
139
141
im_type_desc im__output_image = {
140
IM_TYPE_IMAGE, /* Its an image */
141
0, /* No storage to be allocated */
142
IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags! */
143
(im_init_obj_fn) output_image_init, /* Init function */
144
(im_dest_obj_fn) im_close /* Destroy function */
142
IM_TYPE_IMAGE, /* It's an image */
143
0, /* No storage to be allocated */
144
IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags! */
145
(im_init_obj_fn) output_image_init,/* Init function */
146
(im_dest_obj_fn) im_close /* Destroy function */
147
149
/* Init function for RW images.
157
159
/* RW image type.
159
161
im_type_desc im__rw_image = {
160
IM_TYPE_IMAGE, /* Its an image */
161
0, /* No storage to be allocated */
162
IM_TYPE_ARG, /* Flags! Pretend its an input type */
162
IM_TYPE_IMAGE, /* It's an image */
163
0, /* No storage to be allocated */
164
IM_TYPE_ARG | IM_TYPE_RW, /* Read-write object, needs an arg */
163
165
(im_init_obj_fn) rw_image_init, /* Init function */
164
166
(im_dest_obj_fn) im_close /* Destroy function */
226
228
/* Input image vector type.
228
230
im_type_desc im__input_imagevec = {
229
IM_TYPE_IMAGEVEC, /* Its an array of IMAGE */
230
sizeof( im_imagevec_object ), /* Memory to allocate in vec build */
231
IM_TYPE_ARG, /* It requires a command-line arg */
232
input_imagevec_init, /* Init function */
233
imagevec_dest /* Destroy function */
231
IM_TYPE_IMAGEVEC, /* It's an array of IMAGE */
232
sizeof( im_imagevec_object ), /* Memory to allocate in vec build */
233
IM_TYPE_ARG, /* It requires a command-line arg */
234
input_imagevec_init, /* Init function */
235
imagevec_dest /* Destroy function */
236
238
/* Init function for masks. "str" can be NULL for output masks.
344
346
/* Output dmask type.
346
348
im_type_desc im__output_dmask = {
347
IM_TYPE_DMASK, /* Its a mask */
348
sizeof( im_mask_object ),/* Storage for mask object */
349
IM_TYPE_DMASK, /* It's a mask */
350
sizeof( im_mask_object ), /* Storage for mask object */
349
351
IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */
350
mask_init, /* Init function */
351
save_dmask_dest /* Save and destroy function */
352
mask_init, /* Init function */
353
save_dmask_dest /* Save and destroy function */
354
356
/* Input dmask type.
356
358
im_type_desc im__input_dmask = {
357
IM_TYPE_DMASK, /* Its a mask */
358
sizeof( im_mask_object ),/* Storage for mask object */
359
IM_TYPE_ARG, /* It requires a command-line arg */
360
dmask_init, /* Init function */
361
dmask_dest /* Destroy function */
359
IM_TYPE_DMASK, /* It's a mask */
360
sizeof( im_mask_object ), /* Storage for mask object */
361
IM_TYPE_ARG, /* It requires a command-line arg */
362
dmask_init, /* Init function */
363
dmask_dest /* Destroy function */
364
366
/* Output imask type.
366
368
im_type_desc im__output_imask = {
367
IM_TYPE_IMASK, /* Its a mask */
368
sizeof( im_mask_object ),/* Storage for mask object */
369
IM_TYPE_IMASK, /* It's a mask */
370
sizeof( im_mask_object ), /* Storage for mask object */
369
371
IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */
370
mask_init, /* Init function */
371
save_imask_dest /* Save and destroy function */
372
mask_init, /* Init function */
373
save_imask_dest /* Save and destroy function */
374
376
/* Input imask type.
376
378
im_type_desc im__input_imask = {
377
IM_TYPE_IMASK, /* Its a mask */
378
sizeof( im_mask_object ),/* Storage for mask object */
379
IM_TYPE_ARG, /* It requires a command-line arg */
380
imask_init, /* Init function */
381
imask_dest /* Destroy function */
379
IM_TYPE_IMASK, /* It's a mask */
380
sizeof( im_mask_object ), /* Storage for mask object */
381
IM_TYPE_ARG, /* It requires a command-line arg */
382
imask_init, /* Init function */
383
imask_dest /* Destroy function */
384
386
/* Output dmask to screen type. Set a `print' function to get actual output.
385
387
* Used for things like "stats".
387
389
im_type_desc im__output_dmask_screen = {
388
IM_TYPE_DMASK, /* Its a mask */
389
sizeof( im_mask_object ),/* Storage for mask object */
390
IM_TYPE_OUTPUT, /* Its an output argument */
391
mask_init, /* Init function */
392
dmask_dest /* Destroy function */
390
IM_TYPE_DMASK, /* It's a mask */
391
sizeof( im_mask_object ), /* Storage for mask object */
392
IM_TYPE_OUTPUT, /* It's an output argument */
393
mask_init, /* Init function */
394
dmask_dest /* Destroy function */
395
397
/* Init function for double input.
407
409
/* Input double type.
409
411
im_type_desc im__input_double = {
410
IM_TYPE_DOUBLE, /* Its a double */
411
sizeof( double ), /* Memory to allocate */
412
IM_TYPE_ARG, /* It requires a command-line arg */
413
input_double_init, /* Init function */
414
NULL /* Destroy function */
412
IM_TYPE_DOUBLE, /* It's a double */
413
sizeof( double ), /* Memory to allocate */
414
IM_TYPE_ARG, /* It requires a command-line arg */
415
input_double_init, /* Init function */
416
NULL /* Destroy function */
417
419
/* im_doublevec_object destroy function.
467
469
/* Input double vector type.
469
471
im_type_desc im__input_doublevec = {
470
IM_TYPE_DOUBLEVEC, /* Its an array of double */
471
sizeof( im_doublevec_object ), /* Memory to allocate in vec build */
472
IM_TYPE_ARG, /* It requires a command-line arg */
473
input_doublevec_init, /* Init function */
474
doublevec_dest /* Destroy function */
472
IM_TYPE_DOUBLEVEC, /* It's an array of double */
473
sizeof( im_doublevec_object ), /* Memory to allocate in vec build */
474
IM_TYPE_ARG, /* It requires a command-line arg */
475
input_doublevec_init, /* Init function */
476
doublevec_dest /* Destroy function */
477
479
/* Print function for doublevec output.
492
494
/* Output double vector type.
494
496
im_type_desc im__output_doublevec = {
495
IM_TYPE_DOUBLEVEC, /* Its an array of double */
496
sizeof( im_doublevec_object ), /* Memory to allocate in vec build */
497
IM_TYPE_OUTPUT, /* Output type */
498
NULL, /* Init function */
499
doublevec_dest /* Destroy function */
497
IM_TYPE_DOUBLEVEC, /* It's an array of double */
498
sizeof( im_doublevec_object ), /* Memory to allocate in vec build */
499
IM_TYPE_OUTPUT, /* Output type */
500
NULL, /* Init function */
501
doublevec_dest /* Destroy function */
502
504
/* im_intvec_object destroy function.
558
560
/* Input int vector type.
560
562
im_type_desc im__input_intvec = {
561
IM_TYPE_INTVEC, /* It's an array of int */
562
sizeof( im_intvec_object ), /* Memory to allocate in vec build */
563
IM_TYPE_ARG, /* It requires a command-line arg */
564
input_intvec_init, /* Init function */
565
intvec_dest /* Destroy function */
563
IM_TYPE_INTVEC, /* It's an array of int */
564
sizeof( im_intvec_object ), /* Memory to allocate in vec build */
565
IM_TYPE_ARG, /* It requires a command-line arg */
566
input_intvec_init, /* Init function */
567
intvec_dest /* Destroy function */
568
570
/* Print function for intvec output.
583
585
/* Output int vector type.
585
587
im_type_desc im__output_intvec = {
586
IM_TYPE_INTVEC, /* It's an array of int */
587
sizeof( im_intvec_object ), /* Memory to allocate in vec build */
588
IM_TYPE_OUTPUT, /* Output arg */
589
(im_init_obj_fn)NULL, /* Init function */
590
(im_dest_obj_fn)intvec_dest /* Destroy function */
588
IM_TYPE_INTVEC, /* It's an array of int */
589
sizeof( im_intvec_object ), /* Memory to allocate in vec build */
590
IM_TYPE_OUTPUT, /* Output arg */
591
(im_init_obj_fn)NULL, /* Init function */
592
(im_dest_obj_fn)intvec_dest /* Destroy function */
593
595
/* Init function for int input.
609
611
/* Input int type.
611
613
im_type_desc im__input_int = {
612
IM_TYPE_INT, /* Its an int */
613
sizeof( int ), /* Memory to allocate */
614
IM_TYPE_ARG, /* It requires a command-line arg */
615
input_int_init, /* Init function */
616
NULL /* Destroy function */
614
IM_TYPE_INT, /* It's an int */
615
sizeof( int ), /* Memory to allocate */
616
IM_TYPE_ARG, /* It requires a command-line arg */
617
input_int_init, /* Init function */
618
NULL /* Destroy function */
619
621
/* Init function for string input.
630
632
/* Input string type.
632
634
im_type_desc im__input_string = {
633
IM_TYPE_STRING, /* Its a string */
634
0, /* Memory to allocate */
635
IM_TYPE_ARG, /* It requires a command-line arg */
636
input_string_init, /* Init function */
637
im_free /* Destroy function */
635
IM_TYPE_STRING, /* It's a string */
636
0, /* Memory to allocate */
637
IM_TYPE_ARG, /* It requires a command-line arg */
638
input_string_init, /* Init function */
639
im_free /* Destroy function */
640
642
/* Output string type.
642
644
im_type_desc im__output_string = {
643
IM_TYPE_STRING, /* Its a string */
644
0, /* Memory to allocate */
645
IM_TYPE_OUTPUT, /* Its an output argument */
646
NULL, /* Init function */
647
im_free /* Destroy function */
645
IM_TYPE_STRING, /* It's a string */
646
0, /* Memory to allocate */
647
IM_TYPE_OUTPUT, /* It's an output argument */
648
NULL, /* Init function */
649
im_free /* Destroy function */
650
652
/* Output double type.
652
654
im_type_desc im__output_double = {
653
IM_TYPE_DOUBLE, /* Its a double */
654
sizeof( double ), /* Memory to allocate */
655
IM_TYPE_OUTPUT, /* Its an output argument */
656
NULL, /* Init function */
657
NULL /* Destroy function */
655
IM_TYPE_DOUBLE, /* It's a double */
656
sizeof( double ), /* Memory to allocate */
657
IM_TYPE_OUTPUT, /* It's an output argument */
658
NULL, /* Init function */
659
NULL /* Destroy function */
660
662
/* Output complex type.
662
664
im_type_desc im__output_complex = {
663
IM_TYPE_COMPLEX, /* Its a complex */
664
2 * sizeof( double ), /* Memory to allocate */
665
IM_TYPE_OUTPUT, /* Its an output argument */
666
NULL, /* Init function */
667
NULL /* Destroy function */
665
IM_TYPE_COMPLEX, /* It's a complex */
666
2 * sizeof( double ), /* Memory to allocate */
667
IM_TYPE_OUTPUT, /* It's an output argument */
668
NULL, /* Init function */
669
NULL /* Destroy function */
670
672
/* Output int type.
672
674
im_type_desc im__output_int = {
673
IM_TYPE_INT, /* Its an int */
674
sizeof( int ), /* Memory to allocate */
675
IM_TYPE_OUTPUT, /* Its an output argument */
676
NULL, /* Init function */
677
NULL /* Destroy function */
675
IM_TYPE_INT, /* It's an int */
676
sizeof( int ), /* Memory to allocate */
677
IM_TYPE_OUTPUT, /* It's an output argument */
678
NULL, /* Init function */
679
NULL /* Destroy function */
680
682
/* Print function for int output.
905
907
im_type_desc im__input_interpolate = {
906
908
IM_TYPE_INTERPOLATE,
907
0, /* No storage required */
908
IM_TYPE_ARG, /* It requires a command-line arg */
909
input_interpolate_init, /* Init function */
910
input_interpolate_dest /* Destroy function */
909
0, /* No storage required */
910
IM_TYPE_ARG, /* It requires a command-line arg */
911
input_interpolate_init, /* Init function */
912
input_interpolate_dest /* Destroy function */