Fills one band in the image with the specified value

@param input An image.
@param band Which band is to be filled with the specified value
@param value The value that the image is being filled with.
966074
public static void fillBand(InterleavedF64 input, int band , double value) {

		final int numBands = input.numBands;
		for (int y = 0; y < input.height; y++) {
			int index = input.getStartIndex() + y * input.getStride() + band;
			int end = index + input.width*numBands - band;
			for (; index < end; index += numBands ) {
				input.data[index] = value;
			}
		}
	}
281254
public static <T extends ImageBase<T>> void sharpen4(T input , T output ) {
		if( input instanceof Planar ) {
			Planar pi = (Planar)input;
			Planar po = (Planar)output;
			for (int i = 0; i < pi.getNumBands(); i++) {
				sharpen4(pi.getBand(i),po.getBand(i));
			}
		} else {
			if (input instanceof GrayU8) {
				EnhanceImageOps.sharpen4((GrayU8) input, (GrayU8) output);
			} else if (input instanceof GrayF32) {
				EnhanceImageOps.sharpen4((GrayF32) input, (GrayF32) output);
			} else {
				throw new IllegalArgumentException("Image type not supported. " + input.getClass().getSimpleName());
			}
		}
	}
576425
public void process(Planar<T> input, Planar<T> output) {

		int N = input.getNumBands();
		for( int i = 0; i < N; i++ ) {
			this.output[i] = FactoryGImageGray.wrap(output.getBand(i),this.output[i]);
			interp[i].setImage(input.getBand(i));
		}

		int indexMap = 0;
		for( int i = 0; i < output.height; i++ ) {
			int indexOut = output.startIndex + i*output.stride;
			for( int j = 0; j < output.width; j++ , indexOut++,indexMap++ ) {
				Point2D_F32 p = mapPixels[indexMap];
				if( p != null ) {
					for( int k = 0; k < N; k++ ) {
						this.output[k].set(indexOut, interp[k].get( p.x, p.y));
					}
				}
			}
		}
	}
1352480
@Deprecated
	public void addInput(Operator<IN>... input) {
		this.input = Operator.createUnionCascade(this.input, input);
	}
162596
public void set(int i, byte value) {
        if (i < 0 || i >= size) {
            throw new IndexOutOfBoundsException();
        }
        elements[i] = value;
    }
647250
@Override
	public void reshape(int width, int height) {
		if( this.width == width && this.height == height )
			return;

		if( isSubimage() )
			throw new IllegalArgumentException("Can't reshape subimage");

		for( int i = 0; i < bands.length; i++ ) {
			bands[i].reshape(width,height);
		}

		this.startIndex = 0;
		this.stride = width;
		this.width = width;
		this.height = height;
	}
1344196
public void fill(byte value)
    {
        int offset = 0;
        int length = size;
        long longValue = Longs.fromBytes(value, value, value, value, value, value, value, value);
        while (length >= SizeOf.SIZE_OF_LONG) {
            unsafe.putLong(base, address + offset, longValue);
            offset += SizeOf.SIZE_OF_LONG;
            length -= SizeOf.SIZE_OF_LONG;
        }

        while (length > 0) {
            unsafe.putByte(base, address + offset, value);
            offset++;
            length--;
        }
    }
485975
public static void fillBorder(GrayF64 input, double value, int radius ) {

		// top and bottom
		for (int y = 0; y < radius; y++) {
			int indexTop = input.startIndex + y * input.stride;
			int indexBottom = input.startIndex + (input.height-y-1) * input.stride;
			for (int x = 0; x < input.width; x++) {
				input.data[indexTop++] = value;
				input.data[indexBottom++] = value;
			}
		}

		// left and right
		int h = input.height-radius;
		int indexStart = input.startIndex + radius*input.stride;
		for (int x = 0; x < radius; x++) {
			int indexLeft = indexStart + x;
			int indexRight = indexStart + input.width-1-x;
			for (int y = radius; y < h; y++) {
				input.data[indexLeft] = value;
				input.data[indexRight] = value;
				
				indexLeft += input.stride;
				indexRight += input.stride;
			}
		}
	}
