#include "main.h"
#include "support.h"
LT_USE_NAMESPACE(LizardTech);
{
TEST_BOOL(reader != nullptr);
const LTIScene scene(0, 0, 256, 256, 1.0);
scene.getNumCols(),
scene.getNumRows(),
nullptr);
TEST_SUCCESS(reader->
read(scene, sceneBuffer));
sceneBuffer.byteSwap();
FILE *file = fopen(OUTPUT_PATH("Tile7_rgbn_utm15-ia.bsq"), "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(OUTPUT_PATH("Tile7_rgbn_utm15-ia.bsq"), INPUT_PATH("Tile7_rgbn_utm15-ia.bsq")));
Remove(OUTPUT_PATH("Tile7_rgbn_utm15-ia.bsq"));
}
lt_uint32 LT_STATUS
An integral status code.
#define LT_STS_Uninit
status code indicating unintialized variable
#define LT_STS_Failure
status code indicating failure
#define LT_STS_Success
status code indicating success
unsigned short lt_uint16
unsigned 16-bit integer
unsigned int lt_uint32
unsigned 32-bit integer
Represents a file or directory path.
const LTIPixel & getPixelProps() const
get the pixel properties of the image
LT_STATUS read(const LTIScene &scene, LTISceneBuffer &buffer)
read (decode) a scene from the image
basic properties of a pixel
representation of a scene
class to hold data passed between image stages
static bool needsSwapping(LTIDataType datatype, LTIEndian byteOrder)
reader for MrSID images (MG2, MG3 and MG4)
LT_STATUS initialize(const LTFileSpec &fileSpec, bool useWorldFile=false, MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT, MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT)
initializer
static MrSIDImageReader * create(void)