15 #ifndef VISIONTRANSFER_IMAGEPAIR_H 16 #define VISIONTRANSFER_IMAGEPAIR_H 20 #include "visiontransfer/common.h" 52 FORMAT_8_BIT = ImageFormat::FORMAT_8_BIT_MONO,
53 FORMAT_12_BIT = ImageFormat::FORMAT_12_BIT_MONO
87 assert(imageNumber >= 0 && imageNumber <=1);
88 rowStride[imageNumber] = stride;
99 assert(imageNumber >= 0 && imageNumber <=1);
100 formats[imageNumber] = format;
103 #ifndef DOXYGEN_SHOULD_SKIP_THIS 105 setPixelFormat(imageNumber, static_cast<ImageFormat>(format));
117 assert(imageNumber >= 0 && imageNumber <=1);
118 data[imageNumber] = pixelData;
147 timeMicrosec = microsec;
158 minDisparity = minimum;
159 maxDisparity = maximum;
167 disparityPair = dispPair;
187 assert(imageNumber >= 0 && imageNumber <=1);
188 return rowStride[imageNumber];
198 assert(imageNumber >= 0 && imageNumber <=1);
199 return formats[imageNumber];
209 assert(imageNumber >= 0 && imageNumber <=1);
210 return data[imageNumber];
234 microsec = timeMicrosec;
246 minimum = minDisparity;
247 maximum = maxDisparity;
256 void writePgmFile(
int imageNumber,
const char* fileName)
const;
263 return disparityPair;
276 assert(imageNumber >= 0 && imageNumber <=1);
277 return getBytesPerPixel(formats[imageNumber]);
293 unsigned char* data[2];
294 const float* qMatrix;
301 int* referenceCounter;
304 void decrementReference();
bool isImageDisparityPair() const
Returns true if this is a left camera image and disparity map pair.
void setTimestamp(int seconds, int microsec)
Sets the time at which this image pair has been captured.
void setHeight(int h)
Sets a new width for both images.
void setSequenceNumber(unsigned int num)
Sets the sequence number for this image pair.
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
unsigned char * getPixelData(int imageNumber) const
Returns the pixel data for the given image.
const float * getQMatrix() const
Returns a pointer to the disparity-to-depth mapping matrix q.
int getWidth() const
Returns the width of each image.
void setDisparityRange(int minimum, int maximum)
Sets the value range for the disparity map contained in this image pair.
void setWidth(int w)
Sets a new width for both images.
int getBytesPerPixel(int imageNumber) const
Returns the number of bytes that are required to store one image pixel.
void setQMatrix(const float *q)
Sets the pointer to the disparity-to-depth mapping matrix q.
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
void getTimestamp(int &seconds, int µsec) const
Returns the time at which this image pair has been captured.
void setPixelData(int imageNumber, unsigned char *pixelData)
Sets the pixel data for the given image.
void getDisparityRange(int &minimum, int &maximum) const
Gets the value range for the disparity map contained in this image pair. If the image pair does not c...
A set of two images, which are usually the left camera image and the disparity map.
ImageFormat getPixelFormat(int imageNumber) const
Returns the pixel format for the given image.
int getHeight() const
Returns the height of each image.
unsigned int getSequenceNumber() const
Returns the sequence number for this image pair.
int getRowStride(int imageNumber) const
Returns the row stride for the pixel data of one image.
void setImageDisparityPair(bool dispPair)
Sets whether this is a left camera image and disparity map pair, or two raw camera images...
ImageFormat
Image formats that can be transferred.