Search in sources :

Example 1 with ImageSegment

use of nitf.ImageSegment in project imageio-ext by geosolutions-it.

the class NITFImageWriter method addImageSegment.

/**
 * Setup the ImageSegment
 *
 * @param record
 * @param images
 * @param fis
 * @param compression
 * @return
 * @throws NITFException
 * @throws IOException
 */
private static void addImageSegment(final Record record, final List<ImageWrapper> images, final FileImageInputStreamExt fis, final WriteCompression compression) throws NITFException, IOException {
    ImageSegment segment = null;
    ImageSubheader subheader = null;
    int img = 0;
    // Using a loop for future usage of the cloudCover image
    for (ImageWrapper image : images) {
        // Getting compression parameter and imageProperties
        WriteCompression writeCompression = img == 0 ? compression : WriteCompression.UNCOMPRESSED;
        segment = record.newImageSegment();
        // Setting up the image Sub Header
        subheader = segment.getSubheader();
        double bpppb = initImageSubHeader(image, subheader, writeCompression, fis);
        if (img == 0) {
            initTREs(subheader, image, writeCompression, bpppb);
        }
        img++;
    }
}
Also used : ImageSegment(nitf.ImageSegment) ImageSubheader(nitf.ImageSubheader) ImageWrapper(it.geosolutions.imageio.plugins.nitronitf.wrapper.ImageWrapper) WriteCompression(it.geosolutions.imageio.plugins.nitronitf.NITFUtilities.WriteCompression)

Aggregations

WriteCompression (it.geosolutions.imageio.plugins.nitronitf.NITFUtilities.WriteCompression)1 ImageWrapper (it.geosolutions.imageio.plugins.nitronitf.wrapper.ImageWrapper)1 ImageSegment (nitf.ImageSegment)1 ImageSubheader (nitf.ImageSubheader)1