You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the python module, a number of nitf-related methods are not typemapped correctly in the SWIG file six_sicd.i. As a result, the methods can't be called if the underlying C++ takes a nitf::Uint32 or if the method returns a nitf::Uint32, the return type is opaque.
In particular ImageSegment.getBandInfo can't be called:
(pdb) record.getImageSegment(0).getSubheader().getBandInfo(0)
***TypeErrorinmethod' ImageSubheader_getBandInfo', argument2of type 'nitf::Uint32'
And ImageSegment.getBandCount() returns an opaque type:
(pdb) record.getImageSegment(0).getSubheader().getBandCount()
<SWIGobjectof type 'nitf::uint32 *'at0x7f03c6e77210>
This appears to be because the input and output typemaps for nitf::Uint32 are defined after the nitf-related includes
Moving those typemaps before the nitf includes in the .i and then regenerating the bindings via a recompilation with -DENABLE_SWIG=ON fixes the issue:
(pdb) record.getImageSegment(0).getSubheader().getBandInfo(0)
<SWIGObjectof type 'nitf::BandInfo *'at0x7fc491bb67b0>
(pdb) record.getImageSegment(0).getSubheader().getBandCount()
2
(Note: nitf::BandInfo is also opaque because it's not included in the .i file, but that's a separate issue)
The text was updated successfully, but these errors were encountered:
ianrcooke
changed the title
Type nitf::Uint32 as input or return type for some NITF-related methods are not typemapped into Python
Type nitf::Uint32 as input or return type for some NITF-related methods are not typemapped into Python
Sep 23, 2020
ianrcooke
changed the title
Type nitf::Uint32 as input or return type for some NITF-related methods are not typemapped into Python
Type nitf::Uint32 as input or return type for some NITF-related methods are not typemapped into Python
Sep 23, 2020
For the python module, a number of nitf-related methods are not typemapped correctly in the SWIG file
six_sicd.i
. As a result, the methods can't be called if the underlying C++ takes anitf::Uint32
or if the method returns anitf::Uint32
, the return type is opaque.In particular
ImageSegment.getBandInfo
can't be called:And
ImageSegment.getBandCount()
returns an opaque type:This appears to be because the input and output typemaps for
nitf::Uint32
are defined after the nitf-related includesMoving those typemaps before the nitf includes in the .i and then regenerating the bindings via a recompilation with
-DENABLE_SWIG=ON
fixes the issue:(Note:
nitf::BandInfo
is also opaque because it's not included in the .i file, but that's a separate issue)The text was updated successfully, but these errors were encountered: