Performs a single level inverse wavelet transform along the horizontal axis.

@param inverseCoef Description of wavelet coefficients.
@param input Transformed image. Not modified.
@param output Reconstruction of original image. Modified
15609
public static void horizontalInverse(BorderIndex1D border , WlBorderCoef<WlCoef_I32> inverseCoef , GrayI input , GrayI output ) {

		UtilWavelet.checkShape(output,input);

		int []trends = new int[ output.width ];
		int []details = new int[ output.width ];

		boolean isLarger = input.width >= output.width;
		int paddedWidth = output.width + output.width%2;

		final int lowerBorder = inverseCoef.getLowerLength()*2;
		final int upperBorder = output.width - inverseCoef.getUpperLength()*2;

		border.setLength(output.width+output.width%2);

		WlCoef_I32 coefficients = inverseCoef.getInnerCoefficients();
		final int e = coefficients.denominatorScaling*2;
		final int f = coefficients.denominatorWavelet*2;
		final int ef = e*f;
		final int ef2 = ef/2;

		for( int y = 0; y < output.height; y++ ) {

			for( int i = 0; i < details.length; i++ ) {
				details[i] = 0;
				trends[i] = 0;
			}

			for( int x = 0; x < output.width; x += 2 ) {
				int a = input.get(x/2,y);
				int d = input.get(input.width/2+x/2,y);

				if( x < lowerBorder ) {
					coefficients = inverseCoef.getBorderCoefficients(x);
				} else if( x >= upperBorder ) {
					coefficients = inverseCoef.getBorderCoefficients(x-paddedWidth);
				} else {
					coefficients = inverseCoef.getInnerCoefficients();
				}

				final int offsetA = coefficients.offsetScaling;
				final int offsetB = coefficients.offsetWavelet;
				final int[] alpha = coefficients.scaling;
				final int[] beta = coefficients.wavelet;

				// add the trend
				for( int i = 0; i < alpha.length; i++ ) {
					// if an odd image don't update the outer edge
					int xx = border.getIndex(x+offsetA+i);
					if( isLarger && xx >= output.width )
						continue;
					trends[xx] += a*alpha[i];
				}

				// add the detail signal
				for( int i = 0; i < beta.length; i++ ) {
					int xx = border.getIndex(x+offsetB+i);
					if( isLarger && xx >= output.width )
						continue;
					details[xx] += d*beta[i];
				}
			}

			for( int x = 0; x < output.width; x++ ) {
				output.set(x,y, UtilWavelet.round(trends[x]*f + details[x]*e ,ef2,ef));
			}
		}
	}
1331765
public void inverse(float data[], int rowspan) {
    backtransform(data, rowspan); 
    float norm = normalization();
    for(int i=0; i<nrows; i++){
      for(int j=0; j<ncols; j++){
	data[i*rowspan + 2*j]   *= norm; 
	data[i*rowspan + 2*j+1] *= norm; }}}
1296443
public static <T extends ImageBase<T>> void abs( T input , T output )
	{
		if( input instanceof ImageGray) {
			if (GrayS8.class == input.getClass()) {
				PixelMath.abs((GrayS8) input, (GrayS8) output);
			} else if (GrayS16.class == input.getClass()) {
				PixelMath.abs((GrayS16) input, (GrayS16) output);
			} else if (GrayS32.class == input.getClass()) {
				PixelMath.abs((GrayS32) input, (GrayS32) output);
			} else if (GrayS64.class == input.getClass()) {
				PixelMath.abs((GrayS64) input, (GrayS64) output);
			} else if (GrayF32.class == input.getClass()) {
				PixelMath.abs((GrayF32) input, (GrayF32) output);
			} else if (GrayF64.class == input.getClass()) {
				PixelMath.abs((GrayF64) input, (GrayF64) output);
			}
			// otherwise assume it is an unsigned image type
		} else if( input instanceof ImageInterleaved ) {
			if (InterleavedS8.class == input.getClass()) {
				PixelMath.abs((InterleavedS8) input, (InterleavedS8) output);
			} else if (InterleavedS16.class == input.getClass()) {
				PixelMath.abs((InterleavedS16) input, (InterleavedS16) output);
			} else if (InterleavedS32.class == input.getClass()) {
				PixelMath.abs((InterleavedS32) input, (InterleavedS32) output);
			} else if (InterleavedS64.class == input.getClass()) {
				PixelMath.abs((InterleavedS64) input, (InterleavedS64) output);
			} else if (InterleavedF32.class == input.getClass()) {
				PixelMath.abs((InterleavedF32) input, (InterleavedF32) output);
			} else if (InterleavedF64.class == input.getClass()) {
				PixelMath.abs((InterleavedF64) input, (InterleavedF64) output);
			}
		} else {
			Planar in = (Planar)input;
			Planar out = (Planar)output;

			for (int i = 0; i < in.getNumBands(); i++) {
				abs(in.getBand(i),out.getBand(i));
			}
		}
	}
