15 #ifndef VISIONTRANSFER_IMAGESET_H
16 #define VISIONTRANSFER_IMAGESET_H
20 #include "visiontransfer/common.h"
22 namespace visiontransfer {
38 class VT_EXPORT ImageSet {
46 static const int MAX_SUPPORTED_IMAGES = 4;
65 enum ImageFormat_Deprecated {
66 FORMAT_8_BIT = FORMAT_8_BIT_MONO,
67 FORMAT_12_BIT = FORMAT_12_BIT_MONO
104 void setHeight(
int h);
113 void setRowStride(
int imageNumber,
int stride);
122 void setPixelFormat(
int imageNumber,
ImageFormat format);
124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
125 DEPRECATED(
"Use setPixelFormat(int, ImageFormat) instead") void setPixelFormat(
int imageNumber,
ImageFormat_Deprecated format) {
126 setPixelFormat(imageNumber,
static_cast<ImageFormat>(format));
137 void setPixelData(
int imageNumber,
unsigned char* pixelData);
145 void setQMatrix(
const float* q);
150 void setSequenceNumber(
unsigned int num);
159 void setTimestamp(
int seconds,
int microsec);
168 void setDisparityRange(
int minimum,
int maximum);
173 void setSubpixelFactor(
int subpixFact);
175 #ifndef DOXYGEN_SHOULD_SKIP_THIS
183 DEPRECATED(
"Only compatible with two-image sets: use setNumberOfImages() and setIndexOf() instead")
184 void setImageDisparityPair(
bool dispPair);
190 int getWidth()
const;
195 int getHeight()
const;
206 int getRowStride(
int imageNumber)
const;
216 int getRowStride(ImageType what)
const;
227 ImageFormat getPixelFormat(
int imageNumber)
const;
237 ImageFormat getPixelFormat(ImageType what)
const;
248 unsigned char* getPixelData(
int imageNumber)
const;
258 unsigned char* getPixelData(ImageType what)
const;
263 const float* getQMatrix()
const;
268 unsigned int getSequenceNumber()
const;
277 void getTimestamp(
int& seconds,
int& microsec)
const;
287 void getDisparityRange(
int& minimum,
int& maximum)
const;
292 int getSubpixelFactor()
const;
300 void writePgmFile(
int imageNumber,
const char* fileName)
const;
302 #ifndef DOXYGEN_SHOULD_SKIP_THIS
315 DEPRECATED(
"Only compatible with two-image sets: use hasImageType(ImageSet::IMAGE_DISPARITY) instead")
316 bool isImageDisparityPair()
const {
317 return (getNumberOfImages()==2) && hasImageType(IMAGE_DISPARITY);
324 void copyTo(ImageSet& dest);
332 int getBytesPerPixel(
int imageNumber)
const;
340 int getBitsPerPixel(
int imageNumber)
const;
342 int getBitsPerPixel(ImageType what)
const;
344 static int getBitsPerPixel(ImageFormat format);
350 static int getBytesPerPixel(ImageFormat format);
355 int getNumberOfImages()
const;
360 void setNumberOfImages(
int number);
365 ImageType getImageType(
int imageNumber)
const;
375 int getIndexOf(ImageType what,
bool throwIfNotFound=
false)
const;
380 bool hasImageType(ImageType what)
const;
389 void setIndexOf(ImageType what,
int idx);
392 #ifdef CV_MAJOR_VERSION
407 inline void toOpenCVImage(
int imageNumber, cv::Mat& dest,
bool convertRgbToBgr =
true);
415 void setExposureTime(
int timeMicrosec);
423 int getExposureTime()
const;
432 void setLastSyncPulse(
int seconds,
int microsec);
441 void getLastSyncPulse(
int& seconds,
int& microsec)
const;
445 #ifndef DOXYGEN_SHOULD_SKIP_THIS
447 class DEPRECATED("Use ImageSet instead.") ImagePair:
public ImageSet {
453 #include "visiontransfer/imageset-opencv.h"