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


Java RGBImageProfileManager类代码示例

本文整理汇总了Java中org.esa.snap.core.datamodel.RGBImageProfileManager的典型用法代码示例。如果您正苦于以下问题:Java RGBImageProfileManager类的具体用法?Java RGBImageProfileManager怎么用?Java RGBImageProfileManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RGBImageProfileManager类属于org.esa.snap.core.datamodel包,在下文中一共展示了RGBImageProfileManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installRgbProfiles

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
public static void installRgbProfiles(String productType, String redExpr, String greenExpr, String blueExpr) {
    RGBImageProfileManager profileManager = RGBImageProfileManager.getInstance();
    RGBImageProfile[] allProfiles = profileManager.getAllProfiles();
    for (String bandName : RGB_BAND_NAMES) {
        String profileName = productType + " " + bandName;
        Stream<RGBImageProfile> profileStream = Arrays.stream(allProfiles);
        boolean profileExists = profileStream.anyMatch(rgbImageProfile -> rgbImageProfile.getName().equals(profileName));
        if (!profileExists) {
            String[] rgbaExpressions = {
                    String.format(redExpr, bandName),
                    String.format(greenExpr, bandName),
                    String.format(blueExpr, bandName)};
            String[] pattern = {productType, "", ""};
            profileManager.addProfile(new RGBImageProfile(profileName, rgbaExpressions, pattern));
        }
    }
}
 
开发者ID:bcdev,项目名称:s3tbx-c2rcc,代码行数:18,代码来源:RgbProfiles.java