1059336
public static <T extends ImageBase<T>> void log(T input , T output ) {
		if( input instanceof ImageGray ) {
			if (GrayF32.class == input.getClass()) {
				PixelMath.log((GrayF32) input, (GrayF32) output);
			} else if (GrayF64.class == input.getClass()) {
				PixelMath.log((GrayF64) input, (GrayF64) output);
			} else {
				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
			}
		} else if( input instanceof Planar ) {
			Planar in = (Planar)input;
			Planar out = (Planar)output;

			for (int i = 0; i < in.getNumBands(); i++) {
				log( in.getBand(i), out.getBand(i));
			}
		}
	}
282863
public static void rotateCCW( GrayS64 input , GrayS64 output ) {
		if( input.width != output.height || input.height != output.width )
			throw new IllegalArgumentException("Incompatible shapes");

		int w = input.width-1;

		for( int y = 0; y < input.height; y++ ) {
			int indexIn = input.startIndex + y*input.stride;
			for (int x = 0; x < input.width; x++) {
				output.unsafe_set(y,w-x,input.data[indexIn++]);
			}
		}
	}
2247
@Override
    public void encode(OutputStream output, Indenter indenter) {
        encode(output, indenter, null);
    }
429744
public static void convert(Complex_F64 input , ComplexPolar_F64 output ) {
        output.r = input.getMagnitude();
        output.theta = Math.atan2(input.imaginary, input.real);
    }
1209936
public static <T extends ImageBase<T>>
	void down( T input , T output ) {
		if( ImageGray.class.isAssignableFrom(input.getClass())  ) {
			if(BoofConcurrency.USE_CONCURRENT ) {
				if (input instanceof GrayU8) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample_MT.horizontal((GrayU8) input, middle);
					ImplAverageDownSample_MT.vertical(middle, (GrayI8) output);
				} else if (input instanceof GrayU16) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample_MT.horizontal((GrayU16) input, middle);
					ImplAverageDownSample_MT.vertical(middle, (GrayU16) output);
				} else if (input instanceof GrayF32) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample_MT.horizontal((GrayF32) input, middle);
					ImplAverageDownSample_MT.vertical(middle, (GrayF32) output);
				} else if (input instanceof GrayF64) {
					GrayF64 middle = new GrayF64(output.width, input.height);
					ImplAverageDownSample_MT.horizontal((GrayF64) input, middle);
					ImplAverageDownSample_MT.vertical(middle, (GrayF64) output);
				} else {
					throw new IllegalArgumentException("Unknown image type");
				}
			} else {
				if (input instanceof GrayU8) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample.horizontal((GrayU8) input, middle);
					ImplAverageDownSample.vertical(middle, (GrayI8) output);
				} else if (input instanceof GrayU16) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample.horizontal((GrayU16) input, middle);
					ImplAverageDownSample.vertical(middle, (GrayU16) output);
				} else if (input instanceof GrayF32) {
					GrayF32 middle = new GrayF32(output.width, input.height);
					ImplAverageDownSample.horizontal((GrayF32) input, middle);
					ImplAverageDownSample.vertical(middle, (GrayF32) output);
				} else if (input instanceof GrayF64) {
					GrayF64 middle = new GrayF64(output.width, input.height);
					ImplAverageDownSample.horizontal((GrayF64) input, middle);
					ImplAverageDownSample.vertical(middle, (GrayF64) output);
				} else {
					throw new IllegalArgumentException("Unknown image type");
				}
			}
		} else if( Planar.class.isAssignableFrom(input.getClass())  ) {
			Planar in = (Planar)input;
			Planar out = (Planar)output;

			int N = in.getNumBands();

			for (int i = 0; i < N; i++) {
				down(in.getBand(i),out.getBand(i));
			}
		}
	}
219124
public static void inverseDelta(int[] data) {
                for (int i = 1; i < data.length; ++i) {
                        data[i] += data[i - 1];
                }
        }
