#include "main.h"
#include "support.h"
{
const LTFileSpec fileSpec(INPUT_PATH(
"meg_cr20.sid"));
TEST_BOOL(reader != NULL);
TEST_BOOL(sceneBuffer.getNumCols() == 150);
TEST_BOOL(sceneBuffer.getNumRows() == 150);
TEST_BOOL(sceneBuffer.getTotalNumCols() == 150);
pink.getSample(1).setValueUint8(128);
pink.getSample(2).setValueUint8(128);
sceneBuffer.fill(pink);
const LTIScene scene(270, 190, 100, 100, 1.0);
TEST_BOOL(subSceneBuffer.getNumCols() == 100);
TEST_BOOL(subSceneBuffer.getNumRows() == 100);
TEST_BOOL(subSceneBuffer.getTotalNumCols() == 150);
TEST_SUCCESS(reader->
read(scene, subSceneBuffer));
{
FILE *file = fopen(OUTPUT_PATH("meg_framed_bsq.raw"), "wb");
{
lt_uint32 bytesPerSample = pixelProps.getSample(band).getNumBytes();
lt_uint32 numPixels = sceneBuffer.getNumCols() *
sceneBuffer.getNumRows();
void *bandBuffer = sceneBuffer.getBandData(band);
if(fwrite(bandBuffer, bytesPerSample, numPixels, file) != numPixels)
}
fclose(file);
}
TEST_BOOL( Compare(OUTPUT_PATH("meg_framed_bsq.raw"), INPUT_PATH("meg_framed_bsq.raw")) );
Remove(OUTPUT_PATH("meg_framed_bsq.raw"));
reader = NULL;
}