#ifndef _SER_H_ #define _SER_H_ enum { SER_COLORID_MONO = 0, SER_COLORID_BAYER_RGGB = 8, SER_COLORID_BAYER_GRBG = 9, SER_COLORID_BAYER_GBRG = 10, SER_COLORID_BAYER_BGGR = 11, SER_COLORID_BAYER_CYYM = 16, SER_COLORID_BAYER_YCMY = 17, SER_COLORID_BAYER_YMCY = 18, SER_COLORID_BAYER_MYYC = 19, SER_COLORID_RGB = 100, SER_COLORID_BGR = 101 }; struct SER_Header { char FileID[40]; /* "LUCAM-RECORDER" (fix) */ int32_t LuID; /* Lumenera camera series ID (currently unused; default = 0) */ int32_t ColorID; /* see SER_COLORID_* */ int32_t LittleEndian; /* 0 (FALSE) for big-endian, 1 (TRUE) for little-endian */ int32_t ImageWidth; /* Width of every image in pixel */ int32_t ImageHeight; /* Height of every image in pixel */ int32_t PixelDepthPerPlane; /* True bit depth per pixel per plane */ int32_t FrameCount; /* Number of image frames in SER file */ char Observer[40]; /* Name of observer */ char Instrument[40]; /* Name of used camera */ char Telescope[40]; /* Name of used telescope */ int64_t DateTime; /* Start time of image stream (local time) */ int64_t DateTimeUTC; /* Start time of image stream in UTC */ }; class SER { private: /* header data */ struct SER_Header header; /* internal data */ FILE *fd; int NumberOfPlanes; int BytesPerPixel; size_t FrameSize; void * Frame; void updateHeaderData(void); public: SER(); ~SER(); int setObserver(char *); int setInstrument(char *); int setTelescope(char *); int setWidth(int); int setHeight(int); int setColorID(int); int32_t getNumberOfFrames(void); void setNumberOfFrames(int32_t); int64_t setDateTime(void); int64_t differenceLocalUTC(void); int setFile(char *); int writeHeader(void); int appendFrame(void *); int readFrame(void *); void * allocFrame(void); }; #endif