当前位置 : 主页 > 网络编程 > 其它编程 >

com.bc.ceres.glevel.MultiLevelModel类的使用及代码示例

来源:互联网 收集:自由互联 发布时间:2023-07-02
本文整理了Java中com.bc.ceres.glevel.MultiLevelModel类的一些代码示例,展示了MultiLevelModel 本文整理了Java中com.bc.ceres.glevel.MultiLevelModel类的一些代码示例,展示了MultiLevelModel类的具体用法。这些
本文整理了Java中com.bc.ceres.glevel.MultiLevelModel类的一些代码示例,展示了MultiLevelModel

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

MultiLevelModel介绍

暂无

代码示例

代码示例来源:origin: senbox-org/s2tbx

private int getSourceLevel(MultiLevelModel sourceModel, int targetLevel) { int maxSourceLevel = sourceModel.getLevelCount() - 1; return maxSourceLevel 代码示例来源:origin: bcdev/beam

private double readEnergy(Placemark pin, Band spectralBand) { final MultiLevelModel multiLevelModel = ImageManager.getMultiLevelModel(spectralBand); final AffineTransform i2mTransform = multiLevelModel.getImageToModelTransform(0); final AffineTransform m2iTransform = multiLevelModel.getModelToImageTransform(level); final Point2D modelPixel = i2mTransform.transform(pin.getPixelPos(), null); final Point2D imagePixel = m2iTransform.transform(modelPixel, null); int pinPixelX = (int) Math.floor(imagePixel.getX()); int pinPixelY = (int) Math.floor(imagePixel.getY()); return ProductUtils.getGeophysicalSampleDouble(spectralBand, pinPixelX, pinPixelY, level);}

代码示例来源:origin: bcdev/beam

private MultiLevelImage getMultiLevelImageSourceImage(final Band band, final int bandIndex) throws IOException { MultiLevelModel model = ImageManager.getMultiLevelModel(band); Assert.state(model.getLevelCount() == 1 || model.getScale(1) == 2.0);

代码示例来源:origin: senbox-org/s2tbx

public static RenderedImage adjustImageToModelTransform(final MultiLevelImage image, MultiLevelModel model) { MultiLevelModel actualModel = model; if (model.getLevelCount() > image.getModel().getLevelCount()) { actualModel = new DefaultMultiLevelModel(image.getModel().getLevelCount(), model.getImageToModelTransform(0), image.getWidth(), image.getHeight()); } final AbstractMultiLevelSource source = new AbstractMultiLevelSource(actualModel) { @Override protected RenderedImage createImage(int level) { return image.getImage(level); } }; return new DefaultMultiLevelImage(source);}

代码示例来源:origin: bcdev/beam

private void testThat(MultiLevelImage image1, MultiLevelImage image2) { assertNotNull(image1); assertNotNull(image2); MultiLevelModel model1 = image1.getModel(); MultiLevelModel model2 = image2.getModel(); assertEquals(model1.getLevelCount(), model2.getLevelCount()); assertEquals(model1.getModelBounds(), model2.getModelBounds()); assertEquals(model1.getImageToModelTransform(0), model2.getImageToModelTransform(0)); if (model1.getLevelCount() > 1) { assertEquals(model1.getImageToModelTransform(1), model2.getImageToModelTransform(1)); } if (model1.getLevelCount() > 2) { assertEquals(model1.getImageToModelTransform(2), model2.getImageToModelTransform(2)); }}

代码示例来源:origin: bcdev/beam

private AffineTransform getImageToModelTransform() { return bandImageMultiLevelSource.getModel().getImageToModelTransform(0);}

代码示例来源:origin: senbox-org/s2tbx

@Overridepublic RenderedImage createImage(int targetLevel) { final double targetScale = targetModel.getScale(targetLevel); final int sourceLevel = sourceImage.getModel().getLevel(targetScale); RenderedImage leveledSourceImage = sourceImage.getImage(sourceLevel); final AffineTransform i2mSource = sourceModel.getImageToModelTransform(sourceLevel); i2mSource.concatenate(sourceModel.getModelToImageTransform(0)); i2mSource.concatenate(sourceImageToMapTransform); ImageGeometry sourceGeometry = new ImageGeometry(sourceBounds, final AffineTransform i2mTarget = getModel().getImageToModelTransform(targetLevel); i2mTarget.concatenate(getModel().getModelToImageTransform(0)); i2mTarget.concatenate(targetImageToMapTransform);

代码示例来源:origin: bcdev/beam

@Overridepublic Shape getImageShape(int level) { VectorDataNode vectorDataNode = vectorDataReference.get(); if (vectorDataNode != null) { ReferencedEnvelope envelope = vectorDataNode.getEnvelope(); if (!envelope.isEmpty()) { Rectangle2D modelBounds = new Rectangle2D.Double(envelope.getMinX(), envelope.getMinY(), envelope.getWidth(), envelope.getHeight()); AffineTransform m2i = getModel().getModelToImageTransform(level); return m2i.createTransformedShape(modelBounds); } } return null;}

代码示例来源:origin: bcdev/beam

Rectangle expectedImageBounds = getModel().getModelToImageTransform(level).createTransformedShape(getModel().getModelBounds()).getBounds();if (bandImage.getWidth() 代码示例来源:origin: bcdev/beam

public static ResolutionLevel create(MultiLevelModel model, int level) { return new ResolutionLevel(level, model.getScale(level));}

代码示例来源:origin: bcdev/beam

@Overrideprotected Rectangle2D getLayerModelBounds() { return getBaseMultiLevelSource().getModel().getModelBounds();}

代码示例来源:origin: senbox-org/snap-desktop

private AffineTransform getImageToModelTransform() { return coloredBandImageMultiLevelSource.getModel().getImageToModelTransform(0);}

代码示例来源:origin: bcdev/beam

final int levelCount = image.getModel().getLevelCount();final Properties imageProperties = new Properties();imageProperties.setProperty("numLevels", image.getModel().getLevelCount() + "");imageProperties.setProperty("width", image.getWidth() + "");imageProperties.setProperty("height", image.getHeight() + "");final double[] flatmatrix = new double[6];image.getModel().getImageToModelTransform(0).getMatrix(flatmatrix);imageProperties.setProperty("i2mTransform", flatmatrix[0] + "," + flatmatrix[1]

代码示例来源:origin: senbox-org/snap-desktop

private double readEnergy(Placemark pin, Band spectralBand) { //todo [Multisize_products] use scenerastertransform here final Object pinGeometry = pin.getFeature().getDefaultGeometry(); if (pinGeometry == null || !(pinGeometry instanceof Point)) { return spectralBand.getGeophysicalNoDataValue(); } final Point2D.Double modelPoint = new Point2D.Double(((Point) pinGeometry).getCoordinate().x, ((Point) pinGeometry).getCoordinate().y); final MultiLevelModel multiLevelModel = spectralBand.getMultiLevelModel(); int level = getLevel(multiLevelModel); final AffineTransform m2iTransform = multiLevelModel.getModelToImageTransform(level); final PixelPos pinLevelRasterPos = new PixelPos(); m2iTransform.transform(modelPoint, pinLevelRasterPos); int pinLevelRasterX = (int) Math.floor(pinLevelRasterPos.getX()); int pinLevelRasterY = (int) Math.floor(pinLevelRasterPos.getY()); if (coordinatesAreInRasterBounds(spectralBand, pinLevelRasterX, pinLevelRasterY, level) } return spectralBand.getGeophysicalNoDataValue();}

代码示例来源:origin: senbox-org/s2tbx

protected PlanarImage createConstantTileImage(String tileId, int level) { S2IndexBandInformation indexBandInformation = (S2IndexBandInformation) tileBandInfo.getBandInformation(); IndexCoding indexCoding = indexBandInformation.getIndexCoding(); Integer indexValue = indexCoding.getIndexValue(S2L1BGranuleDirFilename.create(tileId).getTileID()); short indexValueShort = indexValue.shortValue(); Rectangle tileRectangleL0 = new Rectangle(); tileRectangleL0.height = tileBandInfo.getImageLayout().height; tileRectangleL0.width = tileBandInfo.getImageLayout().width; sceneDescription.getTileRectangle(sceneDescription.getTileIndex(tileId)); Rectangle tileRectangle = DefaultMultiLevelSource.getLevelImageBounds(tileRectangleL0, getModel().getScale(level)); PlanarImage planarImage = ConstantDescriptor.create((float) tileRectangle.width, (float) tileRectangle.height, new Short[]{indexValueShort}, null); return planarImage;}

代码示例来源:origin: bcdev/beam

private int getSourceLevel(MultiLevelModel srcModel, int targetLevel) { int maxSourceLevel = srcModel.getLevelCount() - 1; return maxSourceLevel 代码示例来源:origin: senbox-org/snap-desktop

public void readValues() { Debug.assertNotNull(bands); for (int i = 0; i 代码示例来源:origin: senbox-org/s2tbx

private double computeStepX(Product product){ OptionalDouble result = Arrays.stream(product.getBands()) .mapToDouble(band -> Math.abs(band.getSourceImage().getModel().getImageToModelTransform(0).getScaleX())) .min(); if (result.isPresent()) { return result.getAsDouble(); } else { return this.pixelSizeX; }}

代码示例来源:origin: senbox-org/snap-desktop

private String getPixelString(RasterDataNode raster) { if (raster.getImageToModelTransform().equals(currentRaster.getImageToModelTransform()) } return getPixelString(raster, pixelX, pixelY, rasterLevel); } final Point2D.Double scenePos = new Point2D.Double(sceneX, sceneY); Point2D.Double modelPos = new Point2D.Double(); try { raster.getSceneToModelTransform().transform(scenePos, modelPos); if (Double.isNaN(modelPos.getX()) || Double.isNaN(modelPos.getY())) { return PixelInfoViewModelUpdater.INVALID_POS_TEXT; } } catch (TransformException e) { return PixelInfoViewModelUpdater.INVALID_POS_TEXT; } final MultiLevelModel multiLevelModel = raster.getMultiLevelModel(); final int level = getLevel(multiLevelModel); final PixelPos rasterPos = (PixelPos) multiLevelModel.getModelToImageTransform(level).transform(modelPos, new PixelPos()); final int rasterX = floor(rasterPos.getX()); final int rasterY = floor(rasterPos.getY()); if (!coordinatesAreInRasterBounds(raster, rasterX, rasterY, level)) { return RasterDataNode.INVALID_POS_TEXT; } return getPixelString(raster, rasterX, rasterY, level);}

代码示例来源:origin: senbox-org/s2tbx

@Override public MultiLevelImage createSourceImage(BandInfo bandInfo) { BandL1cSceneMultiLevelSource bandScene = new BandL1cSceneMultiLevelSource(sceneDescription, bandInfo, imageToModelTransform); SystemUtils.LOG.fine("BandScene: " + bandScene); // Get dimension at level 0 S2SpatialResolution bandNativeResolution = bandInfo.getBandInformation().getResolution(); Dimension bandDimensionLevel0 = sceneDescription.getSceneDimension(bandNativeResolution); // Compute dimension at level 'level' according to "J2K rule" Rectangle bandRectangle = DefaultMultiLevelSource.getLevelImageBounds( new Rectangle(bandDimensionLevel0.width, bandDimensionLevel0.height), bandScene.getModel().getScale(0)); int[] bandOffsets = {0}; int dataType = DataBuffer.TYPE_SHORT; if(bandInfo.getImageLayout().dataType != 0) { dataType = bandInfo.getImageLayout().dataType; } SampleModel sampleModel = ImageUtils.createSingleBandedSampleModel(dataType, bandRectangle.width, bandRectangle.height); ImageLayout layout = new ImageLayout(0, 0,bandRectangle.width, bandRectangle.height, 0, 0, S2Config.DEFAULT_JAI_TILE_SIZE, S2Config.DEFAULT_JAI_TILE_SIZE, sampleModel,/*colorModel*/null); return new DefaultMultiLevelImage(bandScene,layout); }}

上一篇:LuoguP1640[SCOI2010]连续攻击游戏
下一篇:没有了
网友评论