JeVois  1.0
JeVois Smart Embedded Machine Vision Toolkit

Jpeg classes and functions, mainly used to support sending MJPEG video output over USB from raw uncompressed images captured by a camera.

Collaboration diagram for Jpeg-related classes and functions:

Classes

class  jevois::JpegCompressor
 Simple singleton wrapper over a turbojpeg compressor. More...
 

Functions

void jevois::convertYUYVtoYUV422 (unsigned char const *src, int width, int height, unsigned char *dst)
 Helper to convert from packed YUYV to planar YUV422. More...
 
unsigned long jevois::compressBGRtoJpeg (unsigned char const *src, int width, int height, unsigned char *dst, int quality=75)
 Compress raw pixel buffer to jpeg. More...
 
void jevois::compressBGRtoJpeg (cv::Mat const &src, RawImage &dst, int quality=75)
 Compress a BGR cv::Mat into an output JPEG jevois::RawImage. More...
 
unsigned long jevois::compressRGBAtoJpeg (unsigned char const *src, int width, int height, unsigned char *dst, int quality=75)
 Compress raw pixel buffer to jpeg. More...
 
void jevois::compressRGBAtoJpeg (cv::Mat const &src, RawImage &dst, int quality=75)
 Compress an RGBA cv::Mat into an output JPEG jevois::RawImage. More...
 

Function Documentation

unsigned long jevois::compressBGRtoJpeg ( unsigned char const *  src,
int  width,
int  height,
unsigned char *  dst,
int  quality = 75 
)

Compress raw pixel buffer to jpeg.

The compressed size is returned. The dst buffer should have been allocated by caller, with size at least width * height * 2 bytes. quality should be between 1 (worst) and 100 (best).

Definition at line 52 of file Jpeg.C.

References jevois::JpegCompressor::compressor(), and jevois::Singleton< JpegCompressor >::instance().

Referenced by jevois::compressBGRtoJpeg(), and jevois::rawimage::convertCvBGRtoRawImage().

void jevois::compressBGRtoJpeg ( cv::Mat const &  src,
RawImage dst,
int  quality = 75 
)

Compress a BGR cv::Mat into an output JPEG jevois::RawImage.

The dst RawImage should have an allocated buffer, typically this is intended for use with a RawImage that was obtained from the UVC gadget.

Definition at line 80 of file Jpeg.C.

References jevois::RawImage::buf, jevois::compressBGRtoJpeg(), and jevois::RawImage::pixelsw().

unsigned long jevois::compressRGBAtoJpeg ( unsigned char const *  src,
int  width,
int  height,
unsigned char *  dst,
int  quality = 75 
)

Compress raw pixel buffer to jpeg.

The compressed size is returned. The dst buffer should have been allocated by caller, with size at least width * height * 2 bytes. quality should be between 1 (worst) and 100 (best).

Definition at line 66 of file Jpeg.C.

References jevois::JpegCompressor::compressor(), and jevois::Singleton< JpegCompressor >::instance().

Referenced by jevois::compressRGBAtoJpeg(), and jevois::rawimage::convertCvRGBAtoRawImage().

void jevois::compressRGBAtoJpeg ( cv::Mat const &  src,
RawImage dst,
int  quality = 75 
)

Compress an RGBA cv::Mat into an output JPEG jevois::RawImage.

The dst RawImage should have an allocated buffer, typically this is intended for use with a RawImage that was obtained from the UVC gadget.

Definition at line 86 of file Jpeg.C.

References jevois::RawImage::buf, jevois::compressRGBAtoJpeg(), and jevois::RawImage::pixelsw().

void jevois::convertYUYVtoYUV422 ( unsigned char const *  src,
int  width,
int  height,
unsigned char *  dst 
)

Helper to convert from packed YUYV to planar YUV422.

Memory must have been allocated by caller.

Definition at line 35 of file Jpeg.C.