コード例 #1
0
        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");
                    }
                }
            }
        }
コード例 #2
0
        private void parseColorGrayscaleSection(java.nio.ByteBuffer buffer)
        {
            buffer.position(this.componentLocationTable.getColorGrayscaleSectionSubheaderLocation());

            this.numOfColorGrayscaleOffsetRecords = NITFSUtil.getByteAsShort(buffer);
            this.numOfColorConverterOffsetRecords = NITFSUtil.getByteAsShort(buffer);
            this.externalColorGrayscaleFilename   = NITFSUtil.getString(buffer, 12);
        }
コード例 #3
0
        public NITFSUserDefinedHeaderSegment(java.nio.ByteBuffer buffer)
        {
            base(NITFSSegmentType.USER_DEFINED_HEADER_SEGMENT, buffer, 0, 0, 0, 0);

            this.headerLength = Integer.parseInt(NITFSUtil.getString(buffer, 5));
            this.overflow     = Integer.parseInt(NITFSUtil.getString(buffer, 3));
            this.dataTag      = NITFSUtil.getString(buffer, 6);
            this.dataLength   = Integer.parseInt(NITFSUtil.getString(buffer, 5));
        }
コード例 #4
0
//    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);
        }
コード例 #5
0
            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            = "";
            }
コード例 #6
0
 public RPFHeaderSection(java.nio.ByteBuffer buffer)
 {
     this.endianIndicator         = ((byte)0 != buffer.get());        // reads 1 byte, 0 for big endian
     this.headerLength            = buffer.getShort();                // reads 2 bytes
     this.filename                = NITFSUtil.getString(buffer, 12);
     this.updateIndicator         = NITFSUtil.getByteAsShort(buffer); // reads 1 byte (short)
     this.govSpecNumber           = NITFSUtil.getString(buffer, 15);
     this.govSpecDate             = NITFSUtil.getString(buffer, 8);
     this.securityClass           = NITFSUtil.getString(buffer, 1);
     this.securityCountryCode     = NITFSUtil.getString(buffer, 2);
     this.securityReleaseMark     = NITFSUtil.getString(buffer, 2);
     this.locationSectionLocation = buffer.getInt();        // read 4 bytes (int)
 }
コード例 #7
0
        private void parseFileHeaderInfo(java.nio.ByteBuffer buffer)
        {
            this.headerID             = NITFSUtil.getString(buffer, 0, 4);
            this.version              = NITFSUtil.getString(buffer, 5);
            this.isVersion0210        = "02.10".Equals(version);
            this.complexityLevel      = NITFSUtil.getShortNumeric(buffer, 2);
            this.specialType          = NITFSUtil.getString(buffer, 4);          // offset  11, size 4
            this.originationStationId = NITFSUtil.getString(buffer, 10);         // offset  15, size 10
            this.dateTime             = NITFSUtil.getString(buffer, 14);         // offset  25, size 14
            this.title = NITFSUtil.getString(buffer, 80);                        // offset  39, size 80

            this.FSCLAS = NITFSUtil.getString(buffer, 1);                        // offset 119, size 1
            this.FSCLSY = (isVersion0210 ? NITFSUtil.getString(buffer, 2) : ""); // offset 120, size 2
            this.FSCODE = NITFSUtil.getString(buffer, isVersion0210 ? 11 : 40);
            this.FSCTLH = NITFSUtil.getString(buffer, isVersion0210 ? 2 : 40);
            this.FSREL  = NITFSUtil.getString(buffer, isVersion0210 ? 20 : 40);

            this.FSDCTP = (isVersion0210 ? NITFSUtil.getString(buffer, 2) : "");
            this.FSDCDT = (isVersion0210 ? NITFSUtil.getString(buffer, 8) : "");   // offset 157/
            this.FSDCXM = (isVersion0210 ? NITFSUtil.getString(buffer, 4) : "");   // offset 165/
            this.FSDG   = (isVersion0210 ? NITFSUtil.getString(buffer, 1) : "");   // offset 169/
            this.FSDGDT = (isVersion0210 ? NITFSUtil.getString(buffer, 8) : "");   // oofset 170/
            this.FSCLTX = (isVersion0210 ? NITFSUtil.getString(buffer, 43) : "");  // offset 178/
            this.FSCATP = (isVersion0210 ? NITFSUtil.getString(buffer, 1) : "");   // offset 221/

            this.FSCAUT = NITFSUtil.getString(buffer, isVersion0210 ? 40 : 20);    // offset 222/240

            this.FSCRSN = (isVersion0210 ? NITFSUtil.getString(buffer, 1) : "");   // offset 262/
            this.FSSRDT = (isVersion0210 ? NITFSUtil.getString(buffer, 8) : "");   // offset 263/
            this.FSCTLN = NITFSUtil.getString(buffer, isVersion0210 ? 15 : 20);    // offset 271/260
            this.FSDWNG = (isVersion0210) ? "" : NITFSUtil.getString(buffer, 6);   // offset    /280

            this.FSDEVT = (!isVersion0210 && "999998".Equals(FSDWNG))              // offset    /286
                            ? NITFSUtil.getString(buffer, 40) : "";

            this.FSCOP  = NITFSUtil.getString(buffer, 5);                             // offset 286/+40
            this.FSCPYS = NITFSUtil.getString(buffer, 5);                             // offset 291/+40
            this.ENCRYP = NITFSUtil.getString(buffer, 1);                             // offset 296/+40

            this.FBKGC  = (isVersion0210 ? NITFSUtil.getString(buffer, 297, 3) : ""); // offset 297/
            this.ONAME  = NITFSUtil.getString(buffer, isVersion0210 ? 24 : 27);       // offset 300/297(+40)
            this.OPHONE = NITFSUtil.getString(buffer, 18);                            // offset 324(+40)

            this.fileLength   = NITFSUtil.getNumeric(buffer, 12);                     // offset 342(+40)
            this.headerLength = NITFSUtil.getNumeric(buffer, 6);                      // offset 352(+40)
        }
コード例 #8
0
        public NITFSImageBand(java.nio.ByteBuffer buffer)
        {
            this.representation = NITFSUtil.getString(buffer, 2);
            this.significanceForImageCategory = NITFSUtil.getString(buffer, 6);
            this.imageFilterCondition         = NITFSUtil.getString(buffer, 1);
            this.stdImageFilterCode           = NITFSUtil.getString(buffer, 3);
            this.numOfLookupTables            = NITFSUtil.getShortNumeric(buffer, 1);
            this.numOfLookupTableEntries      = NITFSUtil.getShortNumeric(buffer, 5);
            if (0 < this.numOfLookupTables && 0 < this.numOfLookupTableEntries)
            {
                this.lut = new byte[this.numOfLookupTables][this.numOfLookupTableEntries];
                for (int j = 0; j < this.numOfLookupTables; j++)
                {
                    buffer.get(this.lut[j], 0, this.numOfLookupTableEntries);
                }
            }

            this.isGrayImage         = (1 == this.numOfLookupTables);
            this.hasTransparentEntry = (217 == this.numOfLookupTableEntries);
        }
コード例 #9
0
 public RPFBoundingRectangleRecord(ByteBuffer buffer)
 {
     this.dataType         = NITFSUtil.getString(buffer, 5);
     this.compressionRatio = NITFSUtil.getString(buffer, 5);
     this.scale            = NITFSUtil.getString(buffer, 12);
     this.zone             = NITFSUtil.getString(buffer, 1);
     this.producer         = NITFSUtil.getString(buffer, 5);
     this.ulLat            = buffer.getDouble();
     this.ulLon            = buffer.getDouble();
     this.llLat            = buffer.getDouble();
     this.llLon            = buffer.getDouble();
     this.urLat            = buffer.getDouble();
     this.urLon            = buffer.getDouble();
     this.lrLat            = buffer.getDouble();
     this.lrLon            = buffer.getDouble();
     this.nsRes            = buffer.getDouble();
     this.ewRes            = buffer.getDouble();
     this.latInterval      = buffer.getDouble();
     this.lonInterval      = buffer.getDouble();
     this.numFramesNS      = NITFSUtil.getUInt(buffer);
     this.numFramesEW      = NITFSUtil.getUInt(buffer);
 }