当前位置: 首页>>代码示例>>Java>>正文


Java Interpolation.getInstance方法代码示例

本文整理汇总了Java中javax.media.jai.Interpolation.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Interpolation.getInstance方法的具体用法?Java Interpolation.getInstance怎么用?Java Interpolation.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.media.jai.Interpolation的用法示例。


在下文中一共展示了Interpolation.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInterpolation

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
private static Interpolation getInterpolation(int _interpolation){
	
	Interpolation interpolation = null;
	switch (_interpolation) {
	case 0:
		interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
		break;
	case 1:
		interpolation = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
		break;
	case 2:
		interpolation = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
		break;
	default:
		interpolation = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
	}
	return interpolation;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:JaiInterpolate.java

示例2: create

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
/**
 * Wrap the src coverage in the dst layout. <BR>
 * The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,
 * 
 * @param src the data coverage to be remapped on dst grid
 * @param dst the provider of the final grid
 * @param nodata the nodata value to set for cells not covered by src but included in dst. All bands will share the same nodata value.
 * @return an instance of Coverage2RenderedImageAdapter
 */
public static GridCoverage2DRIA create(final GridCoverage2D src, final GridCoverage2D dst,
        final double nodata) {

    // === Create Layout
    final ImageLayout imageLayout = new ImageLayout(dst.getRenderedImage());

    //
    // SampleModel and ColorModel are related to data itself, so we
    // copy them from the source

    imageLayout.setColorModel(src.getRenderedImage().getColorModel());
    imageLayout.setSampleModel(src.getRenderedImage().getSampleModel());

    // === BorderExtender
    //
    // We have yet to check for it usefulness: it might be more convenient
    // to check for region overlapping and return a nodata value by hand,
    // so to avoid problems with interpolation at source raster borders.
    //
    BorderExtender extender = new BorderExtenderConstant(new double[] { nodata });

    return new GridCoverage2DRIA(src, dst, vectorize(src.getRenderedImage()), imageLayout,
            null, false, extender, Interpolation.getInstance(Interpolation.INTERP_NEAREST),
            new double[] { nodata });
}
 
开发者ID:geosolutions-it,项目名称:soil_sealing,代码行数:35,代码来源:GridCoverage2DRIA.java

示例3: process

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
@SuppressWarnings("nls")
@Execute
public void process() throws Exception {
    checkNull(inGeodata, pXres);
    if (pYres == null) {
        pYres = pXres;
    }
    JGTProcessingRegion region = new JGTProcessingRegion(inGeodata);
    region.setWEResolution(pXres);
    region.setNSResolution(pYres);

    GridGeometry2D newGridGeometry = region.getGridGeometry(inGeodata.getCoordinateReferenceSystem());

    Interpolation interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
    if (pInterpolation.equals(BILINEAR)) {
        interpolation = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
    } else if (pInterpolation.equals(BICUBIC)) {
        interpolation = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
    }

    pm.beginTask("Resampling...", IHMProgressMonitor.UNKNOWN);
    outGeodata = (GridCoverage2D) Operations.DEFAULT.resample(inGeodata, inGeodata.getCoordinateReferenceSystem(),
            newGridGeometry, interpolation);
    pm.done();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:26,代码来源:OmsRasterResolutionResampler.java

示例4: doInBackground

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
@Override
protected Image doInBackground() throws Exception {
    RenderedImage sourceImage = FileLoadDescriptor.create(imageFilePath, null, true, null);
    int width = sourceImage.getWidth();
    int height = sourceImage.getHeight();

    float scale = (float) (targetDimension.getWidth() / width);
    scale = (float) Math.min(scale, targetDimension.getHeight() / height);
    if (scale > 1) {
        scale = 1.0f;
    }

    Interpolation interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
    RenderedImage scaledImage = ScaleDescriptor.create(sourceImage,
                                                       scale, scale,
                                                       0.0f, 0.0f,
                                                       interpolation, null);
    PlanarImage planarImage = PlanarImage.wrapRenderedImage(scaledImage);
    BufferedImage bufferedImage = planarImage.getAsBufferedImage();
    planarImage.dispose();
    return bufferedImage;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:23,代码来源:ImageFileAssistantPage1.java

示例5: getResampling

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
private Interpolation getResampling(Band band) {
    int resampleType = getResampleType();
    if (!ProductData.isFloatingPointType(band.getDataType())) {
        resampleType = Interpolation.INTERP_NEAREST;
    }
    return Interpolation.getInstance(resampleType);
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:8,代码来源:S2tbxReprojectionOp.java

示例6: createMultiLevelImage

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public static MultiLevelImage createMultiLevelImage(float[] data, int width, int height, AffineTransform affineTransform) {
    //create a planarImage with the data
    PlanarImage planarImage = createFloatPlanarImage(data, width, height);
    //create multi-level model
    DefaultMultiLevelModel multiLevelModel = new DefaultMultiLevelModel(affineTransform, width, height);
    //create multi-level source
    DefaultMultiLevelSource multiLevelSource= new DefaultMultiLevelSource(planarImage, multiLevelModel, Interpolation.getInstance(Interpolation.INTERP_NEAREST));
    //create multi-level image
    MultiLevelImage multiLevelImage = new DefaultMultiLevelImage(multiLevelSource);
    return multiLevelImage;
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:12,代码来源:S2ResamplerUtils.java

示例7: RasterDataset

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
/** */
public RasterDataset (GridDimensions dimensions, WritableRaster raster) {
    super("RASTER");
    _dimensions = dimensions;
    _raster = raster;
    _interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
    _interpArray = new double[_interpolation.getHeight()][_interpolation.getWidth()];
    GISExtension.getState().datasetLoadNotify();
}
 
开发者ID:reuven,项目名称:modelingcommons,代码行数:10,代码来源:RasterDataset.java

示例8: getInterpolationOverride

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public Interpolation getInterpolationOverride() {
	if (!isInterpolationOverrideSet()) {
		throw new IllegalStateException(
				"Interpolation Override is not set for this config");
	}

	return Interpolation.getInstance(interpolationOverride);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:9,代码来源:GeoWaveRasterConfig.java

示例9: setQuality

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public void setQuality(int qual) {
	quality = qual;
	// setup interpolation quality
	if (qual > 1) {
		logger.debug("quality q2");
		interpol = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
	} else if (qual == 1) {
		logger.debug("quality q1");
		interpol = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
	} else {
		logger.debug("quality q0");
		interpol = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
	}
}
 
开发者ID:robcast,项目名称:digilib,代码行数:15,代码来源:JAIDocuImage.java

示例10: getInterpolation

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public static Interpolation getInterpolation(String interpolationString) {
    int interpolation = getInterpolationType(interpolationString);
    return Interpolation.getInstance(interpolation);
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:S2ResamplerUtils.java

示例11: replaceBandSourceImage

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public static void replaceBandSourceImage(Band originalBand, PlanarImage planarImage) {
    MultiLevelImage newMultiLevelImage = new DefaultMultiLevelImage(new DefaultMultiLevelSource(planarImage, originalBand.getMultiLevelModel(), Interpolation.getInstance(Interpolation.INTERP_NEAREST)));
    originalBand.setSourceImage(S2ResamplerUtils.adjustImageToModelTransform(newMultiLevelImage, originalBand.getMultiLevelModel()));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:S2ResamplerUtils.java

示例12: getProperty

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
/**
 * Returns the specified property.
 *
 * @param name  Property name.
 * @param opNode Operation node.
 */
public Object getProperty(String name,
                          Object opNode) {
    validate(name, opNode);

    if(opNode instanceof RenderedOp &&
       name.equalsIgnoreCase("roi")) {
        RenderedOp op = (RenderedOp)opNode;

        ParameterBlock pb = op.getParameterBlock();

        // Retrieve the rendered source image and its ROI.
        PlanarImage src = (PlanarImage)pb.getRenderedSource(0);
        Object property = src.getProperty("ROI");
        if (property == null ||
            property.equals(java.awt.Image.UndefinedProperty) ||
            !(property instanceof ROI)) {
            return java.awt.Image.UndefinedProperty;
        }

        // Return undefined also if source ROI is empty.
        ROI srcROI = (ROI)property;
        if (srcROI.getBounds().isEmpty()) {
            return java.awt.Image.UndefinedProperty;
        }

        /// This should really create a proper AffineTransform
        /// and transform the ROI with it to avoid forcing
        /// ROI.getAsImage to be called.

        // Retrieve the transpose type and create a nearest neighbor
        // Interpolation object.
        TransposeType transposeType =
            (TransposeType)pb.getObjectParameter(0);
        Interpolation interp =
            Interpolation.getInstance(Interpolation.INTERP_NEAREST);

        // Return the transposed ROI.
        return new ROI(JAI.create("transpose", srcROI.getAsImage(),
                                  transposeType));
    }

    return java.awt.Image.UndefinedProperty;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:50,代码来源:TransposeDescriptor.java

示例13: setInterpolation

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
/** */
public void setInterpolation (int interpolationType) {
    _interpolation = Interpolation.getInstance(interpolationType);
    _interpArray = new double[_interpolation.getHeight()][_interpolation.getWidth()];
}
 
开发者ID:reuven,项目名称:modelingcommons,代码行数:6,代码来源:RasterDataset.java

示例14: getInterpolation

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public Interpolation getInterpolation() {
    return Interpolation.getInstance(Interpolation.INTERP_NEAREST);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:4,代码来源:GrassLegacyGridCoverage2D.java

示例15: RasterDataAdapter

import javax.media.jai.Interpolation; //导入方法依赖的package包/类
public RasterDataAdapter(
		final String coverageName,
		final SampleModel sampleModel,
		final ColorModel colorModel,
		final Map<String, String> metadata,
		final int tileSize,
		final double[] minsPerBand,
		final double[] maxesPerBand,
		final String[] namesPerBand,
		final double[][] noDataValuesPerBand,
		final double[] backgroundValuesPerBand,
		final HistogramConfig histogramConfig,
		final boolean equalizeHistogram,
		final int interpolationType,
		final boolean buildPyramid,
		final RasterTileMergeStrategy<?> mergeStrategy ) {
	staticInit();

	this.coverageName = coverageName;
	this.tileSize = tileSize;
	this.sampleModel = sampleModel;
	this.colorModel = colorModel;
	this.metadata = metadata;
	this.minsPerBand = minsPerBand;
	this.maxesPerBand = maxesPerBand;
	this.namesPerBand = namesPerBand;
	this.noDataValuesPerBand = noDataValuesPerBand;
	this.backgroundValuesPerBand = backgroundValuesPerBand;
	// a null histogram config will result in histogram statistics not being
	// accumulated
	this.histogramConfig = histogramConfig;
	this.buildPyramid = buildPyramid;
	this.equalizeHistogram = equalizeHistogram;
	interpolation = Interpolation.getInstance(interpolationType);
	if (mergeStrategy != null) {
		this.mergeStrategy = new RootMergeStrategy(
				getAdapterId(),
				sampleModel.createCompatibleSampleModel(
						tileSize,
						tileSize),
				mergeStrategy);
	}
	else {
		this.mergeStrategy = null;
	}
	init();
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:48,代码来源:RasterDataAdapter.java


注:本文中的javax.media.jai.Interpolation.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。