#include "main.h"
#include "support.h"
LT_USE_NAMESPACE(LizardTech);
{
private:
public:
{
return sts;
return sts;
}
{
if (getPreviousStage())
mods = getPreviousStage()->getModifications(scene);
return mods;
}
protected:
{
return getPreviousStage()->readBegin(getPreviousStage()->
getPixelProps(),
fullScene);
}
{
width, height, nullptr);
sts = getPreviousStage()->readStrip(srcData, stripScene);
return sts;
{
{
gray[c] =
static_cast<lt_uint8>(0.3f * red[c] +
0.6f * green[c] +
0.1f * blue[c]);
}
red += srcData.getTotalNumCols();
green += srcData.getTotalNumCols();
blue += srcData.getTotalNumCols();
}
}
{
return getPreviousStage()->readEnd();
}
};
MyFilter::MyFilter(void) {}
MyFilter::~MyFilter() {}
MyFilter *MyFilter::create(void)
{
return new MyFilter;
}
{
TEST_BOOL(reader != nullptr);
MyFilter *filter = MyFilter::create();
TEST_BOOL(filter != nullptr);
TEST_SUCCESS(filter->initialize(reader));
const LTIScene scene(0, 0, 640, 480, 1.0);
TEST_SUCCESS(writer.
write(scene));
TEST_BOOL(Compare(OUTPUT_PATH("meg_gray.bip"), INPUT_PATH("meg_gray.bip")));
Remove(OUTPUT_PATH("meg_gray.bip"));
Remove(OUTPUT_PATH("meg_gray.hdr"));
filter->release();
filter = nullptr;
reader = nullptr;
}
#define LTI_REFERENCE_COUNTED_BOILERPLATE(classname)
@ LTI_MODIFICATION_CHANGEDCOLORSPACE
@ LTI_MODIFICATION_UNKNOWN
@ LTI_COLORSPACE_GRAYSCALE
lt_uint32 LT_STATUS
An integral status code.
#define LT_STS_Uninit
status code indicating unintialized variable
#define LT_SUCCESS(err)
checks return value for success status
#define LT_STS_Failure
status code indicating failure
#define LT_STS_Success
status code indicating success
unsigned char lt_uint8
unsigned 8-bit integer
unsigned int lt_uint32
unsigned 32-bit integer
signed int lt_int32
signed 32-bit integer
Represents a file or directory path.
read an image from a BBB file
static LTIBBBImageReader * create(void)
LT_STATUS initialize(const LTFileSpec &fileSpec, bool useWorldFile=true)
intializer
writes an image stage to a BBB file
virtual LT_STATUS setOutputFileSpec(const LTFileSpec &fileSpec)
set output file name
LTIDataType getDataType() const
get data type
LTIColorSpace getColorSpace() const
get colorspace
LT_STATUS init(LTIImageStage *previousStage)
abstract class for decoding from an image
LT_STATUS setPixelProps(const LTIPixel &pixelProps)
set pixel properties of the image
const LTIPixel & getPixelProps() const
virtual LT_STATUS write(const LTIScene &scene)
write (encode) a scene to the output format
basic properties of a pixel
LT_STATUS initialize(LTIImageStage *imageStage)
initialization function
virtual void release(void) const
decrement the reference counter and delete the object when the counter is zero
representation of a scene
lt_int32 getNumRows() const
returns the height of the scene
lt_int32 getNumCols() const
returns the width of the scene
class to hold data passed between image stages
lt_int32 getTotalNumCols() const
get width of (entire) buffer
void * getBandData(lt_uint16 band) const
get pointer to data (for 1 band)