Exemplo n.º 1
0
 nitf::DateTime asDateTime(const std::string& format = NITF_DATE_FORMAT_21) throw(nitf::NITFException)
 {
     nitf_DateTime* const dateTime =
             nitf_Field_asDateTime(getNativeOrThrow(), format.c_str(),
                                   &error);
     if (!dateTime)
     {
         throw nitf::NITFException(&error);
     }
     return nitf::DateTime(dateTime);
 }
Exemplo n.º 2
0
void nitf::DataSource::read(void* buf, nitf::Off size)
        throw (nitf::NITFException)
{
    nitf_DataSource *ds = getNativeOrThrow();
    if (ds && ds->iface)
    {
        if (!ds->iface->read(ds->data, buf, size, &error))
            throw nitf::NITFException(&error);
    }
    else
        throw except::NullPointerReference(Ctxt("DataSource"));
}
Exemplo n.º 3
0
void ImageSubheader::setBlocking(nitf::Uint32 numRows,
                     nitf::Uint32 numCols,
                     nitf::Uint32 numRowsPerBlock,
                     nitf::Uint32 numColsPerBlock,
                     const std::string& imode) throw(nitf::NITFException)
{
    NITF_BOOL x = nitf_ImageSubheader_setBlocking(getNativeOrThrow(),
        numRows, numCols, numRowsPerBlock, numColsPerBlock, imode.c_str(),
        &error);
    if (!x)
        throw nitf::NITFException(&error);
}
Exemplo n.º 4
0
void ImageSubheader::setCornersFromLatLons(nitf::CornersType type,
                                           double corners[4][2])
    throw(nitf::NITFException)
{
    NITF_BOOL x = nitf_ImageSubheader_setCornersFromLatLons(getNativeOrThrow(),
                                                            type,
                                                            corners,
                                                            &error);
    if (!x)
        throw nitf::NITFException(&error);

}
Exemplo n.º 5
0
void nitf::DownSampler::apply(NITF_DATA ** inputWindow,
        NITF_DATA ** outputWindow, nitf::Uint32 numBands,
        nitf::Uint32 numWindowRows, nitf::Uint32 numWindowCols,
        nitf::Uint32 numInputCols, nitf::Uint32 numSubWindowCols,
        nitf::Uint32 pixelType, nitf::Uint32 pixelSize,
        nitf::Uint32 rowsInLastWindow, nitf::Uint32 colsInLastWindow)
        throw (nitf::NITFException)
{
    nitf_DownSampler *ds = getNativeOrThrow();
    if (ds && ds->iface)
    {
        if (!ds->iface->apply(ds, inputWindow, outputWindow, numBands,
                              numWindowRows, numWindowCols, numInputCols,
                              numSubWindowCols, pixelType, pixelSize,
                              rowsInLastWindow, colsInLastWindow, &error))
            throw nitf::NITFException(&error);
    }
    else
    {
        throw except::NullPointerReference(Ctxt("DownSampler"));
    }
}
Exemplo n.º 6
0
 void set(nitf::Int64 data)
 {
     if (!nitf_Field_setInt64(getNativeOrThrow(),
                              nitf::Uint32(data), &error))
         throw nitf::NITFException(&error);
 }
Exemplo n.º 7
0
 void set(double data)
 {
     if (!nitf_Field_setReal(getNativeOrThrow(),
                             "f", false, data, &error))
         throw nitf::NITFException(&error);
 }
Exemplo n.º 8
0
nitf::Uint32 nitf::DownSampler::getColSkip()
{
    return getNativeOrThrow()->colSkip;
}
Exemplo n.º 9
0
int nitf::HashTable::getAdopt() const
{
    return getNativeOrThrow()->adopt;
}
Exemplo n.º 10
0
 //! Get the data
 char * getRawData() const
 {
     return getNativeOrThrow()->raw;
 }
Exemplo n.º 11
0
 std::string toString() const
 {
     return std::string(getNativeOrThrow()->raw,
                        getNativeOrThrow()->length );
 }
