This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 3ded3c324fcec6c3375a9c84908dbbd8f4708f75
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Mon Apr 4 20:03:03 2022 +0200

    Be more specific about the transparent pixel.
---
 .../main/java/org/apache/sis/internal/coverage/j2d/Colorizer.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/Colorizer.java
 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/Colorizer.java
index 715c521c2a..ded5287e97 100644
--- 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/Colorizer.java
+++ 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/Colorizer.java
@@ -233,8 +233,8 @@ public final class Colorizer {
                 if (missingNodata && (model == null || 
!ImageUtilities.isIntegerType(model))) {
                     final int count = entries.length;
                     entries = Arrays.copyOf(entries, count + 1);
-                    entries[count] = new 
ColorsForRange(Vocabulary.formatInternational(Vocabulary.Keys.Nodata),
-                                                        
NumberRange.create(Float.class, Float.NaN), null, false);
+                    entries[count] = new ColorsForRange(TRANSPARENT,
+                            NumberRange.create(Float.class, Float.NaN), null, 
false);
                 }
                 // Leave `target` to null. It will be computed by `compact()` 
if needed.
                 this.entries = entries;
@@ -327,7 +327,8 @@ public final class Colorizer {
         final List<Category> categories = target.getCategories();
         final ColorsForRange[] entries = new ColorsForRange[categories.size()];
         for (int i=0; i<entries.length; i++) {
-            entries[i] = new ColorsForRange(categories.get(i), GRAYSCALE);
+            final Category category = categories.get(i);
+            entries[i] = new ColorsForRange(category, category.getName() == 
TRANSPARENT ? GRAYSCALE : colors);
         }
         this.entries = entries;
     }

Reply via email to