javax.media.jai.JAI.getDefaultInstance()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中javax.media.jai.JAI.getDefaultInstance()方法的一些代码示例,展示了JAI.getDefaultInstance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JAI.getDefaultInstance()方法的具体详情如下:
包路径:javax.media.jai.JAI
类名称:JAI
方法名:getDefaultInstance

JAI.getDefaultInstance介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

public JAI getJAI() {
  return JAI.getDefaultInstance();
}

代码示例来源:origin: geoserver/geoserver

final OperationRegistry opRegistry = JAI.getDefaultInstance().getOperationRegistry();
for (String mode : RegistryMode.getModeNames()) {
  for (Iterator descriptors = opRegistry.getDescriptors(mode).iterator();

代码示例来源:origin: geoserver/geoserver

public static OperationRegistry initializeRegistry() {
  try {
    InputStream url = PropertyUtil.getFileFromClasspath(JAI_REGISTRY_FILE);
    if (url == null) {
      throw new RuntimeException("Could not find the main registry file");
    }
    OperationRegistry registry = new ConcurrentOperationRegistry();
    if (url != null) {
      registry.updateFromStream(url);
    }
    registry.registerServices(null);
    return registry;
  } catch (IOException ioe) {
    ImagingListener listener = JAI.getDefaultInstance().getImagingListener();
    String message = "Error occurred while initializing JAI";
    listener.errorOccurred(
        message, new ImagingException(message, ioe), OperationRegistry.class, false);
    return null;
  }
}

代码示例来源:origin: geoserver/geoserver

JAI.getDefaultInstance()
    .setImagingListener(
        new ImagingListener() {
JAI jaiDef = JAI.getDefaultInstance();
if (!(jaiDef.getOperationRegistry() instanceof ConcurrentOperationRegistry
    || jaiDef.getOperationRegistry()

代码示例来源:origin: geotools/geotools

/**
 * Allows or disallow native acceleration for the specified operation on the {@linkplain
 * JAI#getDefaultInstance default JAI instance}. This method is a shortcut for <code>
 * {@linkplain #setNativeAccelerationAllowed(String,boolean,JAI)
 * setNativeAccelerationAllowed}(operation, allowed, JAI.getDefaultInstance())</code>.
 *
 * @see #setNativeAccelerationAllowed(String, boolean, JAI)
 */
public static void setNativeAccelerationAllowed(final String operation, final boolean allowed) {
  setNativeAccelerationAllowed(operation, allowed, JAI.getDefaultInstance());
}

代码示例来源:origin: geoserver/geoserver

void initJAI(JAIInfo jai) {
  JAI jaiDef = JAI.getDefaultInstance();
  jai.setJAI(jaiDef);

代码示例来源:origin: geotools/geotools

/**
 * Returns the {@link JAI} instance to use for operations on {@link RenderedImage}. If no JAI
 * instance is defined for the {@link Hints#JAI_INSTANCE} key, then the default instance is
 * returned.
 *
 * @param hints The rendering hints, or {@code null} if none.
 * @return The JAI instance to use (never {@code null}).
 */
public static final JAI getJAI(final RenderingHints hints) {
  if (hints != null) {
    final Object value = hints.get(Hints.JAI_INSTANCE);
    if (value instanceof JAI) {
      return (JAI) value;
    }
  }
  return JAI.getDefaultInstance();
}

代码示例来源:origin: geotools/geotools

public static synchronized void register(boolean force) {
  if (!registered || force) {
    OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
    registry.addPropertyGenerator("rendered", "Affine", new GTAffinePropertyGenerator());
    registered = true;
  }
}

代码示例来源:origin: geotools/geotools

public static synchronized void register(boolean force) {
  if (!registered || force) {
    OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
    registry.addPropertyGenerator("rendered", "Warp", new GTWarpPropertyGenerator());
    registered = true;
  }
}

代码示例来源:origin: geotools/geotools

RenderingHints hints = new Hints(JAI.getDefaultInstance().getRenderingHints());
hints.putAll(GeoTools.getDefaultHints());
return new OpImage(new Vector(sourceImages), il, hints, false) {

代码示例来源:origin: geotools/geotools

protected static OperationDescriptor getOperationDescriptor(final String name)
    throws OperationNotFoundException {
  final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
  OperationDescriptor operation =
      (OperationDescriptor) registry.getDescriptor(RenderedRegistryMode.MODE_NAME, name);
  if (operation != null) {
    return operation;
  }
  throw new OperationNotFoundException(Errors.format(ErrorKeys.OPERATION_NOT_FOUND_$1, name));
}

代码示例来源:origin: geotools/geotools

/**
 * Returns the operation descriptor for the specified JAI operation name. This method uses the
 * default {@link JAI} instance and looks for the {@value #RENDERED_MODE} mode.
 *
 * @param name The operation name.
 * @return The operation descriptor for the given name.
 * @throws OperationNotFoundException if no JAI descriptor was found for the given name.
 * @since 2.4
 */
protected static OperationDescriptor getOperationDescriptor(final String name)
    throws OperationNotFoundException {
  final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
  OperationDescriptor operation =
      (OperationDescriptor) registry.getDescriptor(RENDERED_MODE, name);
  if (operation != null) {
    return operation;
  }
  throw new OperationNotFoundException(Errors.format(ErrorKeys.OPERATION_NOT_FOUND_$1, name));
}

代码示例来源:origin: geotools/geotools

JAI.KEY_TILE_CACHE, JAI.getDefaultInstance().getTileCache());
if (operation != null) {
  worker.getClass()

代码示例来源:origin: geotools/geotools

setTileCache(tc);
} else {
  setTileCache(JAI.getDefaultInstance().getTileCache());

代码示例来源:origin: org.geotools/gt-coverage

/**
 * Gets the JAI instance to use from the rendering hints.
 */
private static JAI getJAI(final Hints hints) {
  if (hints != null) {
    final Object property = hints.get(Hints.JAI_INSTANCE);
    if (property instanceof JAI) {
      return (JAI) property;
    }
  }
  return JAI.getDefaultInstance();
}

代码示例来源:origin: geotools/geotools

final JAI jai = JAI.getDefaultInstance();
TileFactory tileFactory = (TileFactory) jai.getRenderingHint(JAI.KEY_TILE_FACTORY);
if (tileFactory == null) {

代码示例来源:origin: geotools/geotools

private RenderedImage mosaicHeterogeneousImages(List<ImageInTile> sources) {
  // at the time of writing, only JAI-EXT mosaic can handle a mix of different
  // color models, we need to use it explicitly
  RenderedImage image;
  final ParameterBlockJAI pb =
      new ParameterBlockJAI(new it.geosolutions.jaiext.mosaic.MosaicDescriptor());
  for (ImageInTile it : sources) {
    if (it.posx != 0 || it.posy != 0) {
      ImageWorker iw = new ImageWorker(it.image);
      iw.translate(
          it.posx, it.posy, Interpolation.getInstance(Interpolation.INTERP_NEAREST));
      RenderedImage translated = iw.getRenderedImage();
      pb.addSource(translated);
    } else {
      pb.addSource(it.image);
    }
  }
  pb.setParameter("mosaicType", MosaicDescriptor.MOSAIC_TYPE_OVERLAY);
  pb.setParameter("sourceAlpha", null);
  pb.setParameter("sourceROI", null);
  pb.setParameter("sourceThreshold", null);
  pb.setParameter("backgroundValues", new double[] {0});
  pb.setParameter("nodata", null);
  RenderingHints hints = new Hints(JAI.getDefaultInstance().getRenderingHints());
  hints.putAll(GeoTools.getDefaultHints());
  image = new MosaicRIF().create(pb, hints);
  return image;
}

代码示例来源:origin: geotools/geotools

final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
final OperationDescriptor operation =
    (OperationDescriptor)

代码示例来源:origin: locationtech/geowave

public static synchronized void register(final boolean force) {
 if (!registered || force) {
  final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
  final RenderedImageFactory rif = new WarpRIF();
  registry.registerFactory(
    RenderedRegistryMode.MODE_NAME,
    "Warp",
    "it.geosolutions.jaiext",
    rif);
  registered = true;
 }
}

代码示例来源:origin: geotools/geotools

final ImagingParameterDescriptors parameters;
descriptor =
    JAI.getDefaultInstance().getOperationRegistry().getDescriptor(mode, "AddConst");
parameters = new ImagingParameterDescriptors(descriptor);
final GenericName alias = parameters.getAlias().iterator().next();

相关文章