This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit b50a2b81cf90b4a4ba9cd9fa1a51739971edca1f Author: Martin Desruisseaux <[email protected]> AuthorDate: Sat Jul 11 15:27:05 2026 +0200 Rename `CoverageBuilder` as `ImageResourceBuilder`. --- .../main/org/apache/sis/storage/geoheif/FromImageIO.java | 2 +- .../main/org/apache/sis/storage/geoheif/Image.java | 2 +- .../main/org/apache/sis/storage/geoheif/ImageModel.java | 6 +++--- .../org/apache/sis/storage/geoheif/ImageResource.java | 4 ++-- .../{CoverageBuilder.java => ImageResourceBuilder.java} | 16 ++++++++-------- .../org/apache/sis/storage/geoheif/ResourceBuilder.java | 12 ++++++------ .../main/org/apache/sis/storage/geoheif/TiledImage.java | 2 +- .../apache/sis/storage/geoheif/UncompressedImage.java | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java index 3b59410b62..c6f319aaf0 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/FromImageIO.java @@ -61,7 +61,7 @@ final class FromImageIO extends Image implements IIOReadWarningListener { * @param name a name that identifies this image, for debugging purpose. * @throws DataStoreException if an error occurred while decoding <abbr>HEIF</abbr> boxes. */ - FromImageIO(CoverageBuilder builder, ByteRanges.Reader locator, final ImageReaderSpi provider, String name) + FromImageIO(ImageResourceBuilder builder, ByteRanges.Reader locator, final ImageReaderSpi provider, String name) throws DataStoreException { super(builder, locator, name); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java index bf91a4b2d5..eb7472b529 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/Image.java @@ -71,7 +71,7 @@ abstract class Image { * @param name a name that identifies this image, for debugging purpose. * @throws DataStoreException if an error occurred while decoding <abbr>HEIF</abbr> boxes. */ - protected Image(final CoverageBuilder builder, final ByteRanges.Reader locator, final String name) + protected Image(final ImageResourceBuilder builder, final ByteRanges.Reader locator, final String name) throws DataStoreException { this.locator = locator; diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageModel.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageModel.java index 02d01cdc35..22475e7a0a 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageModel.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageModel.java @@ -108,7 +108,7 @@ final class ImageModel { final Object[] componentTypes, final byte[] bitsPerChannel, final ComponentPalette palette, - final CoverageBuilder builder) + final ImageResourceBuilder builder) throws DataStoreException { final int nc = (model == null) ? 0 : model.components.length; @@ -278,7 +278,7 @@ final class ImageModel { * @param builder the builder which is creating a grid coverage. * @param type the image specifier from the Image I/O <abbr>API</abbr>. */ - ImageModel(final ImageTypeSpecifier type, final CoverageBuilder builder) { + ImageModel(final ImageTypeSpecifier type, final ImageResourceBuilder builder) { colorModel = type.getColorModel(); sampleModel = type.getSampleModel(); dataType = DataType.forDataBufferType(sampleModel.getDataType()); @@ -295,7 +295,7 @@ final class ImageModel { * @return the sample dimensions. * @throws DataStoreContentException if the sample dimensions cannot be created. */ - final List<SampleDimension> sampleDimensions(final CoverageBuilder builder) throws DataStoreException { + final List<SampleDimension> sampleDimensions(final ImageResourceBuilder builder) throws DataStoreException { SampleDimension[] bands = sampleDimensions; boolean share = true; if (builder.imageIndex != imageIndex) { diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java index 2334217b95..75153f40bd 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResource.java @@ -78,7 +78,7 @@ final class ImageResource extends TiledGridCoverageResource implements StoreReso /** * The metadata, initially in a mutable state. * Modifications may still happen before the metadata is returned to the user. - * These modifications may happen indirectly, for example through the {@link CoverageBuilder} + * These modifications may happen indirectly, for example through the {@link ImageResourceBuilder} * that created this metadata if that builder is still used for creating more resources. * * @see #createMetadata() @@ -135,7 +135,7 @@ final class ImageResource extends TiledGridCoverageResource implements StoreReso * @param image the single tile for the whole image, or {@code null} if {@code tiles} is provided. * @throws DataStoreException if the "grid to <abbr>CRS</abbr>" transform or the sample dimensions cannot be created. */ - ImageResource(final CoverageBuilder builder, Image[] tiles, final Image image) throws DataStoreException { + ImageResource(final ImageResourceBuilder builder, Image[] tiles, final Image image) throws DataStoreException { super(builder.store()); this.store = builder.store(); identifier = builder.name(); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResourceBuilder.java similarity index 98% rename from incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java rename to incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResourceBuilder.java index cd2c285ed7..d1119f4119 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/CoverageBuilder.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ImageResourceBuilder.java @@ -70,7 +70,7 @@ import org.apache.sis.pending.jdk.JDK18; * @author Johann Sorel (Geomatys) * @author Martin Desruisseaux (Geomatys) */ -final class CoverageBuilder implements Emptiable { +final class ImageResourceBuilder implements Emptiable { /** * The resource which is creating a grid coverage. * @@ -188,9 +188,9 @@ final class CoverageBuilder implements Emptiable { /** * The builder used for building tiles, or {@code null} if none. * - * @see #setTileBuilder(CoverageBuilder) + * @see #setTileBuilder(ImageResourceBuilder) */ - private CoverageBuilder tileBuilder; + private ImageResourceBuilder tileBuilder; /** * Creates a new builder with the given properties. @@ -200,10 +200,10 @@ final class CoverageBuilder implements Emptiable { * @param properties source of coverage properties for this coverage item, or {@code null} if none. * @param duplicatedBoxes names of boxes that were duplicated. Used for logging a warning only once per type of box. */ - CoverageBuilder(final ResourceBuilder owner, - final int imageIndex, - final ItemProperties.ForID properties, - final Set<String> duplicatedBoxes) + ImageResourceBuilder(final ResourceBuilder owner, + final int imageIndex, + final ItemProperties.ForID properties, + final Set<String> duplicatedBoxes) { this.owner = owner; this.imageIndex = imageIndex; @@ -420,7 +420,7 @@ final class CoverageBuilder implements Emptiable { * * @param firstBuilder the builder used for building the first tile, or {@code null} if none. */ - final void setTileBuilder(final CoverageBuilder firstBuilder) { + final void setTileBuilder(final ImageResourceBuilder firstBuilder) { if (firstBuilder != null && tileBuilder == null) { tileBuilder = firstBuilder; metadata = firstBuilder.metadata(); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java index e966ab633c..d6eb72b3a3 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/ResourceBuilder.java @@ -133,7 +133,7 @@ final class ResourceBuilder { * Helper objects for building coverages. * The internal state of each builder depends only on the properties in the associated key. */ - private final Map<ItemProperties.ForID, CoverageBuilder> builders; + private final Map<ItemProperties.ForID, ImageResourceBuilder> builders; /** * Names of boxes that were duplicated. @@ -308,7 +308,7 @@ final class ResourceBuilder { * @throws DataStoreException if an error occurred while building a tile. * @return the builder used for building the first tile. */ - private void createTiles(final CoverageBuilder coverage, final SingleItemTypeReference items, final List<Image> addTo) + private void createTiles(final ImageResourceBuilder coverage, final SingleItemTypeReference items, final List<Image> addTo) throws DataStoreException, IOException { switch (items.type()) { @@ -355,10 +355,10 @@ final class ResourceBuilder { * @throws DataStoreContentException if the "grid to <abbr>CRS</abbr>" transform or the sample dimensions cannot be created. * @throws DataStoreException if another error occurred while building the image or resource. */ - private CoverageBuilder createImage(final Integer itemID, final List<ItemInfoEntry> info, final List<Image> addTo) + private ImageResourceBuilder createImage(final Integer itemID, final List<ItemInfoEntry> info, final List<Image> addTo) throws DataStoreException, IOException { - CoverageBuilder firstBuilder = null; + ImageResourceBuilder firstBuilder = null; for (final ItemInfoEntry entry : info) { final String name = entry.itemName(); if (entry.itemProtectionIndex != 0) { @@ -373,8 +373,8 @@ final class ResourceBuilder { imageIndex = (resources != null) ? resources.size() : 0; } final ItemProperties.ForID itemProperties = properties.remove(itemID); - final CoverageBuilder coverage = builders.computeIfAbsent(itemProperties, - (p) -> new CoverageBuilder(this, imageIndex, p, duplicatedBoxes)); + final ImageResourceBuilder coverage = builders.computeIfAbsent(itemProperties, + (p) -> new ImageResourceBuilder(this, imageIndex, p, duplicatedBoxes)); if (coverage.reportUnknownBoxes(name)) { // Warning already logged by `reportUnknownBoxes(…)`. continue; diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/TiledImage.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/TiledImage.java index 85cedd8354..55785105d7 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/TiledImage.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/TiledImage.java @@ -55,7 +55,7 @@ final class TiledImage extends UncompressedImage { * @throws RasterFormatException if the sample model cannot be created. * @throws IOException if an error occurred while reading bytes from the input stream. */ - TiledImage(final CoverageBuilder builder, final ByteRanges.Reader locator, final String name) + TiledImage(final ImageResourceBuilder builder, final ByteRanges.Reader locator, final String name) throws DataStoreException, IOException { super(builder, locator, name); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java index d1d77f30c5..c3338da048 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/geoheif/UncompressedImage.java @@ -49,7 +49,7 @@ import org.apache.sis.storage.isobmff.mpeg.CompressionConfiguration; * image or only part of it (tile, row or pixel).</p> * * <h4>Requirement</h4> - * This class requires that {@link CoverageBuilder#sampleModel()} can build a sample model. + * This class requires that {@link ImageResourceBuilder#sampleModel()} can build a sample model. * In other words, the boxes such as {@code UncompressedFrameConfig} must have been found. * * @author Johann Sorel (Geomatys) @@ -89,7 +89,7 @@ class UncompressedImage extends Image { * @param name a name that identifies this image, for debugging purpose. * @throws DataStoreContentException if the "grid to <abbr>CRS</abbr>" transform or the sample dimensions cannot be created. */ - UncompressedImage(final CoverageBuilder builder, final ByteRanges.Reader locator, final String name) + UncompressedImage(final ImageResourceBuilder builder, final ByteRanges.Reader locator, final String name) throws DataStoreException { super(builder, locator, name);
