26 #include "viaio/Vlib.h"
27 #include "viaio/file.h"
33 #include <sys/types.h>
36 #include <X11/Xfuncproto.h>
48 typedef struct V_ImageRec {
57 VPointer **band_index;
66 VImageSingleAlloc = 0x01
75 #define VImageNBands(image) ((image)->nbands)
76 #define VImageNRows(image) ((image)->nrows)
77 #define VImageNColumns(image) ((image)->ncolumns)
78 #define VImageNFrames(image) ((image)->nframes)
79 #define VImageNViewpoints(image) ((image)->nviewpoints)
80 #define VImageNColors(image) ((image)->ncolors)
81 #define VImageNComponents(image) ((image)->ncomponents)
84 #define VPixelRepn(image) ((image)->pixel_repn)
87 #define VImageData(image) ((image)->data)
90 #define VImageAttrList(image) ((image)->attributes)
93 #define VImageNPixels(image) \
94 ((image)->nbands * (image)->nrows * (image)->ncolumns)
97 #define VPixelSize(image) (VRepnSize ((image)->pixel_repn))
100 #define VPixelPrecision(image) (VRepnPrecision ((image)->pixel_repn))
103 #define VPixelRepnName(image) (VRepnName ((image)->pixel_repn))
106 #define VPixelMinValue(image) (VRepnMinValue ((image)->pixel_repn))
107 #define VPixelMaxValue(image) (VRepnMaxValue ((image)->pixel_repn))
110 #define VImageSize(image) (VImageNPixels(image) * VPixelSize(image))
113 #define VPixelPtr(image, band, row, column) \
114 ((VPointer) ((char *) ((image)->band_index[band][row]) + \
115 (column) * VPixelSize (image)))
118 #define VPixel(image, band, row, column, type) \
119 (* ((type *) (image)->band_index[band][row] + (column)))
122 #define VPixelArray(image, type) \
123 ((type ***) (image)->band_index)
126 #define VBandIndex(image, frame, viewpoint, color, component) \
127 (((((frame) * (image)->nviewpoints + (viewpoint)) * (image)->ncolors + \
128 (color)) * (image)->ncomponents) + (component))
131 #define VSameImageRange(image1, image2) \
132 ((image1)->nbands == (image2)->nbands && \
133 (image1)->nrows == (image2)->nrows && \
134 (image1)->ncolumns == (image2)->ncolumns && \
135 (image1)->pixel_repn == (image2)->pixel_repn)
138 #define VSameImageSize(image1, image2) \
139 ((image1)->nbands == (image2)->nbands && \
140 (image1)->nrows == (image2)->nrows && \
141 (image1)->ncolumns == (image2)->ncolumns)
148 #define VColorInterpAttr "color_interp"
149 #define VComponentInterpAttr "component_interp"
150 #define VFrameInterpAttr "frame_interp"
151 #define VNBandsAttr "nbands"
152 #define VNColorsAttr "ncolors"
153 #define VNComponentsAttr "ncomponents"
154 #define VNFramesAttr "nframes"
155 #define VNViewpointsAttr "nviewpoints"
156 #define VPixelAspectRatioAttr "pixel_aspect_ratio"
157 #define VViewpointInterpAttr "viewpoint_interp"
169 VBandInterpStereoPair,
177 VBandInterpIntensity,
178 VBandInterpOrientation
181 extern VDictEntry VBandInterpDict[];
199 } VConvolvePadMethod;
239 extern VImage VAdjustImage (
240 #
if NeedFunctionPrototypes
251 extern VImage VCanny (
252 #
if NeedFunctionPrototypes
264 extern VImage VBuildComplexImage (
265 #
if NeedFunctionPrototypes
275 extern VImage VImageMagnitude (
276 #
if NeedFunctionPrototypes
283 extern VImage VImagePhase (
284 #
if NeedFunctionPrototypes
293 extern VImage VConvertImageCopy (
294 #
if NeedFunctionPrototypes
304 extern VImage VConvertImageLinear (
305 #
if NeedFunctionPrototypes
317 extern VImage VConvertImageOpt (
318 #
if NeedFunctionPrototypes
329 extern VImage VConvertImageRange (
330 #
if NeedFunctionPrototypes
340 extern VImage VConvolveImage (
341 #
if NeedFunctionPrototypes
353 extern VImage VConvolveImageSep (
354 #
if NeedFunctionPrototypes
359 VConvolvePadMethod [3] ,
366 extern VImage VCropImage (
367 #
if NeedFunctionPrototypes
380 extern VBoolean VDither (
381 #
if NeedFunctionPrototypes
396 extern VImage VImageFFT (
397 #
if NeedFunctionPrototypes
407 extern VBoolean VFillImage (
408 #
if NeedFunctionPrototypes
417 extern VImage VFlipImage (
418 #
if NeedFunctionPrototypes
428 extern pid_t VForkImageDisplay (
429 #
if NeedFunctionPrototypes
438 extern VImage VGaussianConvolveImage (
439 #
if NeedFunctionPrototypes
451 extern VImage VImageGradient (
452 #
if NeedFunctionPrototypes
461 extern VImage VImageGradientSeq (
462 #
if NeedFunctionPrototypes
473 extern VImage VCreateImage (
474 #
if NeedFunctionPrototypes
482 extern VImage VCreateImageLike (
483 #
if NeedFunctionPrototypes
488 extern void VDestroyImage (
489 #
if NeedFunctionPrototypes
494 extern VDouble VGetPixel (
495 #
if NeedFunctionPrototypes
503 extern void VSetPixel (
504 #
if NeedFunctionPrototypes
513 extern VImage VCopyImage (
514 #
if NeedFunctionPrototypes
521 extern VImage VCopyImageAttrs (
522 #
if NeedFunctionPrototypes
528 extern VImage VCopyImagePixels (
529 #
if NeedFunctionPrototypes
536 extern VBoolean VCopyBand (
537 #
if NeedFunctionPrototypes
545 extern VImage VCombineBands (
546 #
if NeedFunctionPrototypes
554 extern VImage VCombineBandsVa (
555 #
if NeedVarargsPrototypes
561 extern VImage VSelectDestImage (
562 #
if NeedFunctionPrototypes
572 extern VBoolean VSelectBand (
573 #
if NeedFunctionPrototypes
582 extern VBandInterp VImageFrameInterp (
583 #
if NeedFunctionPrototypes
588 extern VBandInterp VImageViewpointInterp (
589 #
if NeedFunctionPrototypes
594 extern VBandInterp VImageColorInterp (
595 #
if NeedFunctionPrototypes
600 extern VBandInterp VImageComponentInterp (
601 #
if NeedFunctionPrototypes
606 extern VBoolean VSetBandInterp (
607 #
if NeedFunctionPrototypes
620 extern int VReadImages (
621 #
if NeedFunctionPrototypes
628 extern VBoolean VWriteImages (
629 #
if NeedFunctionPrototypes
639 extern void VImageWindowSize (
640 #
if NeedFunctionPrototypes
651 extern VBoolean VImageBandToPS (
652 #
if NeedFunctionPrototypes
659 extern VBoolean VRGBImageToPS (
660 #
if NeedFunctionPrototypes
667 extern VBoolean VGradientImageToPS (
668 #
if NeedFunctionPrototypes
678 extern VImage VInvertImage (
679 #
if NeedFunctionPrototypes
686 extern VImage VNegateImage (
687 #
if NeedFunctionPrototypes
696 extern VBoolean VGaussianKernel (
697 #
if NeedFunctionPrototypes
704 extern VBoolean VGaussianD1Kernel (
705 #
if NeedFunctionPrototypes
712 extern VBoolean VGaussianSplineKernel (
713 #
if NeedFunctionPrototypes
722 extern VImage VImageOpI (
723 #
if NeedFunctionPrototypes
735 extern VImage VImageOpU (
736 #
if NeedFunctionPrototypes
746 extern VImage VImageOpV (
747 #
if NeedFunctionPrototypes
761 #
if NeedFunctionPrototypes
775 #
if NeedFunctionPrototypes
783 #
if NeedFunctionPrototypes
790 extern VImage VRGBImageToGray (
791 #
if NeedFunctionPrototypes
800 extern VImage VRotateImage (
801 #
if NeedFunctionPrototypes
811 extern VImage VSampleImage (
812 #
if NeedFunctionPrototypes
824 #
if NeedFunctionPrototypes
833 VImage VReduceImage (
834 #
if NeedFunctionPrototypes
843 VImage VExpandImage (
844 #
if NeedFunctionPrototypes
855 extern VImage VShearImageX (
856 #
if NeedFunctionPrototypes
864 extern VImage VShearImageY (
865 #
if NeedFunctionPrototypes
875 extern VBoolean VImageStats (
876 #
if NeedFunctionPrototypes
889 VBoolean VRampImage (
890 #
if NeedFunctionPrototypes
900 VBoolean VSineGratingImage (
901 #
if NeedFunctionPrototypes
913 VBoolean VZonePlateImage (
914 #
if NeedFunctionPrototypes
925 VBoolean VBinomialNoiseImage (
926 #
if NeedFunctionPrototypes
935 VBoolean VNormalNoiseImage (
936 #
if NeedFunctionPrototypes
944 VBoolean VUniformNoiseImage (
945 #
if NeedFunctionPrototypes
955 extern VImage VTransposeImage (
956 #
if NeedFunctionPrototypes
965 extern VImage VReadUbcIff (
966 #
if NeedFunctionPrototypes
971 extern VBoolean VWriteUbcIff (
972 #
if NeedFunctionPrototypes
981 extern VImage VZeroCrossings (
982 #
if NeedFunctionPrototypes