1199059
public static void independent( BufferedImage input ) {
		// convert the BufferedImage into a Planar
		Planar<GrayU8> image = ConvertBufferedImage.convertFromPlanar(input,null,true,GrayU8.class);

		// declare the output blurred image
		Planar<GrayU8> blurred = image.createSameShape();
		
		// Apply Gaussian blur to each band in the image
		for( int i = 0; i < image.getNumBands(); i++ ) {
			// note that the generalized version of BlurImageOps is not being used, but the type
			// specific version.
			BlurImageOps.gaussian(image.getBand(i),blurred.getBand(i),-1,5,null);
		}
		
		// Declare the BufferedImage manually to ensure that the color bands have the same ordering on input
		// and output
		BufferedImage output = new BufferedImage(image.width,image.height,input.getType());
		ConvertBufferedImage.convertTo(blurred, output,true);

		gui.addImage(input,"Input");
		gui.addImage(output,"Gaussian Blur");
	}
1167168
public void setFillColor(org.kie.dmn.model.api.dmndi.Color value) {
        this.fillColor = value;
    }
276643
@Override
	public void accept(final double value) {
		super.accept(value);
		_min = Math.min(_min, value);
		_max = Math.max(_max, value);
		_sum.add(value);
	}
1007913
public static <T extends ImageBase<T>> void plus(T input, double value, T output) {
		if( input instanceof ImageGray) {
			if (GrayU8.class == input.getClass()) {
				PixelMath.plus((GrayU8) input, (int) value, (GrayU8) output);
			} else if (GrayS8.class == input.getClass()) {
				PixelMath.plus((GrayS8) input, (int) value, (GrayS8) output);
			} else if (GrayU16.class == input.getClass()) {
				PixelMath.plus((GrayU16) input, (int) value, (GrayU16) output);
			} else if (GrayS16.class == input.getClass()) {
				PixelMath.plus((GrayS16) input, (int) value, (GrayS16) output);
			} else if (GrayS32.class == input.getClass()) {
				PixelMath.plus((GrayS32) input, (int) value, (GrayS32) output);
			} else if (GrayS64.class == input.getClass()) {
				PixelMath.plus((GrayS64) input, (long) value, (GrayS64) output);
			} else if (GrayF32.class == input.getClass()) {
				PixelMath.plus((GrayF32) input, (float) value, (GrayF32) output);
			} else if (GrayF64.class == input.getClass()) {
				PixelMath.plus((GrayF64) input, value, (GrayF64) output);
			} else {
				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
			}
		} else if( input instanceof ImageInterleaved ) {
			if (InterleavedU8.class == input.getClass()) {
				PixelMath.plus((InterleavedU8) input, (int) value, (InterleavedU8) output);
			} else if (InterleavedS8.class == input.getClass()) {
				PixelMath.plus((InterleavedS8) input, (int) value, (InterleavedS8) output);
			} else if (InterleavedU16.class == input.getClass()) {
				PixelMath.plus((InterleavedU16) input, (int) value, (InterleavedU16) output);
			} else if (InterleavedS16.class == input.getClass()) {
				PixelMath.plus((InterleavedS16) input, (int) value, (InterleavedS16) output);
			} else if (InterleavedS32.class == input.getClass()) {
				PixelMath.plus((InterleavedS32) input, (int) value, (InterleavedS32) output);
			} else if (InterleavedS64.class == input.getClass()) {
				PixelMath.plus((InterleavedS64) input, (long) value, (InterleavedS64) output);
			} else if (InterleavedF32.class == input.getClass()) {
				PixelMath.plus((InterleavedF32) input, (float) value, (InterleavedF32) output);
			} else if (InterleavedF64.class == input.getClass()) {
				PixelMath.plus((InterleavedF64) input, value, (InterleavedF64) output);
			} else {
				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
			}
		} else {
			Planar in = (Planar)input;
			Planar out = (Planar)output;

			for (int i = 0; i < in.getNumBands(); i++) {
				plus(in.getBand(i),value,out.getBand(i));
			}
		}
	}
