Codota Logo
javax.media.jai.operator
Code IndexAdd Codota to your IDE (free)

How to use javax.media.jai.operator

Best Java code snippets using javax.media.jai.operator (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: geoserver/geoserver

Number[] bandValues = new Number[numBands]; // all zeroes
Arrays.fill(bandValues, Double.valueOf(0));
ConstantDescriptor.create(
    width,
    height,
origin: net.sf.jung/jung-jai

/**
 * create an instance
 *
 */
public TransformingImageVertexIconRenderer() {
  this.warpDescriptor = new WarpDescriptor();
}

origin: senbox-org/s1tbx

private RenderedImage downSampleImage(RenderedImage intendityImage) {
  final double scaleX = 1.0 / blockWidth; // 1/8 = 0.125
  final double scaleY = 1.0 / blockHeight; // 1/8 = 0.125
  return SubsampleAverageDescriptor.create(intendityImage, scaleX, scaleY, null);
}
origin: bcdev/beam

public static PlanarImage createColoredMaskImage(Color color, RenderedImage alphaImage, RenderingHints hints) {
  RenderedOp colorImage =
      ConstantDescriptor.create(
          (float) alphaImage.getWidth(),
          (float) alphaImage.getHeight(),
          new Byte[]{
              (byte) color.getRed(),
              (byte) color.getGreen(),
              (byte) color.getBlue(),
          }, hints);
  return BandMergeDescriptor.create(colorImage, alphaImage, hints);
}
origin: bcdev/beam

private static RenderedOp createScaledImage(int targetWidth, int targetHeight, int sourceWidth, int sourceHeight, RenderedImage srcImg,
                      RenderingHints renderingHints) {
  float xScale = (float) targetWidth / (float) sourceWidth;
  float yScale = (float) targetHeight / (float) sourceHeight;
  RenderedOp tempImg = ScaleDescriptor.create(srcImg, xScale, yScale, 0.5f, 0.5f,
                        Interpolation.getInstance(Interpolation.INTERP_NEAREST),
                        renderingHints);
  return CropDescriptor.create(tempImg, 0f, 0f, (float) targetWidth, (float) targetHeight, renderingHints);
}
origin: geosolutions-it/jai-ext

private double[][] computeExtrema(RenderedImage image1, RenderedImage image2) {
  RenderedImage int1 = FormatDescriptor.create(image1, DataBuffer.TYPE_SHORT, null);
  RenderedImage int2 = FormatDescriptor.create(image2, DataBuffer.TYPE_SHORT, null);
  RenderedImage diff = SubtractDescriptor.create(int1, int2, null);
  RenderedImage extremaImg = ExtremaDescriptor.create(diff, null, 1, 1, false, Integer.MAX_VALUE, null);
  double[][] extrema = (double[][]) extremaImg.getProperty("extrema");
  return extrema;
}

origin: senbox-org/s2tbx

  public static RenderedImage resize(RenderedImage sourceImage, float rescaleXfactor, float rescaleYfactor, Interpolation interp) {
    return ScaleDescriptor.create(sourceImage, rescaleXfactor, rescaleYfactor, 0.0f, 0.0f, interp, null);
  }
}
origin: geotools/geotools

if (image.getColorModel().hasAlpha()) {
  RenderedImage alpha =
      BandSelectDescriptor.create(
          image, new int[] {image.getSampleModel().getNumBands() - 1}, null);
  alpha = MultiplyConstDescriptor.create(alpha, new double[] {alphaThreshold}, null);
  image = BandSelectDescriptor.create(image, new int[] {0, 1, 2}, null);
origin: geotools/geotools

/**
 * Test transparency is preserved when applying an RGB ChannelSelect and ContrastEnhancement
 * style to an imageMosaic with Transparent Footprint setting.
 */
@Test
public void testTransparentFootprintWithContrastEnhancementInChannelSelect()
    throws IOException, NoSuchAuthorityCodeException, FactoryException {
  File mosaicDirectory = prepareDirectory("footprintCECS");
  GridCoverage2D gc = readCoverage(mosaicDirectory, FootprintBehavior.Transparent, null);
  RenderedImage ri = gc.getRenderedImage();
  RenderedOp extrema = ExtremaDescriptor.create(ri, null, 1, 1, false, 1, null);
  double[] minimum = (double[]) extrema.getProperty("minimum");
  double[] maximum = (double[]) extrema.getProperty("maximum");
  // read values, not stretched, alpha is present
  assertArrayEquals(new double[] {0, 0, 0, 0}, minimum, 1E-6);
  assertArrayEquals(new double[] {54, 54, 54, 255}, maximum, 1E-6);
  GridCoverage2D output = (GridCoverage2D) symbolizeRaster(gc, "ce_cs.sld");
  ri = output.getRenderedImage();
  // Assert the alpha band has been preserved, even with a CS+CE SLD in place
  assertHasAlpha(ri);
  extrema = ExtremaDescriptor.create(ri, null, 1, 1, false, 1, null);
  minimum = (double[]) extrema.getProperty("minimum");
  maximum = (double[]) extrema.getProperty("maximum");
  // values are stretched
  assertArrayEquals(new double[] {0, 0, 0, 0}, minimum, 1E-6);
  assertArrayEquals(new double[] {255, 255, 255, 255}, maximum, 1E-6);
  disposeCoverage(output);
  ImageUtilities.disposePlanarImageChain(extrema);
}
origin: geotools/geotools

sourceImage = BandSelectDescriptor.create(sourceImage, new int[] {band}, null);
origin: geotools/geotools

classificationRaster = NullDescriptor.create(classificationRaster, hints);
origin: geotools/geotools

/**
 * Adds an extra channel to the image, with a value of 255 (not public yet because it won't work
 * with all image types)
 *
 * @return
 */
private ImageWorker addAlphaChannel() {
  final ImageLayout tempLayout = new ImageLayout(image);
  tempLayout
      .unsetValid(ImageLayout.COLOR_MODEL_MASK)
      .unsetValid(ImageLayout.SAMPLE_MODEL_MASK);
  RenderedImage alpha =
      ConstantDescriptor.create(
          Float.valueOf(image.getWidth()),
          Float.valueOf(image.getHeight()),
          new Byte[] {Byte.valueOf((byte) 255)},
          new RenderingHints(JAI.KEY_IMAGE_LAYOUT, tempLayout));
  addBand(alpha, false, true, null);
  return this;
}
origin: geotools/geotools

/**
 * Test transparency is preserved when applying an RGB ChannelSelect and ContrastEnhancement
 * style to an imageMosaic with transparent color being set
 */
@Test
public void testTransparentColorWithContrastEnhancementInChannelSelect()
    throws IOException, NoSuchAuthorityCodeException, FactoryException {
  File mosaicDirectory = prepareDirectory("transparentCECS");
  GridCoverage2D gc = readCoverage(mosaicDirectory, FootprintBehavior.None, Color.BLACK);
  RenderedImage ri = gc.getRenderedImage();
  RenderedOp extrema = ExtremaDescriptor.create(ri, null, 1, 1, false, 1, null);
  double[] minimum = (double[]) extrema.getProperty("minimum");
  double[] maximum = (double[]) extrema.getProperty("maximum");
  // read values, not stretched, alpha is present
  assertArrayEquals(new double[] {0, 0, 0, 0}, minimum, 1E-6);
  assertArrayEquals(new double[] {54, 54, 54, 255}, maximum, 1E-6);
  GridCoverage2D output = (GridCoverage2D) symbolizeRaster(gc, "ce_cs.sld");
  ri = output.getRenderedImage();
  // Assert the alpha band has been preserved, even with a CS+CE SLD in place
  assertHasAlpha(ri);
  extrema = ExtremaDescriptor.create(ri, null, 1, 1, false, 1, null);
  minimum = (double[]) extrema.getProperty("minimum");
  maximum = (double[]) extrema.getProperty("maximum");
  // values are stretched
  assertArrayEquals(new double[] {0, 0, 0, 0}, minimum, 1E-6);
  assertArrayEquals(new double[] {255, 255, 255, 255}, maximum, 1E-6);
  disposeCoverage(output);
  ImageUtilities.disposePlanarImageChain(extrema);
}
origin: geotools/geotools

  /**
   * Post processes a blank image response, eventually making it transparent
   *
   * @param finalImage
   * @return
   */
  public RenderedImage postProcessBlankResponse(RenderedImage finalImage, RenderingHints hints) {
    // prepare a ROI made of only zeroes
    ImageLayout layout =
        new ImageLayout(
            finalImage.getMinX(),
            finalImage.getMinY(),
            finalImage.getWidth(),
            finalImage.getHeight());
    RenderedOp roi =
        ConstantDescriptor.create(
            (float) finalImage.getWidth(),
            (float) finalImage.getHeight(),
            new Byte[] {0},
            new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));

    ImageWorker iw = new ImageWorker(finalImage);
    iw.setROI(new ROI(roi));
    return iw.getRenderedImage();
  }
}
origin: geotools/geotools

    ExtremaDescriptor.create(ri, null, 1, 1, false, 1, renderingHints);