Exemplo n.º 12
0
int nitf::IOInterface::getMode() const
{
    nitf_IOInterface *io = getNativeOrThrow();
    return io->iface->getMode(io->data, &error);
}
Exemplo n.º 13
0
 //! Get the type
 FieldType getType() const
 {
     return (FieldType)getNativeOrThrow()->type;
 }
Exemplo n.º 14
0
void nitf::DataSource::setSize(nitf::Off size)
{
    nitf_DataSource *ds = getNativeOrThrow();
    if (!ds->iface->setSize(ds->data, size, &error))
        throw nitf::NITFException(&error);
}
Exemplo n.º 15
0
bool nitf::IOInterface::canSeek() const
{
    nitf_IOInterface *io = getNativeOrThrow();
    return io->iface->canSeek(io->data, &error) == NRT_SUCCESS;
}
Exemplo n.º 16
0
nitf::ImageSubheader ImageSubheader::clone() throw(nitf::NITFException)
{
    nitf::ImageSubheader dolly(nitf_ImageSubheader_clone(getNativeOrThrow(), &error));
    dolly.setManaged(false);
    return dolly;
}
Exemplo n.º 17
0
nitf::HashTable::HashTable(int nbuckets) throw(nitf::NITFException)
{
    setNative(nitf_HashTable_construct(nbuckets, &error));
    getNativeOrThrow();
    setManaged(false);
}
Exemplo n.º 18
0
nitf::HashTable::HashTable(nitf_HashTable * x)
{
    setNative(x);
    getNativeOrThrow();
}
Exemplo n.º 19
0
 void set(const char * data) throw(nitf::NITFException)
 {
     NITF_BOOL x = nitf_Field_setString(getNativeOrThrow(), (char*)data, &error);
     if (!x)
         throw nitf::NITFException(&error);
 }
Exemplo n.º 20
0
void nitf::IOInterface::close()
{
    nitf_IOInterface *io = getNativeOrThrow();
    io->iface->close(io->data, &error);
}
Exemplo n.º 21
0
size_t ImageSubheader::getNumBytesPerPixel() const
{
    const size_t numBitsPerPixel =
            nitf::Field(getNativeOrThrow()->numBitsPerPixel);
    return NITF_NBPP_TO_BYTES(numBitsPerPixel);
}
Exemplo n.º 22
0
 //! Set native object
 Field(nitf_Field * field)
 {
     setNative(field);
     getNativeOrThrow();
 }
Exemplo n.º 23
0
 //! Set the type
 void setType(FieldType type)
 {
     getNativeOrThrow()->type = (nitf_FieldType)type;
 }
Exemplo n.º 24
0
ImageSubheader::ImageSubheader() throw(nitf::NITFException)
{
    setNative(nitf_ImageSubheader_construct(&error));
    getNativeOrThrow();
    setManaged(false);
}
Exemplo n.º 25
0
 //! Get the data length
 size_t getLength() const
 {
     return getNativeOrThrow()->length;
 }
Exemplo n.º 26
0
 Field & operator=(NITF_DATA * x)
 {
     setNative((nitf_Field*)x);
     getNativeOrThrow();
     return *this;
 }
Exemplo n.º 27
0
 //! set the value
 void set(NITF_DATA* inval, size_t length) throw(nitf::NITFException)
 {
     NITF_BOOL x = nitf_Field_setRawData(getNativeOrThrow(), inval, length, &error);
     if (!x)
         throw nitf::NITFException(&error);
 }
Exemplo n.º 28
0
 void set(nitf::Uint64 data) throw(nitf::NITFException)
 {
     NITF_BOOL x = nitf_Field_setUint64(getNativeOrThrow(), data, &error);
     if (!x)
         throw nitf::NITFException(&error);
 }
Exemplo n.º 29
0
 Field(NITF_DATA * x)
 {
     setNative((nitf_Field*)x);
     getNativeOrThrow();
 }
Exemplo n.º 30
0
int nitf::HashTable::getNumBuckets() const
{
    return getNativeOrThrow()->nbuckets;
}