congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ColorConvertDescriptor.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
javax.media.jai.operator.ColorConvertDescriptor

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

origin: org.imajine.image/org-imajine-image-plugin-jai

 @Nonnull
 @Override
 protected PlanarImage execute (final @Nonnull ConvertColorProfileOp operation, 
                 final @Nonnull EditableImage image,
                 final @Nonnull PlanarImage planarImage)
  {
   log.info("execute({}) - {} ", operation, planarImage.getSampleModel());
   
   if (operation.getRenderingIntent() != PERCEPTUAL)
    {
     throw new IllegalArgumentException("Can only use PERCEPTUAL intent, was " + operation.getRenderingIntent());  
    }
   
   final ICC_Profile iccProfile = operation.getIccProfile();      
   final RenderingHints hints = new RenderingHints(Collections.<RenderingHints.Key, Object>emptyMap());
   hints.put(KEY_COLOR_RENDERING, VALUE_COLOR_RENDER_QUALITY);
   final PlanarImage result = ColorConvertDescriptor.create(planarImage, JAIUtils.getColorModel(planarImage, iccProfile), hints); 
   JAIUtils.logImage(log, ">>>> returning", planarImage);
   
   return result;
  }
}
origin: org.imajine/org-imajine-image-plugin-jai

/*******************************************************************************
 *
 * If the current image is not sRGB, apply a ColorConvert operation to convert
 * it to sRGB.
 *
 * @param colorModel    the target color model (must be a sRGB color space)
 * @param hints         the RenderingHints
 *
 ******************************************************************************/
public static PlanarImage jaiConvertTosRGBColorProfile (final PlanarImage source,
                            final ColorModel colorModel,
                            final RenderingHints hints)
 {
  boolean is_sRGB = source.getColorModel().getColorSpace().isCS_sRGB();
  logger.finer(">>>> planarImage.is_sRGB: " + is_sRGB);
  if (!is_sRGB)
   {
    // Convert color as last, since if the image has been scaled there are less pixels to convert
    logger.finer(">>>> Applying ColorConvertDescriptor");
    PlanarImage result = ColorConvertDescriptor.create(source, colorModel, hints);
    logImage(logger, ">>>>>>>>    planarImage", result);
    return result;
   }
  else
   {
    return source;
   }
 }
origin: org.imajine.image/org-imajine-image-plugin-jai

/*******************************************************************************
 *
 * If the current image is not sRGB, apply a ColorConvert operation to convert
 * it to sRGB.
 *
 * @param colorModel    the target color model (must be a sRGB color space)
 * @param hints         the RenderingHints
 *
 ******************************************************************************/
public static PlanarImage jaiConvertTosRGBColorProfile (final PlanarImage source,
                            final ColorModel colorModel,
                            final RenderingHints hints)
 {
  boolean is_sRGB = source.getColorModel().getColorSpace().isCS_sRGB();
  log.debug(">>>> planarImage.is_sRGB: {}", is_sRGB);
  if (!is_sRGB)
   {
    // Convert color as last, since if the image has been scaled there are less pixels to convert
    log.debug(">>>> Applying ColorConvertDescriptor");
    PlanarImage result = ColorConvertDescriptor.create(source, colorModel, hints);
    logImage(log, ">>>>>>>>    planarImage", result);
    return result;
   }
  else
   {
    return source;
   }
 }
origin: org.imajine/org-imajine-image-plugin-jai

 /*******************************************************************************
  *
  * @inheritDoc
  *
  ******************************************************************************/
 protected PlanarImage execute (ConvertColorProfileOp operation, final EditableImage image, PlanarImage planarImage)
  {
   ICC_Profile iccProfile = operation.getICCProfile();      
   logger.fine("convertColorProfile(" + ImageUtils.getICCProfileName(iccProfile) + ") - " + planarImage.getSampleModel());
   planarImage = ColorConvertDescriptor.create(planarImage, JAIUtils.getColorModel(planarImage, iccProfile), null); // FIXME: RenderingHints
   JAIUtils.logImage(logger, ">>>>   convertColorProfile() returning", planarImage);
   
   return planarImage;
  }
}
origin: org.geotools/gt2-coverage