double[][] extrema = (double[][]) extremaOp.getProperty("Extrema");
double[] mins = extrema[0];
origin: geotools/geotools

return ConstantDescriptor.create(
    Float.valueOf(rasterBounds.width),
    Float.valueOf(rasterBounds.height),
origin: geotools/geotools

ConstantDescriptor.create(
    new Float(w), new Float(h), new Byte[] {(byte) 255}, hints);
origin: geotools/geotools

        image.getHeight());
RenderedOp alphaBand =
    ConstantDescriptor.create(
        (float) image.getWidth(),
        (float) image.getHeight(),
origin: geotools/geotools

ConstantDescriptor.create(
    new Float(w), new Float(h), new Byte[] {(byte) 255}, hints);
origin: geotools/geotools

ConstantDescriptor.create(
    (float) rasterBounds.width,
    (float) rasterBounds.height,
javax.media.jai.operator

Most used classes

  • ConstantDescriptor
  • ScaleDescriptor
  • BandSelectDescriptor
  • BorderDescriptor
  • MosaicDescriptor
  • ExtremaDescriptor,
  • TranslateDescriptor,
  • CropDescriptor,
  • LookupDescriptor,
  • HistogramDescriptor,
  • NullDescriptor,
  • BandCombineDescriptor,
  • ColorConvertDescriptor,
  • RescaleDescriptor,
  • AddDescriptor,
  • BandMergeDescriptor,
  • MultiplyConstDescriptor,
  • AffineDescriptor,
  • ConvolveDescriptor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now