Examples of PDRange


Examples of org.apache.pdfbox.pdmodel.common.PDRange

     * @return The b range.
     */
    public PDRange getBRange()
    {
        COSArray range = getRangeArray();
        return new PDRange( range, 1 );
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     *
     * @return The encode parameter range or null if none is set.
     */
    public PDRange getEncodeForParameter( int paramNum )
    {
        PDRange retval = null;
        COSArray encodeValues = getEncodeValues();
        if( encodeValues != null && encodeValues.size() >= paramNum*2+1 )
        {
            retval = new PDRange(encodeValues, paramNum );
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     *
     * @return The decode parameter range or null if none is set.
     */
    public PDRange getDecodeForParameter( int paramNum )
    {
        PDRange retval = null;
        COSArray decodeValues = getDecodeValues();
        if( decodeValues != null && decodeValues.size() >= paramNum*2+1 )
        {
            retval = new PDRange(decodeValues, paramNum );
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

        int numberOfInputValues = input.length;
        int numberOfOutputValues = getNumberOfOutputParameters();
        int intInputValuesPrevious = 0;
        int intInputValuesNext = 0;
        for (int i=0; i<numberOfInputValues; i++) {
            PDRange domain = getDomainForInput(i);
            PDRange encode = getEncodeForParameter(i);
            input[i] = clipToRange(input[i], domain.getMin(), domain.getMax());
            input[i] = interpolate(input[i], domain.getMin(), domain.getMax(), encode.getMin(), encode.getMax());
            input[i] = clipToRange(input[i], 0, sizeValues[i]-1);
            intInputValuesPrevious += (int)Math.floor(input[i]);
            intInputValuesNext += (int)Math.ceil(input[i]);
        }
        float[] outputValuesPrevious = null;
        float[] outputValuesNext = null;
        outputValuesPrevious = getSample(intInputValuesPrevious);
        outputValuesNext = getSample(intInputValuesNext);
        float[] outputValues = new float[numberOfOutputValues];
        for (int i=0;i<numberOfOutputValues;i++)
        {
            PDRange range = getRangeForOutput(i);
            PDRange decode = getDecodeForParameter(i);
            // TODO using only a linear interpolation.
            // See "Order" entry in table 3.36 of the PDF reference
            outputValues[i] = (outputValuesPrevious[i] + outputValuesNext[i]) / 2;
            outputValues[i] = interpolate(outputValues[i], 0, (float)Math.pow(2, bitsPerSample), decode.getMin(), decode.getMax());
            outputValues[i] = clipToRange(outputValues[i], range.getMin(), range.getMax());
        }

        return outputValues;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     * @return The range for this component.
     */
    public PDRange getRangeForOutput(int n)
    {
        COSArray rangeValues = getRangeValues();
        return new PDRange( rangeValues, n );
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     * @return The domain range for this component.
     */
    public PDRange getDomainForInput(int n)
    {
        COSArray domainValues = getDomainValues();
        return new PDRange( domainValues, n );
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

    public PDRange getRangeForComponent(int n)
    {
        COSArray rangeArray = (COSArray) stream.getStream().getDictionaryObject(COSName.RANGE);
        if (rangeArray == null || rangeArray.size() < getNumberOfComponents() * 2)
        {
            return new PDRange(); // 0..1
        }
        return new PDRange(rangeArray, n);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     *
     * @return The decode parameter range or null if none is set.
     */
    public PDRange getDecodeForParameter(int paramNum)
    {
        PDRange retval = null;
        COSArray decodeValues = getDecodeValues();
        if (decodeValues != null && decodeValues.size() >= paramNum * 2 + 1)
        {
            retval = new PDRange(decodeValues, paramNum);
        }
        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     * @return The range for this component.
     */
    public PDRange getRangeForOutput(int n)
    {
        COSArray rangeValues = getRangeValues();
        return new PDRange( rangeValues, n );
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.common.PDRange

     * @return The domain range for this component.
     */
    public PDRange getDomainForInput(int n)
    {
        COSArray domainValues = getDomainValues();
        return new PDRange( domainValues, n );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.