/**
 * Forces the {@linkplain #image} color model to the
 * {@linkplain ColorSpace#CS_GRAY GRAYScale color space}. If the current
 * color space is already of {@linkplain ColorSpace#TYPE_GRAY  type}, then
 * this method does nothing.
 *
 * @return this {@link ImageWorker}.
 *
 * @see #isColorSpaceGRAYScale
 * @see ColorConvertDescriptor
 */
public final ImageWorker forceColorSpaceGRAYScale() {
  if (!isColorSpaceRGB()) {
    final ColorModel cm = new ComponentColorModel(
        ColorSpace.getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
    image = ColorConvertDescriptor.create(image, cm, getRenderingHints());
    invalidateStatistics();
  }
  // All post conditions for this method contract.
  assert isColorSpaceGRAYScale();
  return this;
}
origin: org.geotools/gt-coverage

/**
 * Forces the {@linkplain #image} color model to the
 * {@linkplain ColorSpace#CS_GRAY GRAYScale color space}. If the current
 * color space is already of {@linkplain ColorSpace#TYPE_GRAY  type}, then
 * this method does nothing.
 *
 * @return this {@link ImageWorker}.
 *
 * @see #isColorSpaceGRAYScale
 * @see ColorConvertDescriptor
 */
public final ImageWorker forceColorSpaceGRAYScale() {
  if (!isColorSpaceRGB()) {
    final ColorModel cm = new ComponentColorModel(
        ColorSpace.getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
    image = ColorConvertDescriptor.create(image, cm, getRenderingHints());
    invalidateStatistics();
  }
  // All post conditions for this method contract.
  assert isColorSpaceGRAYScale();
  return this;
}
origin: org.geotools/gt2-coverage

/**
 * Forces the {@linkplain #image} color model to the
 * {@linkplain ColorSpace#CS_sRGB RGB color space}. If the current color
 * space is already of {@linkplain ColorSpace#TYPE_RGB RGB type}, then this
 * method does nothing. This operation may loose the alpha channel.
 *
 * @return this {@link ImageWorker}.
 *
 * @see #isColorSpaceRGB
 * @see ColorConvertDescriptor
 */
public final ImageWorker forceColorSpaceRGB() {
  if (!isColorSpaceRGB()) {
    final ColorModel cm = new ComponentColorModel(
        ColorSpace.getInstance(ColorSpace.CS_sRGB), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
    image = ColorConvertDescriptor.create(image, cm, getRenderingHints());
    invalidateStatistics();
  }
  // All post conditions for this method contract.
  assert isColorSpaceRGB();
  return this;
}
origin: org.geotools/gt-coverage

/** Forces the provided {@link ColorModel} via the JAI ColorConvert operation.*/
private void forceColorModel(final ColorModel cm){
      
  final org.jaitools.imageutils.ImageLayout2 il = new org.jaitools.imageutils.ImageLayout2(image);
  il.setColorModel(cm);
  il.setSampleModel(cm.createCompatibleSampleModel(image.getWidth(), image.getHeight()));
  final RenderingHints oldRi = this.getRenderingHints();
  final RenderingHints newRi = (RenderingHints) oldRi.clone();
  newRi.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, il));
  setRenderingHints(newRi);
  image = ColorConvertDescriptor.create(image, cm, getRenderingHints());
  // restore RI
  this.setRenderingHints(oldRi);
  // invalidate stats
  invalidateStatistics();
}
origin: geosolutions-it/jai-ext

  imageCalculated = javax.media.jai.operator.ColorConvertDescriptor.create(image,
      colorModel, null);
} else {
javax.media.jai.operatorColorConvertDescriptorcreate

Popular methods of ColorConvertDescriptor

    Popular in Java

    • Running tasks concurrently on multiple threads
    • startActivity (Activity)
    • requestLocationUpdates (LocationManager)
    • putExtra (Intent)
    • Color (java.awt)
      The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
    • Kernel (java.awt.image)
    • HashSet (java.util)
      HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
    • TreeMap (java.util)
      Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
    • LogFactory (org.apache.commons.logging)
      Factory for creating Log instances, with discovery and configuration features similar to that employ
    • Logger (org.slf4j)
      The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
    • Top plugins for Android Studio
    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