Example #1
0
void MetadataReader::read()
{
    //
    // dump the file header
    //
    ::nitf::FileHeader header = m_record.getHeader();
    ::nitf::FileSecurity security = header.getSecurityGroup();        
    
    doFileHeader("FH", header);
    doSecurity("FH", "F", security);
    
    ::nitf::Extensions ext = header.getExtendedSection();
    doExtensions("FH", ext);

    ::nitf::ListIterator iter;
    ::nitf::Uint32 num;
    ::nitf::Uint32 i;

    //
    // dump the image info, for each image
    //
    iter = m_record.getImages().begin();
    num = m_record.getNumImages();
    for (i=0; i<num; i++)
    {
        const std::string key = "IM:" + std::to_string(i);
        
        ::nitf::ImageSegment segment = *iter;
        ::nitf::ImageSubheader header = segment.getSubheader();
        
        doImageSubheader(key, header);
        
        ::nitf::Extensions ext = header.getExtendedSection();
        doExtensions(key, ext);
        
        ::nitf::Extensions ext2 = header.getUserDefinedSection();
        doExtensions(key, ext2);
    }
    
    //
    // dump the DE info, for each DE
    //
    iter = m_record.getDataExtensions().begin();
    num = m_record.getNumDataExtensions();
    for (i=0; i<num; i++)
    {
        const std::string key = "DE:" + std::to_string(i);
        
        ::nitf::DESegment segment = *iter;
        ::nitf::DESubheader header = segment.getSubheader();
        ::nitf::FileSecurity security = header.getSecurityGroup();
        
        doDESubheader(key, header);
        
        ::nitf::Extensions ext = header.getUserDefinedSection();
        doExtensions(key, ext);
    }

    return;
}
Example #2
0
void MetadataReader::doDESubheader(const std::string& key,
                                   ::nitf::DESubheader& subheader)
{
    writeField(key, "DESID", subheader.getTypeID());
    writeField(key, "DESVER", subheader.getVersion());
    writeField(key, "DECLAS", subheader.getSecurityClass());

    ::nitf::FileSecurity security = subheader.getSecurityGroup();
    doSecurity(key, "DE", security);

    // this is not an internal field, not interesting to users
    //writeField(key, "DESSHL", subheader.getDataLength());
}
Example #3
0
void MetadataReader::doImageSubheader(const std::string& key,
                                      ::nitf::ImageSubheader& subheader)
{
    writeField(key, "IID1", subheader.getImageId());
    writeField(key, "IDATIM", subheader.getImageDateAndTime());
    writeField(key, "TGTID", subheader.getTargetId());
    writeField(key, "IID2", subheader.getImageTitle());
    writeField(key, "ISCLAS", subheader.getImageSecurityClass());
    
    ::nitf::FileSecurity security = subheader.getSecurityGroup();
    doSecurity(key, "I", security);

    writeField(key, "ENCRYP", subheader.getEncrypted());
    writeField(key, "ISORCE", subheader.getImageSource());
    writeField(key, "NROWS", subheader.getNumRows());
    writeField(key, "NCOLS", subheader.getNumCols());
    writeField(key, "PVTYPE", subheader.getPixelValueType());
    writeField(key, "IREP", subheader.getImageRepresentation());
    writeField(key, "ICAT", subheader.getImageCategory());
    writeField(key, "ABPP", subheader.getActualBitsPerPixel());
    writeField(key, "PJUST", subheader.getPixelJustification());
    writeField(key, "ICORDS", subheader.getImageCoordinateSystem());
    writeField(key, "IGEOLO", subheader.getCornerCoordinates());
    writeField(key, "NICOM", subheader.getNumImageComments());

    ::nitf::List list = subheader.getImageComments();
    doComments(key, list);
    
    writeField(key, "IC", subheader.getImageCompression());
    writeField(key, "COMRAT", subheader.getCompressionRate());
    writeField(key, "NBANDS", subheader.getNumImageBands());
    writeField(key, "XBANDS", subheader.getNumMultispectralImageBands());

    doBands(key, subheader);

    writeField(key, "ISYNC", subheader.getImageSyncCode());
    writeField(key, "IMODE", subheader.getImageMode());
    writeField(key, "NBPR", subheader.getNumBlocksPerRow());
    writeField(key, "NBPC", subheader.getNumBlocksPerCol());
    writeField(key, "NPPBH", subheader.getNumPixelsPerHorizBlock());
    writeField(key, "NPPVB", subheader.getNumPixelsPerVertBlock());
    writeField(key, "NBPP", subheader.getNumBitsPerPixel());
    writeField(key, "IDLVL", subheader.getImageDisplayLevel());
    writeField(key, "IALVL", subheader.getImageAttachmentLevel());
    writeField(key, "ILOC", subheader.getImageLocation());
    writeField(key, "IMAG", subheader.getImageMagnification());
}