/** * Copies data from input image to argument buffer. * * @param channelIndex index of the channel of the input image from which data is to be copied * @param rowIndex index of the row of the input image from which data is to be copied * @param dest the array to which data is to be copied * @param destOffset index of the first element in the dest array to which data will be copied */ private void fillBuffer(int channelIndex, int rowIndex, int[] dest, int destOffset) { IntegerImage in = (IntegerImage) getInputImage(); final int LAST = destOffset + imageWidth; int x = 0; while (destOffset != LAST) { dest[destOffset++] = in.getSample(channelIndex, x++, rowIndex); } }
public void process() throws MissingParameterException, WrongParameterException { ensureInputImageIsAvailable(); PixelImage image = getInputImage(); if (image instanceof IntegerImage) { IntegerImage ii = (IntegerImage) image; int max = ii.getMaxSample(0); int index = 1; while (index < ii.getNumChannels()) { int maxSample = ii.getMaxSample(index++); if (maxSample > max) { max = maxSample; } } hist = new int[max + 1]; zeroes = new int[hist.length]; for (int i = 0; i < zeroes.length; i++) { zeroes[i] = 0; } } super.process(); }