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 1bb6440b3d03d2aab70c773fa7feca953c158c7f Author: jsorel <[email protected]> AuthorDate: Tue Jun 2 15:42:08 2026 +0200 feat(GeoHeif): add av1,jp2k,hevc and clean aperture boxes --- .../sis/storage/isobmff/MainBoxRegistry.java | 4 ++ .../sis/storage/isobmff/mpeg/CleanAperture.java | 59 ++++++++++++++++++++++ .../sis/storage/isobmff/mpeg/CompressionAV1.java | 59 ++++++++++++++++++++++ .../sis/storage/isobmff/mpeg/CompressionJP2K.java | 59 ++++++++++++++++++++++ .../isobmff/mpeg/HevcConfigurationItem.java | 59 ++++++++++++++++++++++ 5 files changed, 240 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 88340cfd30..c0e7730736 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 @@ -81,6 +81,7 @@ final class MainBoxRegistry extends BoxRegistry { case AuxiliaryImageReference.BOXTYPE: return new AuxiliaryImageReference(reader); case BaseImageReference.BOXTYPE: return new BaseImageReference(reader); case ChromaLocation.BOXTYPE: return new ChromaLocation(reader); + case CleanAperture.BOXTYPE: return new CleanAperture(reader); case ColourInformation.BOXTYPE: return new ColourInformation(reader); case CombinaisonType.BOXTYPE: return new CombinaisonType(reader); case ComponentDefinition.BOXTYPE: return reader.componentDefinition = new ComponentDefinition(reader); @@ -88,7 +89,9 @@ final class MainBoxRegistry extends BoxRegistry { case ComponentPatternDefinition.BOXTYPE: return new ComponentPatternDefinition(reader, reader.componentDefinition); case ComponentReferenceLevel.BOXTYPE: return new ComponentReferenceLevel(reader); case CompressedUnitsItemInfo.BOXTYPE: return new CompressedUnitsItemInfo(reader); + case CompressionAV1.BOXTYPE: return new CompressionAV1(reader); case CompressionConfiguration.BOXTYPE: return new CompressionConfiguration(reader); + case CompressionJP2K.BOXTYPE: return new CompressionJP2K(reader); case ContentDescribes.BOXTYPE: return new ContentDescribes(reader); case Copyright.BOXTYPE: return new Copyright(reader); case CreationTime.BOXTYPE: return new CreationTime(reader); @@ -105,6 +108,7 @@ final class MainBoxRegistry extends BoxRegistry { case FreeSpace.BOXTYPE: return new FreeSpace(); case GroupList.BOXTYPE: return new GroupList(reader); case HandlerReference.BOXTYPE: return new HandlerReference(reader); + case HevcConfigurationItem.BOXTYPE: return new HevcConfigurationItem(reader); case IdentifiedMediaData.BOXTYPE: return new IdentifiedMediaData(reader); case ImagePyramid.BOXTYPE: return new ImagePyramid(reader); case ImageSpatialExtents.BOXTYPE: return new ImageSpatialExtents(reader); diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CleanAperture.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CleanAperture.java new file mode 100644 index 0000000000..b420f9cf09 --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CleanAperture.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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,z + * 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.mpeg; + +import java.io.IOException; +import org.apache.sis.io.stream.ChannelDataInput; +import org.apache.sis.storage.UnsupportedEncodingException; +import org.apache.sis.storage.isobmff.Box; +import org.apache.sis.storage.isobmff.Reader; + + +/** + * Clean aperture. + * + * @author Johann Sorel (Geomatys) + * @author Martin Desruisseaux (Geomatys) + */ +public final class CleanAperture extends Box { + /** + * Numerical representation of the {@code "clap"} box type. + */ + public static final int BOXTYPE = ((((('c' << 8) | 'l') << 8) | 'a') << 8) | 'p'; + + /** + * 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. + * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers. + */ + public CleanAperture(final Reader reader) throws IOException, UnsupportedEncodingException { + final ChannelDataInput input = reader.input; + //todo + int[] data = reader.readRemainingInts(); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionAV1.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionAV1.java new file mode 100644 index 0000000000..e881fcbeda --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionAV1.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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,z + * 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.mpeg; + +import java.io.IOException; +import org.apache.sis.io.stream.ChannelDataInput; +import org.apache.sis.storage.UnsupportedEncodingException; +import org.apache.sis.storage.isobmff.Box; +import org.apache.sis.storage.isobmff.Reader; + + +/** + * AV1 compression. + * + * @author Johann Sorel (Geomatys) + * @author Martin Desruisseaux (Geomatys) + */ +public final class CompressionAV1 extends Box { + /** + * Numerical representation of the {@code "av1C"} box type. + */ + public static final int BOXTYPE = ((((('a' << 8) | 'v') << 8) | '1') << 8) | 'C'; + + /** + * 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. + * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers. + */ + public CompressionAV1(final Reader reader) throws IOException, UnsupportedEncodingException { + final ChannelDataInput input = reader.input; + //todo + int[] data = reader.readRemainingInts(); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionJP2K.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionJP2K.java new file mode 100644 index 0000000000..b30aa812d9 --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/CompressionJP2K.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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,z + * 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.mpeg; + +import java.io.IOException; +import org.apache.sis.io.stream.ChannelDataInput; +import org.apache.sis.storage.UnsupportedEncodingException; +import org.apache.sis.storage.isobmff.Box; +import org.apache.sis.storage.isobmff.Reader; + + +/** + * Jpeg 2000 compression. + * + * @author Johann Sorel (Geomatys) + * @author Martin Desruisseaux (Geomatys) + */ +public final class CompressionJP2K extends Box { + /** + * Numerical representation of the {@code "j2kH"} box type. + */ + public static final int BOXTYPE = ((((('j' << 8) | '2') << 8) | 'k') << 8) | 'H'; + + /** + * 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. + * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers. + */ + public CompressionJP2K(final Reader reader) throws IOException, UnsupportedEncodingException { + final ChannelDataInput input = reader.input; + //todo + int[] data = reader.readRemainingInts(); + } +} diff --git a/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/HevcConfigurationItem.java b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/HevcConfigurationItem.java new file mode 100644 index 0000000000..fdac499e62 --- /dev/null +++ b/incubator/src/org.apache.sis.storage.geoheif/main/org/apache/sis/storage/isobmff/mpeg/HevcConfigurationItem.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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,z + * 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.mpeg; + +import java.io.IOException; +import org.apache.sis.io.stream.ChannelDataInput; +import org.apache.sis.storage.UnsupportedEncodingException; +import org.apache.sis.storage.isobmff.Box; +import org.apache.sis.storage.isobmff.Reader; + + +/** + * HEVC configuration item. + * + * @author Johann Sorel (Geomatys) + * @author Martin Desruisseaux (Geomatys) + */ +public final class HevcConfigurationItem extends Box { + /** + * Numerical representation of the {@code "hvcC"} box type. + */ + public static final int BOXTYPE = ((((('h' << 8) | 'v') << 8) | 'c') << 8) | 'C'; + + /** + * 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. + * @throws NegativeArraySizeException if an unsigned integer exceeds the capacity of 32-bits signed integers. + */ + public HevcConfigurationItem(final Reader reader) throws IOException, UnsupportedEncodingException { + final ChannelDataInput input = reader.input; + //todo + int[] data = reader.readRemainingInts(); + } +}
