# Copyright restrictions apply - see stsdas$copyright.stsdas # include include # UNMIX -- Separate one group into several groups. The first point in the # input image is copied to the first ouput group, the second point to the # second output group, and so on, up to the stepping factor, after which # the process begins again with the first output group. # # B.Simon 18-May-88 Original procedure unmix (in_image, out_ptr, factor) char in_image[ARB] # i: Input image name pointer out_ptr # i: Pointer to output image template int factor # i: Stepping factor #-- char out_image[SZ_FNAME] bool junk int pix, step long aeon pointer imi, imo, inbuf, outbuf data aeon / 0 / bool tp_fetch() long clktime() pointer immap(), imgl1r(), impl1r() real ahivr(), alovr() begin # Open input image and copy into buffer imi = immap (in_image, READ_ONLY, NULL) inbuf = imgl1r (imi) do step = 1, factor { # Open output image as new copy of input image. junk = tp_fetch (out_ptr, out_image) imo = immap (out_image, NEW_COPY, imi) IM_LEN(imo,1) = IM_LEN(imi,1) / factor # Copy pixels from input to output image outbuf = impl1r (imo) do pix = 1, IM_LEN(imo, 1) Memr[outbuf+(pix-1)] = Memr[inbuf+(pix-1)*factor+(step-1)] # Set min and max pixels IM_MIN(imo) = alovr (Memr[outbuf], IM_LEN(imo,1)) IM_MAX(imo) = ahivr (Memr[outbuf], IM_LEN(imo,1)) IM_LIMTIME(imo) = clktime (aeon) call imunmap (imo) } call imunmap (imi) end