示例2: S2OrthoProductReaderPlugIn

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
public S2OrthoProductReaderPlugIn() {
    RGBImageProfileManager manager = RGBImageProfileManager.getInstance();
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Natural Colors", new String[]{"B4", "B3", "B2"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI False-color Infrared", new String[]{"B8", "B4", "B3"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI False-color Urban", new String[]{"B12", "B11", "B4"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Agriculture", new String[]{"B11", "B8", "B2"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Atmospheric penetration", new String[]{"B12", "B11", "B8A"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Healthy Vegetation", new String[]{"B8", "B11", "B2"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Land/Water", new String[]{"B8", "B11", "B4"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Natural with Atmospherical Removal", new String[]{"B12", "B8", "B3"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Shortwave Infrared", new String[]{"B12", "B8", "B4"}));
    manager.addProfile(new RGBImageProfile("Sentinel 2 MSI Vegetation Analysis", new String[]{"B11", "B8", "B4"}));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:14,代码来源:S2OrthoProductReaderPlugIn.java

示例3: performSaveAs

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
private void performSaveAs() {
    File file = promptForSaveFile();
    if (file == null) {
        return;
    }
    String[] rgbaExpressions = getRgbaExpressions();
    Set<Integer> productRefs = new HashSet<>();
    for (String expression : rgbaExpressions) {
        if (!StringUtils.isNullOrEmpty(expression)) {
            if (expression.startsWith("$")) {
                productRefs.add(Integer.parseInt(expression.substring(1, expression.indexOf('.'))));
            } else {
                productRefs.add(0);
            }
        }
    }
    boolean shouldReplace = productRefs.size() == 1 && !productRefs.contains(0);
    for (int i = 0; i < rgbaExpressions.length; i++) {
        if (shouldReplace) {
            rgbaExpressions[i] = rgbaExpressions[i].replace(BandArithmetic.getProductNodeNamePrefix(this.product), "");
        }
    }
    RGBImageProfile profile = new RGBImageProfile(FileUtils.getFilenameWithoutExtension(file),
                                                  rgbaExpressions);
    try {
        profile.store(file);
    } catch (IOException e) {
        AbstractDialog.showErrorDialog(this,
                                       "Failed to save RGB-profile '" + file.getName() + "':\n"
                                               + e.getMessage(),
                                       "Open RGB-Image Profile");
        return;
    }

    RGBImageProfileManager.getInstance().addProfile(profile);
    addNewProfile(profile);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:38,代码来源:RGBImageProfilePane.java

示例4: getProfilesDir

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
private File getProfilesDir() {
    if (lastDir != null) {
        return lastDir;
    } else {
        return RGBImageProfileManager.getProfilesDir();
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:8,代码来源:RGBImageProfilePane.java

示例5: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("RapidEye L3", new String[] { "red", "green", "blue" }));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:RapidEyeL3ReaderPlugin.java

示例6: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("RapidEye L1", new String[] { "red", "green", "blue" }));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:RapidEyeL1ReaderPlugin.java

示例7: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("Pleaides", Constants.RGB_PROFILE));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:PleiadesProductReaderPlugin.java

示例8: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("DEIMOS-1", new String[] { "Red", "Green", "NIR" }));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:DeimosProductReaderPlugin.java

示例9: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("SPOT", new String[] { "XS1", "XS2", "XS3" }));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:SpotTake5ProductReaderPlugin.java

示例10: registerRGBProfile

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
@Override
protected void registerRGBProfile() {
    RGBImageProfileManager.getInstance().addProfile(new RGBImageProfile("SPOT 6/7", Spot6Constants.SPOT6_RGB_PROFILE));
}
 
开发者ID:senbox-org,项目名称:s2tbx,代码行数:5,代码来源:Spot6ProductReaderPlugin.java

示例11: performOpen

import org.esa.snap.core.datamodel.RGBImageProfileManager; //导入依赖的package包/类
private void performOpen() {
    final SnapFileChooser snapFileChooser = new SnapFileChooser(getProfilesDir());
    snapFileChooser.setFileFilter(
            new SnapFileFilter("RGB-PROFILE", RGBImageProfile.FILENAME_EXTENSION, "RGB-Image Profile Files"));
    final int status = snapFileChooser.showOpenDialog(this);
    if (snapFileChooser.getSelectedFile() == null) {
        return;
    }
    final File file = snapFileChooser.getSelectedFile();
    lastDir = file.getParentFile();
    if (status != SnapFileChooser.APPROVE_OPTION) {
        return;
    }

    final RGBImageProfile profile;
    try {
        profile = RGBImageProfile.loadProfile(file);
        String[] rgbaExpressions = profile.getRgbaExpressions();
        // If profile was saved with a single product index reference, it may not match the current product index,
        // so try to replace it. If it contains multiple indices, then keep them.
        Set<Integer> productRefs = new HashSet<>();
        for (String expression : rgbaExpressions) {
            if (!StringUtils.isNullOrEmpty(expression)) {
                if (expression.startsWith("$")) {
                    productRefs.add(Integer.parseInt(expression.substring(1, expression.indexOf('.'))));
                } else {
                    productRefs.add(0);
                }
            }
        }
        boolean shouldReplace = productRefs.size() == 1 && !productRefs.contains(0);
        for (int i = 0; i < rgbaExpressions.length; i++) {
            if (shouldReplace) {
                if (!StringUtils.isNullOrEmpty(rgbaExpressions[i])) {
                    rgbaExpressions[i] = rgbaExpressions[i].substring(rgbaExpressions[i].indexOf('.') + 1);
                }
            }
        }
        profile.setRgbaExpressions(rgbaExpressions);
    } catch (IOException e) {
        AbstractDialog.showErrorDialog(this,
                                       String.format("Failed to open RGB-profile '%s':\n%s", file.getName(), e.getMessage()),
                                       "Open RGB-Image Profile");
        return;
    }
    if (profile == null) {
        AbstractDialog.showErrorDialog(this,
                                       String.format("Invalid RGB-Profile '%s'.", file.getName()),
                                       "Open RGB-Image Profile");
        return;
    }

    RGBImageProfileManager.getInstance().addProfile(profile);
    if (product != null && !profile.isApplicableTo(product)) {
        AbstractDialog.showErrorDialog(this,
                                       String.format("The selected RGB-Profile '%s'\nis not applicable to the current product.",
                                                     profile.getName()),
                                       "Open RGB-Image Profile");
        return;
    }
    addNewProfile(profile);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:63,代码来源:RGBImageProfilePane.java


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