1307283
@Override
    public ImageSource apply(ImageSource input) {
        final int[][] pixelMatrix = new int[3][3];

        int w = input.getWidth();
        int h = input.getHeight();

        int[][] output = new int[h][w];

        for (int j = 1; j < h - 1; j++) {
            for (int i = 1; i < w - 1; i++) {
                pixelMatrix[0][0] = input.getR(i - 1, j - 1);
                pixelMatrix[0][1] = input.getRGB(i - 1, j);
                pixelMatrix[0][2] = input.getRGB(i - 1, j + 1);
                pixelMatrix[1][0] = input.getRGB(i, j - 1);
                pixelMatrix[1][2] = input.getRGB(i, j + 1);
                pixelMatrix[2][0] = input.getRGB(i + 1, j - 1);
                pixelMatrix[2][1] = input.getRGB(i + 1, j);
                pixelMatrix[2][2] = input.getRGB(i + 1, j + 1);

                int edge = (int) convolution(pixelMatrix);
                int rgb = (edge << 16 | edge << 8 | edge);
                output[j][i] = rgb;
            }
        }

        MatrixSource source = new MatrixSource(output);
        return source;
    }
1281333
public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
		if( input instanceof ImageGray ) {
			if (GrayU8.class == input.getClass()) {
				PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
			} else if (GrayS8.class == input.getClass()) {
				PixelMath.boundImage((GrayS8) input, (int) min, (int) max);
			} else if (GrayU16.class == input.getClass()) {
				PixelMath.boundImage((GrayU16) input, (int) min, (int) max);
			} else if (GrayS16.class == input.getClass()) {
				PixelMath.boundImage((GrayS16) input, (int) min, (int) max);
			} else if (GrayS32.class == input.getClass()) {
				PixelMath.boundImage((GrayS32) input, (int) min, (int) max);
			} else if (GrayS64.class == input.getClass()) {
				PixelMath.boundImage((GrayS64) input, (long) min, (long) max);
			} else if (GrayF32.class == input.getClass()) {
				PixelMath.boundImage((GrayF32) input, (float) min, (float) max);
			} else if (GrayF64.class == input.getClass()) {
				PixelMath.boundImage((GrayF64) input, min, max);
			} else {
				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
			}
		} else if( input instanceof Planar ) {
			Planar in = (Planar)input;

			for (int i = 0; i < in.getNumBands(); i++) {
				boundImage( in.getBand(i), min, max);
			}
		}
	}
1146034
public void setInput(final byte[] input)
	{

		if (input[0] == -128) {
			r = new BitReader(inflateInput(input, 1));
		}
		else {
			r = new BitReader(input);
		}
	}
242042
@Override
	public void setNumberOfBands( int numberOfBands ) {
		if( numberOfBands == this.bands.length )
			return;

		T[] bands = (T[]) Array.newInstance(type, numberOfBands);
		int N = Math.min(numberOfBands, this.bands.length );
		for (int i = 0; i < N; i++) {
			bands[i] = this.bands[i];
		}
		for (int i = N; i < bands.length; i++) {
			bands[i] = GeneralizedImageOps.createSingleBand(type, width, height);
		}
		this.bands = bands;
	}
697717
public static void moveBandsElemnts(int yOffset, JRDesignBand band) {
		if (band == null)
			return;

		for (JRChild jrChild : band.getChildren()) {
			JRDesignElement elem = (JRDesignElement) jrChild;
			elem.setY(elem.getY() + yOffset);
		}
	}