Package javax.media.jai

Examples of javax.media.jai.Interpolation


                finalRaster2Model.concatenate(decimationScaleTranform);

            // keep into account translation factors to place this tile
            finalRaster2Model.preConcatenate((AffineTransform) mosaicWorldToGrid);

            final Interpolation interpolation = request.getInterpolation();
            // paranoiac check to avoid that JAI freaks out when computing its internal layouT on images that are too small
            Rectangle2D finalLayout = ImageUtilities.layoutHelper(raster,
                    (float) finalRaster2Model.getScaleX(), (float) finalRaster2Model.getScaleY(),
                    (float) finalRaster2Model.getTranslateX(),
                    (float) finalRaster2Model.getTranslateY(), interpolation);
View Full Code Here


                    RenderingTransformationHelper helper = new RenderingTransformationHelper() {
                       
                        @Override
                        protected GridCoverage2D readCoverage(GridCoverage2DReader reader, Object params, GridGeometry2D readGG) throws IOException {
                            GeneralParameterValue[] readParams = (GeneralParameterValue[]) params;
                            Interpolation interpolation = getRenderingInterpolation();
                            GridCoverageReaderHelper helper;
                            try {
                                helper = new GridCoverageReaderHelper(reader,
                                        readGG.getGridRange2D(),
                                        ReferencedEnvelope.reference(readGG.getEnvelope2D()),
View Full Code Here

                                    // resolution is too different
                                    final ParameterValueGroup param = SCALE.getParameters();
                                    param.parameter("Source").setValue(coverage);
                                    param.parameter("xScale").setValue(ratioX);
                                    param.parameter("yScale").setValue(ratioY);
                                    final Interpolation interpolation = (Interpolation) hints.get(JAI.KEY_INTERPOLATION);
                                    if(interpolation != null) {
                                        param.parameter("Interpolation").setValue(interpolation);
                                    }
   
                                    coverage = (GridCoverage2D) PROCESSOR.doOperation(param);
View Full Code Here

                //
                // /////////////////////////////////////////////////////////////////
                final GridCoverageRenderer gcr = new GridCoverageRenderer(destinationCRS,
                        originalMapExtent, screenSize, worldToScreen, java2dHints);

                Interpolation interpolation = getRenderingInterpolation();
                gcr.paint(graphics, reader, readParams, symbolizer, interpolation, null);

                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("Raster rendered");
                }
View Full Code Here

        // scale if/as needed. Also check if the scale expands the coverage dimension for at least 1 pixel.
        //
        ////
        if (scaleFactor != null && (Math.abs(coverageWidth*(scaleFactor - 1f)) >=1 || Math.abs(coverageHeight*(scaleFactor - 1f)) >= 1) ) {
            // Selection of the interpolation parameter
            Interpolation interp = interpolation != null ? interpolation : new InterpolationNearest();
            // Selection of the ScaleFactors in order to check if the final Raster has almost 1 pixel for Height and Width
            double scaleX = scaleFactor;
            double scaleY = scaleFactor;
            // RenderedImage associated to the coverage
            final RenderedImage imageToBescaled = gc2d.getRenderedImage();
View Full Code Here

                }

            }
      // keep into account translation factors to place this tile
      finalRaster2Model.preConcatenate((AffineTransform) mosaicWorldToGrid);
      final Interpolation interpolation = request.getInterpolation();
     
     
      //paranoiac check to avoid that JAI freaks out when computing its internal layouT on images that are too small
      Rectangle2D finalLayout= ImageUtilities.layoutHelper(
          raster,
View Full Code Here

                            + source + " is invalid!");
                }
            }

            // get the interpolation
            Interpolation output = parser.parse(input);
            if (output == null && LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Unable to parse " + input);
            }
            return (T) output;
View Full Code Here

            if (srcROI.getBounds().isEmpty()) {
                return java.awt.Image.UndefinedProperty;
            }

            // Retrieve the Interpolation object.
            Interpolation interp = (Interpolation)pb.getObjectParameter(1);

            // Determine the effective source bounds.
            Rectangle srcBounds = null;
            PlanarImage dst = op.getRendering();
            if (dst instanceof GeometricOpImage &&
                ((GeometricOpImage)dst).getBorderExtender() == null) {
                srcBounds =
                    new Rectangle(src.getMinX() + interp.getLeftPadding(),
                                  src.getMinY() + interp.getTopPadding(),
                                  src.getWidth() - interp.getWidth() + 1,
                                  src.getHeight() - interp.getHeight() + 1);
            } else {
                srcBounds = new Rectangle(src.getMinX(),
                     src.getMinY(),
                     src.getWidth(),
                     src.getHeight());
View Full Code Here

        ///////////////////////////////////////////////////////////////////////
        //
        // Nearest neighbor interpolation and non-geophysics view.
        //
        ///////////////////////////////////////////////////////////////////////
        Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
        warp(originallyIndexedCoverage      .view(PACKED), interp);
        warp(indexedCoverage                .view(PACKED), interp);
        warp(indexedCoverageWithTransparency.view(PACKED), interp);

        ///////////////////////////////////////////////////////////////////////
View Full Code Here

        final GridCoverage2D indexedCoverageWithTransparency = EXAMPLES.get(3);
        final GridCoverage2D floatCoverage                   = EXAMPLES.get(4);

        // On this one the Subsample average should do an RGB expansion
        float[] filter = new float[] {1};
        Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
        filteredSubsample(indexedCoverage.view(GEOPHYSICS), interp, filter);

        // On this one the Subsample average should do an RGB expansion preserving alpha.
        filteredSubsample(indexedCoverageWithTransparency.view(GEOPHYSICS), interp, filter);
View Full Code Here

TOP

Related Classes of javax.media.jai.Interpolation

Copyright © 2018 www.massapicom. 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.