/** * {@inheritDoc} */ @Override public String toString() { return "PDRange{" + getMin() + ", " + getMax() + '}'; }
long x = input.readBits(bitsPerCoordinate); long y = input.readBits(bitsPerCoordinate); float dstX = interpolate(x, maxSrcCoord, rangeX.getMin(), rangeX.getMax()); float dstY = interpolate(y, maxSrcCoord, rangeY.getMin(), rangeY.getMax()); LOG.debug("coord: " + String.format("[%06X,%06X] -> [%f,%f]", x, y, dstX, dstY)); Point2D p = matrix.transformPoint(dstX, dstY); colorComponentTab[n] = interpolate(color, maxSrcColor, colRangeTab[n].getMin(), colRangeTab[n].getMax()); LOG.debug("color[" + n + "]: " + color + "/" + String.format("%02x", color)
input[i] = clipToRange(input[i], domain.getMin(), domain.getMax()); input[i] = interpolate(input[i], domain.getMin(), domain.getMax(), encodeValues.getMin(), encodeValues.getMax()); input[i] = clipToRange(input[i], 0, sizeValues[i] - 1); inputPrev[i] = (int) Math.floor(input[i]); outputValues[i] = interpolate(outputValues[i], 0, maxSample, decodeValues.getMin(), decodeValues.getMax()); outputValues[i] = clipToRange(outputValues[i], range.getMin(), range.getMax());
float px = interpolate(x, maxSrcCoord, rangeX.getMin(), rangeX.getMax()); float py = interpolate(y, maxSrcCoord, rangeY.getMin(), rangeY.getMax()); Point2D p = matrix.transformPoint(px, py); xform.transform(p, p); color[i][j] = interpolate(c, maxSrcColor, colRange[j].getMin(), colRange[j].getMax());
PDRange domain = getDomainForInput(0); x = clipToRange(x, domain.getMin(), domain.getMax()); x = interpolate(x, domain.getMin(), domain.getMax(), encRange.getMin(), encRange.getMax()); partitionValues[0] = domain.getMin(); partitionValues[partitionValuesSize-1] = domain.getMax(); System.arraycopy(boundsValues, 0, partitionValues, 1, boundsSize); x = interpolate(x, partitionValues[i], partitionValues[i+1], encRange.getMin(), encRange.getMax()); break;
for (int c = 0; c < getNumberOfComponents(); c++) initial[c] = Math.max(0, getRangeForComponent(c).getMin());
private void setComponentRangeArray(PDRange range, int index) { COSArray rangeArray = (COSArray) dictionary.getDictionaryObject(COSName.RANGE); if (rangeArray == null) { rangeArray = getDefaultRangeArray(); } if (range == null) { // reset to defaults rangeArray.set(index, new COSFloat(-100)); rangeArray.set(index + 1, new COSFloat(100)); } else { rangeArray.set(index, new COSFloat(range.getMin())); rangeArray.set(index + 1, new COSFloat(range.getMax())); } dictionary.setItem(COSName.RANGE, rangeArray); initialColor = null; }
/** * {@inheritDoc} */ @Override public String toString() { return "PDRange{" + getMin() + ", " + getMax() + '}'; }
/** * Sets the range for this color space. * @param range the new range for the a component * @param n the component to set the range for */ public void setRangeForComponent(PDRange range, int n) { COSArray rangeArray = (COSArray) stream.getCOSObject().getDictionaryObject(COSName.RANGE); if (rangeArray == null) { rangeArray = new COSArray(); stream.getCOSObject().setItem(COSName.RANGE, rangeArray); } // extend range array with default values if needed while (rangeArray.size() < (n + 1) * 2) { rangeArray.add(new COSFloat(0)); rangeArray.add(new COSFloat(1)); } rangeArray.set(n*2, new COSFloat(range.getMin())); rangeArray.set(n*2+1, new COSFloat(range.getMax())); }
/** * {@inheritDoc} */ @Override public String toString() { return "PDRange{" + getMin() + ", " + getMax() + '}'; }