本文整理汇总了Java中com.bc.ceres.glevel.MultiLevelModel.getLevelCount方法的典型用法代码示例。如果您正苦于以下问题:Java MultiLevelModel.getLevelCount方法的具体用法?Java MultiLevelModel.getLevelCount怎么用?Java MultiLevelModel.getLevelCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bc.ceres.glevel.MultiLevelModel
的用法示例。
在下文中一共展示了MultiLevelModel.getLevelCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultReprojectionSettingsProvider
import com.bc.ceres.glevel.MultiLevelModel; //导入方法依赖的package包/类
DefaultReprojectionSettingsProvider(ImageGeometry imageGeometry) {
Band firstBand = sourceProduct.getBandGroup().get(0);
MultiLevelModel sourceModel = firstBand.getMultiLevelModel();
MultiLevelModel targetModel = targetProduct.createMultiLevelModel();
Reproject reprojection = new Reproject(targetModel.getLevelCount());
defaultReprojectionSettings = new ReprojectionSettings(null, sourceModel, imageGeometry);
defaultReprojectionSettings.setTargetModel(targetModel);
defaultReprojectionSettings.setReprojection(reprojection);
}
示例2: adjustImageToModelTransform
import com.bc.ceres.glevel.MultiLevelModel; //导入方法依赖的package包/类
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);
}
示例3: reprojectSourceRaster
import com.bc.ceres.glevel.MultiLevelModel; //导入方法依赖的package包/类
private void reprojectSourceRaster(RasterDataNode sourceRaster) {
final ReprojectionSettings reprojectionSettings = reprojectionSettingsProvider.getReprojectionSettings(sourceRaster);
final int targetDataType;
MultiLevelImage sourceImage;
if (sourceRaster.isScalingApplied()) {
targetDataType = sourceRaster.getGeophysicalDataType();
sourceImage = sourceRaster.getGeophysicalImage();
} else {
targetDataType = sourceRaster.getDataType();
sourceImage = sourceRaster.getSourceImage();
}
final Number targetNoDataValue = getTargetNoDataValue(sourceRaster, targetDataType);
final Rectangle imageRect = reprojectionSettings.getImageGeometry().getImageRect();
final Band targetBand = new Band(sourceRaster.getName(), targetDataType, (int) imageRect.getWidth(), (int) imageRect.getHeight());
targetProduct.addBand(targetBand);
targetBand.setLog10Scaled(sourceRaster.isLog10Scaled());
targetBand.setNoDataValue(targetNoDataValue.doubleValue());
targetBand.setNoDataValueUsed(targetBand.getRasterWidth() == targetProduct.getSceneRasterWidth() &&
targetBand.getRasterHeight() == targetProduct.getSceneRasterHeight());
targetBand.setDescription(sourceRaster.getDescription());
targetBand.setUnit(sourceRaster.getUnit());
GeoCoding bandGeoCoding = reprojectionSettings.getGeoCoding();
if (bandGeoCoding != null) {
targetBand.setGeoCoding(bandGeoCoding);
}
GeoCoding sourceGeoCoding = null;
if (orthorectify && sourceRaster.canBeOrthorectified()) {
sourceGeoCoding = createOrthorectifier(sourceRaster);
} else {
sourceGeoCoding = sourceRaster.getGeoCoding();
}
final String exp = sourceRaster.getValidMaskExpression();
if (exp != null) {
sourceImage = createNoDataReplacedImage(sourceRaster, targetNoDataValue);
}
final Interpolation resampling = getResampling(targetBand);
MultiLevelModel targetModel = reprojectionSettings.getTargetModel();
if (targetModel == null) {
targetModel = targetBand.getMultiLevelModel();
reprojectionSettings.setTargetModel(targetModel);
}
Reproject reprojection = reprojectionSettings.getReprojection();
if (reprojection == null) {
reprojection = new Reproject(targetModel.getLevelCount());
reprojectionSettings.setReprojection(reprojection);
}
MultiLevelImage projectedImage = createProjectedImage(sourceGeoCoding, sourceImage, reprojectionSettings.getSourceModel(),
targetBand, resampling, targetModel, reprojection);
if (mustReplaceNaN(sourceRaster, targetDataType, targetNoDataValue.doubleValue())) {
projectedImage = createNaNReplacedImage(projectedImage, targetModel, targetNoDataValue.doubleValue());
}
if (targetBand.isLog10Scaled()) {
projectedImage = createLog10ScaledImage(projectedImage);
}
targetBand.setSourceImage(projectedImage);
/*
* Flag and index codings
*/
if (sourceRaster instanceof Band) {
final Band sourceBand = (Band) sourceRaster;
ProductUtils.copySpectralBandProperties(sourceBand, targetBand);
final FlagCoding sourceFlagCoding = sourceBand.getFlagCoding();
final IndexCoding sourceIndexCoding = sourceBand.getIndexCoding();
if (sourceFlagCoding != null) {
final String flagCodingName = sourceFlagCoding.getName();
final FlagCoding destFlagCoding = targetProduct.getFlagCodingGroup().get(flagCodingName);
targetBand.setSampleCoding(destFlagCoding);
} else if (sourceIndexCoding != null) {
final String indexCodingName = sourceIndexCoding.getName();
final IndexCoding destIndexCoding = targetProduct.getIndexCodingGroup().get(indexCodingName);
targetBand.setSampleCoding(destIndexCoding);
}
}
}
示例4: getSourceLevel
import com.bc.ceres.glevel.MultiLevelModel; //导入方法依赖的package包/类
private int getSourceLevel(MultiLevelModel sourceModel, int targetLevel) {
int maxSourceLevel = sourceModel.getLevelCount() - 1;
return maxSourceLevel < targetLevel ? maxSourceLevel : targetLevel;
}
示例5: getLevel
import com.bc.ceres.glevel.MultiLevelModel; //导入方法依赖的package包/类
private int getLevel(MultiLevelModel multiLevelModel) {
if (rasterLevel < multiLevelModel.getLevelCount()) {
return rasterLevel;
}
return ImageLayer.getLevel(multiLevelModel, currentView.getViewport());
}