#include "main.h"
#include "support.h"
LT_USE_NAMESPACE(LizardTech);
{
const LTFileSpec fileSpec(INPUT_PATH(
"meg_cr20.sid"));
TEST_BOOL(reader != nullptr);
TEST_BOOL(sceneBuffer.getNumCols() == 150);
TEST_BOOL(sceneBuffer.getNumRows() == 150);
TEST_BOOL(sceneBuffer.getTotalNumCols() == 150);
pink.getSample(0).setValueUint8(255);
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 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 = nullptr;
}
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.
lt_uint16 getNumBands() const
get number of bands
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
LTISample & getSample(lt_uint16) const
virtual void release(void) const
decrement the reference counter and delete the object when the counter is zero
lt_uint32 getNumBytes() const
get the size of a sample
representation of a scene
class to hold data passed between image stages
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)