82 cvcam_critical_section.
Lock();
84 if (pCapturedImage && (pCapturedImage->
width != pImage->
width || pCapturedImage->
height != pImage->
height || pCapturedImage->
type != pImage->
type))
94 unsigned char *output = pCapturedImage->
pixels;
99 for (
int i = 0; i < nBytes; i += 3)
101 output[i] = input[i + 2];
102 output[i + 1] = input[i + 1];
103 output[i + 2] = input[i];
108 memcpy(output, input, nBytes);
115 cvcam_critical_section.
UnLock();
158 if (cvcamGetCamerasCount() <= 0)
162 cvcamSetProperty(0, CVCAM_PROP_ENABLE, CVCAMTRUE);
163 cvcamSetProperty(0, CVCAM_PROP_RENDER, CVCAMTRUE);
165 cvcamSetProperty(0, CVCAM_PROP_CALLBACK, (
void*)
callback);
188 if (!ppImages || !ppImages[0])
193 cvcam_critical_section.
Lock();
197 cvcam_critical_section.
UnLock();
204 cvcam_critical_section.
UnLock();
210 cvcam_critical_section.
UnLock();
217 return pCapturedImage ? pCapturedImage->
width : -1;
222 return pCapturedImage ? pCapturedImage->
height : -1;
int width
The width of the image in pixels.
CByteImage::ImageType GetType()
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Implementation of mutexes for synchronization.
Threading::EMutexStatus UnLock()
unsigned char * pixels
The pointer to the the pixels.
bool FlipY(const CByteImage *pInputImage, CByteImage *pOutputImage)
Flips the rows in a CByteImage vertically and writes the result to a CByteImage.
bool CopyImage(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion *pROI=0, bool bUseSameSize=false)
Copies one CByteImage to another.
Threading::EMutexStatus Lock()
int height
The height of the image in pixels.
static CByteImage * pCapturedImage
int bytesPerPixel
The number of bytes used for encoding one pixel.
ImageType
Enum specifying the supported image types.
GLenum GLenum GLenum input
ImageType type
The type of the image.
IplImage * Adapt(const CByteImage *pImage, bool bAllocateMemory=false)
Converts a CByteImage to an IplImage.
CMutex cvcam_critical_section
bool CaptureImage(CByteImage **ppImages)
static void callback(IplImage *pIplImage)