311211
public static InterleavedS16 convert( Planar<GrayS16> input , InterleavedS16 output ) {
		if (output == null) {
			output = new InterleavedS16(input.width, input.height,input.getNumBands());
		} else {
			output.reshape(input.width,input.height,input.getNumBands());
		}

		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplConvertImage_MT.convert(input,output);
		} else {
			ImplConvertImage.convert(input,output);
		}

		return output;
	}
949875
function compressOutput(output, bw) {
  bw.writeVarint(output.value);
  compressScript(output.script, bw);
  return bw;
}
344817
public void massage( T input , T output ) {
		if( clip ) {
			T inputAdjusted = clipInput(input, output);

			// configure a simple change in scale for both axises
			transform.a11 = input.width / (float) output.width;
			transform.a22 = input.height / (float) output.height;
			// this change is automatically reflected in the distortion class.  It is configured to cache nothing

			distort.apply(inputAdjusted, output);
		} else {
			// scale each axis independently.  It will have the whole image but it will be distorted
			transform.a11 = input.width / (float) output.width;
			transform.a22 = input.height / (float) output.height;

			distort.apply(input, output);
		}

	}
166805
public final void inverse() {
		double norm;  

		norm = 1f/(this.w*this.w + this.x*this.x + this.y*this.y + this.z*this.z);
		this.w *=  norm;
		this.x *= -norm;
		this.y *= -norm;
		this.z *= -norm;
	}
590626
public static void inverse(int[] a)
  {
    for (int i = 0; i < a.length; i++) {
      if (a[i] >= 0) {
        inverseLoop(a, i);
      }
    }

    for (int i = 0; i < a.length; i++) {
      a[i] = ~a[i];
    }
  }
782618
public function encoding($input = null, $output = null) {
        $this->convert_encoding = true;
        if (!is_null($input)) {
            $this->input_encoding = $input;
        }

        if (!is_null($output)) {
            $this->output_encoding = $output;
        }
    }
367806
public FDistort init(ImageBase input, ImageBase output) {
		this.input = input;
		this.output = output;

		inputType = input.getImageType();
		interp(InterpolationType.BILINEAR);
		border(0);

		cached = false;
		distorter = null;
		outputToInput = null;

		return this;
	}
447675
@Override
	public void process(GrayF32 input , GrayU8 output ) {
		inputPow2.reshape(input.width,input.height);
		inputMean.reshape(input.width,input.height);
		inputMeanPow2.reshape(input.width,input.height);
		inputPow2Mean.reshape(input.width,input.height);
		stdev.reshape(input.width,input.height);
		tmp.reshape(input.width,input.height);
		inputPow2.reshape(input.width,input.height);

		int radius = width.computeI(Math.min(input.width,input.height))/2;

		// mean of input image = E[X]
		BlurImageOps.mean(input, inputMean, radius, tmp, work);

		// standard deviation = sqrt( E[X^2] + E[X]^2)
		PixelMath.pow2(input, inputPow2);
		BlurImageOps.mean(inputPow2,inputPow2Mean,radius,tmp, work);
		PixelMath.pow2(inputMean,inputMeanPow2);
		PixelMath.subtract(inputPow2Mean, inputMeanPow2, stdev);
		PixelMath.sqrt(stdev, stdev);

		float R = ImageStatistics.max(stdev);

		if( down ) {
			BoofConcurrency.loopFor(0, input.height, y -> {
				int i = y * stdev.width;
				int indexIn = input.startIndex + y * input.stride;
				int indexOut = output.startIndex + y * output.stride;

				for (int x = 0; x < input.width; x++, i++) {
					// threshold = mean.*(1 + k * ((deviation/R)-1));
					float threshold = inputMean.data[i] * (1.0f + k * (stdev.data[i] / R - 1.0f));
					output.data[indexOut++] = (byte) (input.data[indexIn++] <= threshold ? 1 : 0);
				}
			});
		} else {
			BoofConcurrency.loopFor(0, input.height, y -> {
				int i = y * stdev.width;
				int indexIn = input.startIndex + y * input.stride;
				int indexOut = output.startIndex + y * output.stride;

				for (int x = 0; x < input.width; x++, i++) {
					// threshold = mean.*(1 + k * ((deviation/R)-1));
					float threshold = inputMean.data[i] * (1.0f + k * (stdev.data[i] / R - 1.0f));
					output.data[indexOut++] = (byte) (input.data[indexIn++] >= threshold ? 1 : 0);
				}
			});
		}
	}