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++;
}
}
Aggregations