Tabnine Logo
WritableRenderedImage.getSampleModel
Code IndexAdd Tabnine to your IDE (free)

How to use
getSampleModel
method
in
java.awt.image.WritableRenderedImage

Best Java code snippets using java.awt.image.WritableRenderedImage.getSampleModel (Showing top 8 results out of 315)

origin: Geomatys/geotoolkit

/**
 * <p>Fill destination image area from interpolation of source pixels from imageSrc.<br/>
 * Source pixel coordinates is obtained from invert transformation of destination pixel coordinates.<br/><br/>
 * - In case where interpolation equals {@linkplain InterpolationCase#LANCZOS lanczos interpolation} the default
 * choosen lanczos window is initialized by value 2.<br/>
 * - The default border comportement is define as {@link ResampleBorderComportement#FILL_VALUE}<br/>
 * - In case where pixel transformation is out of source image boundary the default choosen fill value is {@link Double#NaN}.<br/><br/>
 *
 * <strong>
 * Moreover : the specified MathTransform should be from CENTER of target image point to CENTER of source image point.<br/>
 * The used MathTransform is consider as {@link PixelInCell#CELL_CENTER} configuration.</strong></p>
 *
 * @param mathTransform Transformation use to transform target point to source point.
 * @param imageDest image will be fill by image source pixel interpolation.
 * @param imageSrc source image which contain pixel values which will be interpolate.
 * @param interpolation case of interpolation.
 * @throws NoninvertibleTransformException if it is impossible to invert {@code MathTransform} parameter.
 * @see ResampleBorderComportement
 * @see LanczosInterpolation#LanczosInterpolation(org.geotoolkit.image.iterator.PixelIterator, int)
 */
public Resample(MathTransform mathTransform, WritableRenderedImage imageDest,
    RenderedImage imageSrc, InterpolationCase interpolation) throws TransformException {
  this(mathTransform, imageDest, null, imageSrc, interpolation, 2, ResampleBorderComportement.FILL_VALUE, new double[imageDest.getSampleModel().getNumBands()]);
}
origin: Geomatys/geotoolkit

/**
 * Colors an area of connected pixels with the same set of color.
 * The fill is performed in place in the given image.
 * The operation is performed immediately; it is not deferred like usual JAI operations.
 *
 * @param image     The image in which to colors an area.
 * @param oldValues The colors to replace (usually only 1 color, but more are allowed).
 * @param newValues The new colors replacing the old ones.
 * @param points    The coordinate of the starting point. There is usually only one
 *                  such point, but more are allowed.
 */
public static void fill(final WritableRenderedImage image, final double[][] oldValues,
    final double[] newValues, final Point... points)
{
  /*
   * Copies the old values in a set of SampleValues objects. The exact type of SampleValues
   * will depend on the transfer type.
   */
  final int transferType = image.getSampleModel().getTransferType();
  final Set<SampleValues> oldSamples = new HashSet<>(hashMapCapacity(oldValues.length));
  for (final double[] samples : oldValues) {
    oldSamples.add(SampleValues.getInstance(transferType, samples));
  }
  final SampleValues newSamples = SampleValues.getInstance(transferType, newValues);
  oldSamples.remove(newSamples); // Necessary for avoiding infinite loop.
  if (oldSamples.isEmpty()) {
    return;
  }
  fill(image, oldSamples::contains, newSamples, points);
}
origin: Geomatys/geotoolkit

/**
 * Colors an area of connected pixels with the same set of color.
 * The fill is performed in place in the given image.
 * The operation is performed immediately; it is not deferred like usual JAI operations.
 *
 * @param image     The image in which to colors an area.
 * @param oldColors The colors to replace (usually only 1 color, but more are allowed).
 * @param newColors The new colors replacing the old ones.
 * @param points    The coordinate of the starting point. There is usually only one
 *                  such point, but more are allowed.
 */
public static void fill(final WritableRenderedImage image, final Color[] oldColors,
    final Color newColors, final Point... points)
{
  final int numBands = image.getSampleModel().getNumBands();
  final double[][] oldValues = new double[oldColors.length][];
  for (int i=0; i<oldValues.length; i++) {
    oldValues[i] = ColorUtilities.toDoubleValues(oldColors[i], numBands);
  }
  final double[] newValues = ColorUtilities.toDoubleValues(newColors, numBands);
  fill(image, oldValues, newValues, points);
}
origin: apache/sis

destination = output;
if (output != null) {
  if (!input.getSampleModel().equals(output.getSampleModel())) {
    throw new IllegalArgumentException(Resources.format(Resources.Keys.MismatchedSampleModel));
  } else if (input.getMinX()   != output.getMinX()  ||
origin: Geomatys/geotoolkit

|| renderedImage.getWidth()  != writableRI.getWidth()
|| renderedImage.getHeight() != writableRI.getHeight()
|| renderedImage.getSampleModel().getNumBands() != writableRI.getSampleModel().getNumBands())
throw new IllegalArgumentException("rendered image and writable rendered image dimensions are not conform.\n" +
    "First : "+renderedImage+"\nSecond : "+writableRI);
origin: Geomatys/geotoolkit

if (renderedImage.getSampleModel().getNumBands() != writableRI.getSampleModel().getNumBands())
  throw new IllegalArgumentException("renderedImage and writableRenderedImage haven't got same band number");
final int riMinX   = renderedImage.getMinX();
origin: Geomatys/geotoolkit

destCoords = new double[2];
this.rbc   = rbc;
this.clamp = getClamp(imageDest.getSampleModel().getDataType());
origin: Geomatys/geotoolkit

this.clamp = getClamp(imageDest.getSampleModel().getDataType());
java.awt.imageWritableRenderedImagegetSampleModel

Popular methods of WritableRenderedImage

  • getWritableTile
  • getHeight
  • getMinX
  • getMinY
  • getWidth
  • releaseWritableTile
  • getMinTileX
  • getMinTileY
  • addTileObserver
  • getNumXTiles
  • getNumYTiles
  • getTile
  • getNumYTiles,
  • getTile,
  • getTileHeight,
  • getTileWidth,
  • removeTileObserver,
  • getTileGridXOffset,
  • getTileGridYOffset

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now