final Category category = categories[i]; ColorUtilities.expand( category.getColors(), ARGB, (int) Math.round(category.minimum),
/** * Returns the quantitative category for a single {@linkplain GridSampleDimension sample * dimension} in the target {@linkplain GridCoverage2D grid coverage}. This method is invoked * automatically by the {@link #deriveSampleDimension deriveSampleDimension} method for each * band in the target image. The default implementation creates a default category from the * target range of values returned by {@link #deriveRange deriveRange}. * * @param categories The quantitative categories from every sources. For unary operations like, * this array has a length of 1. For binary operations like {@code "add"} and {@code * "multiply"}, this array has a length of 2. * @param parameters Parameters, rendering hints and coordinate reference system to use. * @return The quantitative category to use in the destination image, or {@code null} if * unknown. */ protected Category deriveCategory(final Category[] categories, final Parameters parameters) { final NumberRange[] ranges = new NumberRange[categories.length]; for (int i = 0; i < ranges.length; i++) { if (categories[i] == null) { continue; } ranges[i] = categories[i].getRange(); } final NumberRange range = deriveRange(ranges, parameters); if (range != null) { final Category category = categories[PRIMARY_SOURCE_INDEX]; return new Category(category.getName(), category.getColors(), range, true); } return null; }
/** * Returns the set of colors for this category. */ @Override public Color[] getColors() { assert !(inverse instanceof GeophysicsCategory); return inverse.getColors(); }
/** * Returns the set of colors for this category. */ public Color[] getColors() { assert !(inverse instanceof GeophysicsCategory); return inverse.getColors(); }
if (!rangeContains(xmin, xmax, nodata)) { final InternationalString name = category.getName(); final Color[] colors = category.getColors(); category = new Category(name, colors, range); categoryList.set(i, category);
ColorUtilities.expand(category.getColors(), ARGB, (int) Math.round(category.minimum), (int) Math.round(category.maximum) + 1);
ColorUtilities.expand(category.getColors(), ARGB, (int)Math.round(category.minimum), (int)Math.round(category.maximum)+1);
/** * Returns the quantitative category for a single {@linkplain GridSampleDimension sample dimension} * in the target {@linkplain GridCoverage2D grid coverage}. This method is invoked automatically * by the {@link #deriveSampleDimension deriveSampleDimension} method for each band in the * target image. The default implementation creates a default category from the target range * of values returned by {@link #deriveRange deriveRange}. * * @param categories The quantitative categories from every sources. For unary operations * like {@code "GradientMagnitude"}, this array has a length of 1. For binary * operations like {@code "add"} and {@code "multiply"}, this array has a length of 2. * @param parameters Parameters, rendering hints and coordinate reference system to use. * @return The quantitative category to use in the destination image, or {@code null} if unknown. */ protected Category deriveCategory(final Category[] categories, final Parameters parameters) { final NumberRange[] ranges = new NumberRange[categories.length]; for (int i=0; i<ranges.length; i++) { ranges[i] = categories[i].getRange(); } final NumberRange range = deriveRange(ranges, parameters); if (range != null) { final Category category = categories[PRIMARY_SOURCE_INDEX]; return new Category(category.getName(), category.getColors(), category.geophysics(false).getRange(), range).geophysics(true); } return null; }
/** * Returns the quantitative category for a single {@linkplain GridSampleDimension sample dimension} * in the target {@linkplain GridCoverage2D grid coverage}. This method is invoked automatically * by the {@link #deriveSampleDimension deriveSampleDimension} method for each band in the * target image. The default implementation creates a default category from the target range * of values returned by {@link #deriveRange deriveRange}. * * @param categories The quantitative categories from every sources. For unary operations * like {@code "GradientMagnitude"}, this array has a length of 1. For binary * operations like {@code "add"} and {@code "multiply"}, this array has a length of 2. * @param parameters Parameters, rendering hints and coordinate reference system to use. * @return The quantitative category to use in the destination image, or {@code null} if unknown. */ protected Category deriveCategory(final Category[] categories, final Parameters parameters) { final NumberRange[] ranges = new NumberRange[categories.length]; for (int i=0; i<ranges.length; i++) { if (categories[i] == null) { continue; } ranges[i] = categories[i].getRange(); } final NumberRange range = deriveRange(ranges, parameters); if (range != null) { final Category category = categories[PRIMARY_SOURCE_INDEX]; return new Category(category.getName(), category.getColors(), category.geophysics(false).getRange(), range).geophysics(true); } return null; }
if (!rangeContains(xmin, xmax, nodata)) { final InternationalString name = category.getName(); final Color[] colors = category.getColors(); category = new Category(name, colors, range, scale, offset); categoryList.set(i, category);
if (!rangeContains(xmin, xmax, nodata)) { final InternationalString name = category.getName(); final Color[] colors = category.getColors(); category = new Category(name, colors, range, scale, offset); categoryList.set(i, category);