#include "main.h"
#include "support.h"
{
const char *inname = INPUT_PATH("Tile7_rgbn_utm15.sid");
const char *outname = OUTPUT_PATH("Tile7_rgbn_utm15-ia.bsq");
const char *refname = INPUT_PATH("Tile7_rgbn_utm15-ia.bsq");
TEST_BOOL(reader != NULL);
const LTIScene scene(0, 0, 256, 256, 1.0);
scene.getNumCols(),
scene.getNumRows(),
NULL);
TEST_SUCCESS(reader->
read(scene, sceneBuffer));
FILE *file = fopen(outname, "wb");
lt_uint16 numBands = pixelProps.getNumBands();
for(
lt_uint16 band = 0; band < numBands; band++)
{
lt_uint32 bytesPerSample = pixelProps.getSample(band).getNumBytes();
lt_uint32 numPixels = sceneBuffer.getNumCols() *
sceneBuffer.getNumRows();
void *bandBuffer = sceneBuffer.getBandData(band);
if(sceneBuffer.getNumCols() != sceneBuffer.getTotalNumCols())
if(fwrite(bandBuffer, bytesPerSample, numPixels, file) != numPixels)
}
fclose(file);
TEST_BOOL(Compare(outname, refname));
Remove(outname);
}