Package javax.media.jai

Examples of javax.media.jai.InterpolationNearest


                    * tileHeight);
              }
              log.debug("adding to(" + xOffset + "," + yOffset + "), url = "
                  + result.getRasterImage().getUrl());
              RenderedImage translated = TranslateDescriptor.create(colored, (float) xOffset,
                  (float) yOffset, new InterpolationNearest(), null);
              images.add(translated);
            } catch (ExecutionException e) {
              addLoadError(graphics, (ImageException) (e.getCause()), viewport);
            } catch (InterruptedException e) {
              log.warn("missing tile in mosaic " + e.getMessage());
View Full Code Here


    } else {
      // setup "normal" rotation
      pb.add(ri.getWidth() / 2.0f);
      pb.add(ri.getHeight() / 2.0f);
      pb.add((float) Math.toRadians(degrees));
      pb.add(new InterpolationNearest());
      op = JAI.create("Rotate", pb, null);
    }
    PlanarImage myPlanar = op.createInstance();
    retVal = myPlanar.getAsBufferedImage();
    return retVal;
View Full Code Here

        ParameterBlock pb = new ParameterBlock();
        pb.addSource(image);
        pb.add(0.0F);
        pb.add(0.0F);
        pb.add(t_angle);
        pb.add(new InterpolationNearest());
        return JAI.create("Rotate", pb, null);
    }
View Full Code Here

              hints.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
              hints.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED));
              hints.add(new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
              hints.add(new RenderingHints(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE));
              hints.add(new RenderingHints(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
              hints.add(new RenderingHints(JAI.KEY_INTERPOLATION,new InterpolationNearest()));
              graphics.addRenderingHints(hints);
             
              // JG: Store title cache on the layer blackboard so it can last between runs.
              //     Performance question: may do better to have a single larger tile cache on the map blackboard?
              //
View Full Code Here

              hints.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
              hints.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED));
              hints.add(new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
              hints.add(new RenderingHints(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE));
              hints.add(new RenderingHints(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
              hints.add(new RenderingHints(JAI.KEY_INTERPOLATION,new InterpolationNearest()));
              graphics.addRenderingHints(hints);
             
              final TileCache tempCache=currentContext.getTileCache();
              hints.add(new RenderingHints(JAI.KEY_TILE_CACHE,tempCache));
             
View Full Code Here

            final ParameterValueGroup param = (ParameterValueGroup) filteredSubsampleParams.clone();
            param.parameter("source").setValue(gc);
            param.parameter("scaleX").setValue(new Integer(scaleXInt));
            param.parameter("scaleY").setValue(new Integer(scaleYInt));

            if (interpolation.equals(new InterpolationNearest())) {
                param.parameter("qsFilterArray").setValue(new float[] { 1.0F });
            } else {
                param.parameter("qsFilterArray")
                     .setValue(new float[] { 0.5F, 1.0F / 3.0F, 0.0F, -1.0F / 12.0F });
            }
View Full Code Here

                                .getClipOffset());
                // The y translation.
                pb.add((float) -clipper.getY()
                                .getClipOffset());
                // The interpolation.
                pb.add(new InterpolationNearest());
                // Create the translate operation.
                try {
                    clippedImage = JAI.create("translate", pb, null);
                } catch (Exception e) {
                    LOGGER.error("jai-operation-failure", "translate");
View Full Code Here

        ParameterBlock pb = new ParameterBlock();
        pb.addSource(image);
        pb.add(0.0F);
        pb.add(0.0F);
        pb.add(tAngle);
        pb.add(new InterpolationNearest());
        return JAI.create("Rotate", pb, null);
    }
View Full Code Here

        case _BILINEAR:
            _interpolation = new InterpolationBilinear(_subSampleBits);
            break;

        case _NEARESTNEIGHBOR:
            _interpolation = new InterpolationNearest();
            break;

        default:
            throw new IllegalActionException(
                    "Invalid value for interpolationType");
View Full Code Here

        case _BILINEAR:
            parameters.add(new InterpolationBilinear(_subSampleBits));
            break;

        case _NEARESTNEIGHBOR:
            parameters.add(new InterpolationNearest());
            break;

        default:
            throw new IllegalActionException(
                    "Invalid value for interpolationType");
View Full Code Here

TOP

Related Classes of javax.media.jai.InterpolationNearest

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.