mdaus / nitro

NITRO (NITFio, "R" is a ligature for "Fi") is a full-fledged, extensible library solution for reading and writing the National Imagery Transmission Format (NITF), a U.S. DoD standard format. It is written in cross-platform C, with bindings available for other languages.
GNU Lesser General Public License v3.0
62 stars 38 forks source link

Issue with filling `nitf_BandInfo **bandInfo` in `ImageSubheader` #610

Open samrat-boda opened 6 months ago

samrat-boda commented 6 months ago

Hello,

I am currently working with the NITRO library for handling NITF files and am encountering an issue when trying to populate the nitf_BandInfo **bandInfo field within ImageSubheader.

Environment:

Issue Description: The ImageSubheader.h file defines most image subheader fields as type nitf_Field, for example:

nitf_Field *numRows;
nitf_Field *numCols;

In Python, I have managed to populate these fields successfully:

segment.subheader['numrows'] = height
segment.subheader['numcols'] = width

I'm struggling with the field nitf_BandInfo **bandInfo. The nitf_BandInfo is a struct defined in nitro/modules/c/nitf/include/nitf/BandInfo.h. I've attempted to fill this field but encountered difficulties.

Questions:

1) How should I properly instantiate and assign values to nitf_BandInfo **bandInfo from Python? 2) Is there a specific method or part of the API that facilitates handling pointers to structures in Python?