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 7037e128645af3176ff4c60676629f6a7c6def7f Author: jsorel <[email protected]> AuthorDate: Tue Jun 2 15:19:38 2026 +0200 feat(GeoHeif): add auxl,base,prem,thmb image reference --- .../sis/storage/isobmff/MainBoxRegistry.java | 4 ++ .../isobmff/image/AuxiliaryImageReference.java | 53 ++++++++++++++++++++++ .../storage/isobmff/image/BaseImageReference.java | 53 ++++++++++++++++++++++ .../isobmff/image/PremultipliedImageReference.java | 53 ++++++++++++++++++++++ .../storage/isobmff/image/ThumbnailReference.java | 53 ++++++++++++++++++++++ 5 files changed, 216 insertions(+) diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/MainBoxRegistry.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/MainBoxRegistry.java index 4ac834aa31..88340cfd30 100644 --- a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/MainBoxRegistry.java +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/MainBoxRegistry.java @@ -78,6 +78,8 @@ final class MainBoxRegistry extends BoxRegistry { @Override public Box create(final Reader reader, final int fourCC) throws IOException, DataStoreException { switch (fourCC) { + case AuxiliaryImageReference.BOXTYPE: return new AuxiliaryImageReference(reader); + case BaseImageReference.BOXTYPE: return new BaseImageReference(reader); case ChromaLocation.BOXTYPE: return new ChromaLocation(reader); case ColourInformation.BOXTYPE: return new ColourInformation(reader); case CombinaisonType.BOXTYPE: return new CombinaisonType(reader); @@ -125,12 +127,14 @@ final class MainBoxRegistry extends BoxRegistry { case OriginalFileType.BOXTYPE: return new OriginalFileType(reader); case PixelInformation.BOXTYPE: return new PixelInformation(reader); case PolarizationPatternDefinition.BOXTYPE: return new PolarizationPatternDefinition(reader); + case PremultipliedImageReference.BOXTYPE: return new PremultipliedImageReference(reader); case PrimaryItem.BOXTYPE: return new PrimaryItem(reader); case ProgressiveDownloadInfo.BOXTYPE: return new ProgressiveDownloadInfo(reader); case SensorBadPixelsMap.BOXTYPE: return new SensorBadPixelsMap(reader); case SensorNonUniformityCorrection.BOXTYPE: return new SensorNonUniformityCorrection(reader); case TAIClockInfo.BOXTYPE: return new TAIClockInfo(reader); case TAITimeStamp.BOXTYPE: return new TAITimeStamp(reader); + case ThumbnailReference.BOXTYPE: return new ThumbnailReference(reader); case TiledImageConfiguration.BOXTYPE: return new TiledImageConfiguration(reader); case Track.BOXTYPE: return new Track(reader); case TrackHeader.BOXTYPE: return new TrackHeader(reader, reader.movieHeader); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/AuxiliaryImageReference.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/AuxiliaryImageReference.java new file mode 100644 index 0000000000..fbd77822d6 --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/AuxiliaryImageReference.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed withz + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.storage.isobmff.image; + +import java.io.IOException; +import org.apache.sis.storage.isobmff.Reader; +import org.apache.sis.storage.isobmff.base.SingleItemTypeReference; + + +/** + * Image is auxiliary to another image. + * + * @author Johann Sorel (Geomatys) + */ +public final class AuxiliaryImageReference extends SingleItemTypeReference { + /** + * Numerical representation of the {@code "auxl"} box type. + */ + public static final int BOXTYPE = ((((('a' << 8) | 'u') << 8) | 'x') << 8) | 'l'; + + /** + * Returns the four-character type of this box. + * This value is fixed to {@link #BOXTYPE}. + */ + @Override + public final int type() { + return BOXTYPE; + } + + /** + * Creates a new box and loads the payload from the given reader. + * + * @param reader the reader from which to read the payload. + * @throws IOException if an error occurred while reading the payload. + */ + public AuxiliaryImageReference(final Reader reader) throws IOException { + super(reader, false); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/BaseImageReference.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/BaseImageReference.java new file mode 100644 index 0000000000..35aafce21a --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/BaseImageReference.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed withz + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.storage.isobmff.image; + +import java.io.IOException; +import org.apache.sis.storage.isobmff.Reader; +import org.apache.sis.storage.isobmff.base.SingleItemTypeReference; + + +/** + * Base image reference. + * + * @author Johann Sorel (Geomatys) + */ +public final class BaseImageReference extends SingleItemTypeReference { + /** + * Numerical representation of the {@code "base"} box type. + */ + public static final int BOXTYPE = ((((('b' << 8) | 'a') << 8) | 's') << 8) | 'e'; + + /** + * Returns the four-character type of this box. + * This value is fixed to {@link #BOXTYPE}. + */ + @Override + public final int type() { + return BOXTYPE; + } + + /** + * Creates a new box and loads the payload from the given reader. + * + * @param reader the reader from which to read the payload. + * @throws IOException if an error occurred while reading the payload. + */ + public BaseImageReference(final Reader reader) throws IOException { + super(reader, false); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/PremultipliedImageReference.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/PremultipliedImageReference.java new file mode 100644 index 0000000000..61a86bd1b2 --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/PremultipliedImageReference.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed withz + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.storage.isobmff.image; + +import java.io.IOException; +import org.apache.sis.storage.isobmff.Reader; +import org.apache.sis.storage.isobmff.base.SingleItemTypeReference; + + +/** + * Color values in an image have been premultiplied with alpha values. + * + * @author Johann Sorel (Geomatys) + */ +public final class PremultipliedImageReference extends SingleItemTypeReference { + /** + * Numerical representation of the {@code "prem"} box type. + */ + public static final int BOXTYPE = ((((('p' << 8) | 'r') << 8) | 'e') << 8) | 'm'; + + /** + * Returns the four-character type of this box. + * This value is fixed to {@link #BOXTYPE}. + */ + @Override + public final int type() { + return BOXTYPE; + } + + /** + * Creates a new box and loads the payload from the given reader. + * + * @param reader the reader from which to read the payload. + * @throws IOException if an error occurred while reading the payload. + */ + public PremultipliedImageReference(final Reader reader) throws IOException { + super(reader, false); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/ThumbnailReference.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/ThumbnailReference.java new file mode 100644 index 0000000000..da99569fca --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/image/ThumbnailReference.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed withz + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.storage.isobmff.image; + +import java.io.IOException; +import org.apache.sis.storage.isobmff.Reader; +import org.apache.sis.storage.isobmff.base.SingleItemTypeReference; + + +/** + * Image is a thumbnail of another image. + * + * @author Johann Sorel (Geomatys) + */ +public final class ThumbnailReference extends SingleItemTypeReference { + /** + * Numerical representation of the {@code "thmb"} box type. + */ + public static final int BOXTYPE = ((((('t' << 8) | 'h') << 8) | 'm') << 8) | 'b'; + + /** + * Returns the four-character type of this box. + * This value is fixed to {@link #BOXTYPE}. + */ + @Override + public final int type() { + return BOXTYPE; + } + + /** + * Creates a new box and loads the payload from the given reader. + * + * @param reader the reader from which to read the payload. + * @throws IOException if an error occurred while reading the payload. + */ + public ThumbnailReference(final Reader reader) throws IOException { + super(reader, false); + } +}
