Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.MathTransform1D.transform()


                    } else {
                        if (!toGeo) {
                            // We are going to convert geophysics values to packed ones.
                            transform = transform.inverse();
                        }
                        offset = transform.transform(0);
                        scale  = transform.derivative(Double.NaN);
                        if (isNaN(scale) || isNaN(offset)) {
                            // One category doesn't use a linear transformation. We can't deal with
                            // that with "Rescale" or "Piecewise". Fallback on our "SampleTranscode".
                            canRescale   = false;
View Full Code Here


                    final int[][] data = new int[nbands][];
                    for (int i=nbands; --i>=0;) {
                        final MathTransform1D tr = transforms[i];
                        final int[] array = new int[length];
                        for (int j=length; --j>=0;) {
                            array[j] = (int) min(max(round(tr.transform(j+offset)),
                                    Integer.MIN_VALUE), Integer.MAX_VALUE);
                        }
                        data[i] = array;
                    }
                    table = new LookupTableJAI(data, offset);
View Full Code Here

                    final short[][] data = new short[nbands][];
                    for (int i=nbands; --i>=0;) {
                        final MathTransform1D tr = transforms[i];
                        final short[] array = new short[length];
                        for (int j=length; --j>=0;) {
                            array[j] = (short) min(max(round(tr.transform(j+offset)), minimum), maximum);
                        }
                        data[i] = array;
                    }
                    table = new LookupTableJAI(data, offset, minimum!=0);
                    break;
View Full Code Here

                    final byte[][] data = new byte[nbands][];
                    for (int i=nbands; --i>=0;) {
                        final MathTransform1D tr = transforms[i];
                        final byte[] array = new byte[length];
                        for (int j=length; --j>=0;) {
                            array[j] = (byte) min(max(round(tr.transform(j+offset)), 0), 0xFF);
                        }
                        data[i] = array;
                    }
                    table = new LookupTableJAI(data, offset);
                    break;
View Full Code Here

        if (range == null) try {
            final MathTransform1D tr = inverse.transform;
            final NumberRange<? extends Number> r = inverse.range;
            boolean minIncluded = r.isMinIncluded();
            boolean maxIncluded = r.isMaxIncluded();
            double min  = tr.transform(r.getMinimum());
            double max  = tr.transform(r.getMaximum());
            double min2 = tr.transform(r.getMinimum(!minIncluded));
            double max2 = tr.transform(r.getMaximum(!maxIncluded));
            if ((minIncluded ? min2 : min) > (maxIncluded ? max2 : max)) {
                final double  tmp, tmp2;
View Full Code Here

            final MathTransform1D tr = inverse.transform;
            final NumberRange<? extends Number> r = inverse.range;
            boolean minIncluded = r.isMinIncluded();
            boolean maxIncluded = r.isMaxIncluded();
            double min  = tr.transform(r.getMinimum());
            double max  = tr.transform(r.getMaximum());
            double min2 = tr.transform(r.getMinimum(!minIncluded));
            double max2 = tr.transform(r.getMaximum(!maxIncluded));
            if ((minIncluded ? min2 : min) > (maxIncluded ? max2 : max)) {
                final double  tmp, tmp2;
                final boolean tmpIncluded;
View Full Code Here

            final NumberRange<? extends Number> r = inverse.range;
            boolean minIncluded = r.isMinIncluded();
            boolean maxIncluded = r.isMaxIncluded();
            double min  = tr.transform(r.getMinimum());
            double max  = tr.transform(r.getMaximum());
            double min2 = tr.transform(r.getMinimum(!minIncluded));
            double max2 = tr.transform(r.getMaximum(!maxIncluded));
            if ((minIncluded ? min2 : min) > (maxIncluded ? max2 : max)) {
                final double  tmp, tmp2;
                final boolean tmpIncluded;
                tmp=min;   tmp2=min2;  tmpIncluded=minIncluded;
View Full Code Here

            boolean minIncluded = r.isMinIncluded();
            boolean maxIncluded = r.isMaxIncluded();
            double min  = tr.transform(r.getMinimum());
            double max  = tr.transform(r.getMaximum());
            double min2 = tr.transform(r.getMinimum(!minIncluded));
            double max2 = tr.transform(r.getMaximum(!maxIncluded));
            if ((minIncluded ? min2 : min) > (maxIncluded ? max2 : max)) {
                final double  tmp, tmp2;
                final boolean tmpIncluded;
                tmp=min;   tmp2=min2;  tmpIncluded=minIncluded;
                min=max;   min2=max2;  minIncluded=maxIncluded;
View Full Code Here

                     *       for range inclusion should use the exclusive extremas.
                     */
                    assert hasGaps || (category==nodata) || // Disable assertion in those cases
                           (Double.isNaN(value) ? Double.doubleToRawLongBits(value) == rawBits
                                                : (value>=minimum && value<=maximum)) : value;
                    value = tr.transform(value);
                    if (value > maxTr) {
                        value = maxTr;
                    } else if (value < minTr) {
                        value = minTr;
                    }
View Full Code Here

            final float value = Float.intBitsToFloat(rawBits);
            assertTrue("isNaN", Float.isNaN(value));
            matrix.setElement(0,1, value);
            final MathTransform1D tr = (MathTransform1D) factory.createAffineTransform(matrix);
            assertTrue("ConstantTransform1D", tr instanceof ConstantTransform1D);
            final float compare = (float) tr.transform(0);
            assertEquals("rawBits", rawBits, Float.floatToRawIntBits(compare));
        }
    }

    /**
 
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.