Exemplo n.º 1
0
ImageSegmentComputer::ImageSegmentComputer(size_t numRows,
                                           size_t numCols,
                                           size_t numBytesPerPixel,
                                           size_t maxRows,
                                           Uint64 maxSize,
                                           size_t rowsPerBlock,
                                           size_t colsPerBlock) :
    mNumRows(numRows),
    mNumCols(numCols),
    mNumBytesPerPixel(numBytesPerPixel),
    mNumRowsLimit(maxRows),
    mNumColsPaddedForBlocking(getActualDim(mNumCols, colsPerBlock)),
    mNumRowsPerBlock(rowsPerBlock),
    mMaxNumBytesPerSegment(maxSize),
    mNumBytesTotal(static_cast<Uint64>(mNumBytesPerPixel) *
                 getActualDim(mNumRows, rowsPerBlock) *
                 mNumColsPaddedForBlocking)
{
    if (maxRows > ILOC_MAX)
    {
        std::ostringstream ostr;
        ostr << "Max rows was set to " << maxRows
             << " but it cannot be greater than " << ILOC_MAX
             << " per the NITF spec";
        throw except::Exception(Ctxt(ostr.str()));
    }

    if (maxSize > NUM_BYTES_MAX)
    {
        std::ostringstream ostr;
        ostr << "Max image segment size was set to " << maxSize
             << " but it cannot be greater than " << NUM_BYTES_MAX
             << " per the NITF spec";
        throw except::Exception(Ctxt(ostr.str()));
    }

    computeImageInfo();
    computeSegmentInfo();
}
Exemplo n.º 2
0
void NITFImageInfo::compute()
{

    computeImageInfo();
    computeSegmentInfo();
}