code: public static void down(ImageGray input , int sampleWidth , ImageGray output ) {
  		if( input instanceof GrayU8) {
  			down((GrayU8) input, sampleWidth, (GrayI8) output);
  		} else if( input instanceof GrayS8) {
  			down((GrayS8) input, sampleWidth, (GrayI8) output);
  		} else if( input instanceof GrayU16) {
  			down((GrayU16) input, sampleWidth, (GrayI16) output);
  		} else if( input instanceof GrayS16) {
  			down((GrayS16) input, sampleWidth, (GrayI16) output);
  		} else if( input instanceof GrayS32) {
  			down((GrayS32) input, sampleWidth, (GrayS32) output);
  		} else if( input instanceof GrayF32) {
  			down((GrayF32) input, sampleWidth, (GrayF32) output);
  		} else if( input instanceof GrayF64) {
  			down((GrayF64) input, sampleWidth, (GrayF64) output);
  		} else {
  			throw new IllegalArgumentException("Unknown image type");
  		}
  	}
docs: Down samples image.  Type checking is done at runtime.
  
  @param input Input image. Not modified.
  @param sampleWidth Width of square region.
  @param output Output image. Modified.