private void parseFrameFileIndexAndPathnameTables(java.nio.ByteBuffer buffer) { int theSectionOffset = buffer.position(); Hashtable <Integer, String> pathnames = new Hashtable <Integer, String>(); for (int i = 0; i < this.numOfFrameFileIndexRecords; i++) { this.frameFileIndexTable.add(new RPFFrameFileIndexRecord(buffer)); } for (int i = 0; i < this.numOfPathnameRecords; i++) { int relOffset = buffer.position() - theSectionOffset; int len = NITFSUtil.getUShort(buffer); pathnames.put(relOffset, NITFSUtil.getString(buffer, len)); } if (0 < this.frameFileIndexTable.size() && 0 < pathnames.size()) { // update pathname field in every RPFFrameFileIndexRecord foreach (RPFFrameFileIndexRecord rec in this.frameFileIndexTable) { int offset = (int)rec.getPathnameRecordOffset(); if (pathnames.containsKey(offset)) { rec.setPathname(pathnames.get(offset)); } else { throw new NITFSRuntimeException("NITFSReader.CorrespondingPathnameWasNotFound"); } } } }
private void parseRPFColorOffsetRecord(java.nio.ByteBuffer buffer) { this.tableID = NITFSUtil.getUShort(buffer); this.numOfColorRecords = NITFSUtil.getUInt(buffer); this.colorElementLength = NITFSUtil.getByteAsShort(buffer); this.histogramRecordLength = NITFSUtil.getUShort(buffer); this.colorTableOffset = NITFSUtil.getUInt(buffer); this.histogramTableOffset = NITFSUtil.getUInt(buffer); }
public RPFBoundingRectangleSection(ByteBuffer buffer) { // [ bounding rectangle section subheader ] this.tableOffset = NITFSUtil.getUInt(buffer); this.numberOfRecords = NITFSUtil.getUShort(buffer); this.recordLength = NITFSUtil.getUShort(buffer); parseBoundsRecords(buffer); }
// public ArrayList<String> getPathnameTable() // { // return pathnameTable; // } public RPFFrameFileIndexSection(java.nio.ByteBuffer buffer) { // [ frame file index section subheader ] this.highestSecurityClassification = NITFSUtil.getString(buffer, 1); this.frameFileIndexTableOffset = NITFSUtil.getUInt(buffer); this.numOfFrameFileIndexRecords = NITFSUtil.getUInt(buffer); this.numOfPathnameRecords = NITFSUtil.getUShort(buffer); this.frameFileIndexRecordLength = NITFSUtil.getUShort(buffer); this.parseFrameFileIndexAndPathnameTables(buffer); }
private String pathname; // this field is not part of the NITFS spec public RPFFrameFileIndexRecord(java.nio.ByteBuffer buffer) { this.boundaryRectangleRecordNumber = NITFSUtil.getUShort(buffer); this.frameLocationRowNumber = NITFSUtil.getUShort(buffer); this.frameLocationColumnNumber = NITFSUtil.getUShort(buffer); this.pathnameRecordOffset = NITFSUtil.getUInt(buffer); this.frameFileName = NITFSUtil.getString(buffer, 12); this.geoLocation = NITFSUtil.getString(buffer, 6); this.securityClass = NITFSUtil.getString(buffer, 1); this.securityCountryCode = NITFSUtil.getString(buffer, 2); this.securityReleaseMark = NITFSUtil.getString(buffer, 2); this.pathname = ""; }
private void parseImageDescriptionSubheader(java.nio.ByteBuffer buffer) { this.numOfSpectralGroups = NITFSUtil.getUShort(buffer); this.numOfSubframeTables = NITFSUtil.getUShort(buffer); this.numOfSpectralBandTables = NITFSUtil.getUShort(buffer); this.numOfSpectralBandLinesPerImageRow = NITFSUtil.getUShort(buffer); this.numOfSubframesInEastWestDirection = NITFSUtil.getUShort(buffer); this.numOfSubframesInNorthSouthDirection = NITFSUtil.getUShort(buffer); this.numOfOutputColumnsPerSubframe = NITFSUtil.getUInt(buffer); this.numOfOutputRowsPerSubframe = NITFSUtil.getUInt(buffer); this.subframeMaskTableOffset = NITFSUtil.getUInt(buffer); this.transparencyMaskTableOffset = NITFSUtil.getUInt(buffer); }
private void parseColormapSubSection(java.nio.ByteBuffer buffer) { buffer.position(this.componentLocationTable.getColormapSubsectionLocation()); this.colormapOffsetTableOffset = NITFSUtil.getUInt(buffer); this.colormapGrayscaleOffsetRecordLength = NITFSUtil.getUShort(buffer); // read color / grayscale AND histogram records; builds a ColorMap (LUT) if (0 < this.numOfColorGrayscaleOffsetRecords) { rpfColorMaps = new RPFColorMap[this.numOfColorGrayscaleOffsetRecords]; for (int i = 0; i < this.numOfColorGrayscaleOffsetRecords; i++) { rpfColorMaps[i] = new RPFColorMap(buffer, this.componentLocationTable.getColormapSubsectionLocation()); } } else { throw new NITFSRuntimeException("NITFSReader.InvalidNumberOfRPFColorGrayscaleRecords"); } }
public RPFLocationSection(java.nio.ByteBuffer buffer) { this.locationSectionLength = NITFSUtil.getUShort(buffer); this.componentLocationTableOffset = NITFSUtil.getUInt(buffer); this.numOfComponentLocationRecords = NITFSUtil.getUShort(buffer); this.componentLocationRecordLength = NITFSUtil.getUShort(buffer); this.componentAggregateLength = NITFSUtil.getUInt(buffer); if (this.numOfComponentLocationRecords < 2) { throw new NITFSRuntimeException("NITFSReader:InvalidNumberOfComponentLocationRecords"); } for (int i = 0; i < this.numOfComponentLocationRecords; i++) { int id = NITFSUtil.getUShort(buffer); table.put(id, new ComponentLocationRecord(id, NITFSUtil.getUInt(buffer), // read uint:4 as "length" NITFSUtil.getUInt(buffer) // read uint:4 as "location" )); } }
public RelatedImagesSection(java.nio.ByteBuffer buffer) { this.relatedImageDescriptionTableOffset = NITFSUtil.getUInt(buffer); this.numOfRelatedImageDescriptionRecords = NITFSUtil.getUShort(buffer); this.relatedImageDescriptionRecordLength = NITFSUtil.getUShort(buffer); }