You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/11/24 00:22:47 UTC

[GitHub] [commons-imaging] gwlucastrig commented on a change in pull request #108: Issue-266 access full precision of TIFF samples

gwlucastrig commented on a change in pull request #108:
URL: https://github.com/apache/commons-imaging/pull/108#discussion_r529081728



##########
File path: src/main/java/org/apache/commons/imaging/formats/tiff/photometricinterpreters/PhotometricInterpreterTranscribeSample0.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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,
+ * 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.commons.imaging.formats.tiff.photometricinterpreters;
+
+import java.io.IOException;
+
+import org.apache.commons.imaging.ImageReadException;
+import org.apache.commons.imaging.common.ImageBuilder;
+import org.apache.commons.imaging.formats.tiff.constants.TiffTagConstants;
+
+/**
+ * Provides an implementation of a custom photometric interpreter that
+ * does not transform the content of a TIFF image to the RGB format
+ * but simply transcribes the first sample at each pixel location to an integer.
+ * <p>
+ * This class is meant to support applications that use TIFF files to store
+ * integer data rather than imagery. This approach is widely used in
+ * GeoTIFF image formats to store geophysical data.
+ * <p>
+ * Note that this implementation only processes the first sample for a pixel.
+ * Developers requiring access to additional samples may use this class as
+ * an example.  However, the ImageBuilder class currently has the limitation
+ * that it cannot store more than one 32 bit integer per pixel or
+ * raster cell.
+ * <p>
+ * The data stored by this class is treated as a signed integer value.
+ */
+public class PhotometricInterpreterTranscribeSample0 extends PhotometricInterpreter {

Review comment:
       I got rid of the zero at the end of the name.  The class name looks a lot cleaner without it. Good suggestion!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org