22#include <opencv2/core/core.hpp>
32 cv::Mat
cvImage(RawImage
const & src);
98 void paste(RawImage
const & src, RawImage & dest,
int dx,
int dy);
102 void pasteGreyToYUYV(cv::Mat
const & src, RawImage & dest,
int dx,
int dy);
106 void pasteBGRtoYUYV(cv::Mat
const & src, RawImage & dst,
int dx,
int dy);
110 void pasteRGBtoYUYV(cv::Mat
const & src, RawImage & dst,
int dx,
int dy);
115 void roipaste(RawImage
const & src,
int x,
int y,
unsigned int w,
unsigned int h, RawImage & dest,
int dx,
int dy);
119 void drawDisk(RawImage & img,
int x,
int y,
unsigned int rad,
unsigned int col);
123 void drawCircle(RawImage & img,
int x,
int y,
unsigned int rad,
unsigned int thick,
unsigned int col);
128 bool clipLine(
int wxmin,
int wymin,
int wxmax,
int wymax,
int & x1,
int & y1,
int & x2,
int & y2);
132 void drawLine(RawImage & img,
int x1,
int y1,
int x2,
int y2,
unsigned int thick,
unsigned int col);
137 void drawRect(RawImage & img,
int x,
int y,
unsigned int w,
unsigned int h,
unsigned int thick,
unsigned int col);
143 void drawRect(RawImage & img,
int x,
int y,
unsigned int w,
unsigned int h,
unsigned int col);
149 void drawFilledRect(RawImage & img,
int x,
int y,
unsigned int w,
unsigned int h,
unsigned int col);
295 cv::Mat
rescaleCv(cv::Mat
const & img, cv::Size
const & newdims);
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
cv::Mat convertToCvRGBA(RawImage const &src)
Convert RawImage to OpenCV doing color conversion from any RawImage source pixel to OpenCV RGB-A byte...
void paste(RawImage const &src, RawImage &dest, int dx, int dy)
Paste an image within another of same pixel type.
bool clipLine(int wxmin, int wymin, int wxmax, int wymax, int &x1, int &y1, int &x2, int &y2)
Clip a line to fit inside a viewport [wxmin...wxmax[ x [wymin...wymax[.
void convertCvGRAYtoCvYUYV(cv::Mat const &src, cv::Mat &dst)
OpenCV does not provide conversion from GRAY to YUYV in cvtColor(), so this function provides it.
cv::Mat cvImage(RawImage const &src)
Create an OpenCV image from the existing RawImage data, sharing the pixel memory rather than copying ...
void writeText(RawImage &img, std::string const &txt, int x, int y, unsigned int col, Font font=Font6x10)
Write some text in an image.
cv::Mat convertToCvGray(RawImage const &src)
Convert RawImage to OpenCV doing color conversion from any RawImage source pixel to OpenCV gray byte.
void convertCvBGRtoCvYUYV(cv::Mat const &src, cv::Mat &dst)
OpenCV does not provide conversion from BGR to YUYV in cvtColor(), so this function provides it.
void pasteRGBtoYUYV(cv::Mat const &src, RawImage &dst, int dx, int dy)
Paste a RGB byte image into a YUYV image.
cv::Mat convertToCvRGB(RawImage const &src)
Convert RawImage to OpenCV doing color conversion from any RawImage source pixel to OpenCV RGB byte.
void drawFilledRect(RawImage &img, int x, int y, unsigned int w, unsigned int h, unsigned int col)
Draw a filled rectangle in a YUYV image.
void drawDisk(RawImage &img, int x, int y, unsigned int rad, unsigned int col)
Draw a disk in a YUYV image.
void convertCvRGBAtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert an RGBA cv::Mat to RawImage with already-allocated pixels and pixel type.
cv::Mat rescaleCv(cv::Mat const &img, cv::Size const &newdims)
Rescale an OpenCV image, choosing the right kind of interpolation.
Font
Available fonts for writeText()
cv::Mat convertToCvBGR(RawImage const &src)
Convert RawImage to OpenCV doing color conversion from any RawImage source pixel to OpenCV BGR byte.
void convertCvBGRtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a BGR cv::Mat to RawImage with already-allocated pixels and pixel type.
void drawLine(RawImage &img, int x1, int y1, int x2, int y2, unsigned int thick, unsigned int col)
Draw a line in a YUYV image.
void convertCvRGBtoCvYUYV(cv::Mat const &src, cv::Mat &dst)
OpenCV does not provide conversion from RGB to YUYV in cvtColor(), so this function provides it.
void convertCvRGBtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a RGB cv::Mat to RawImage with already-allocated pixels and pixel type.
void unpackCvRGBAtoGrayRawImage(cv::Mat const &src, RawImage &dst)
Split an RGBA cv::Mat into a 4x taller grey RawImage with already-allocated pixels.
void drawRect(RawImage &img, int x, int y, unsigned int w, unsigned int h, unsigned int thick, unsigned int col)
Draw a rectangle in a YUYV image.
void hFlipYUYV(RawImage &img)
Flip a YUYV RawImage horizontally while preserving color information.
void roipaste(RawImage const &src, int x, int y, unsigned int w, unsigned int h, RawImage &dest, int dx, int dy)
Paste an ROI from an image to within another of same pixel type.
void byteSwap(RawImage &img)
Swap pairs of bytes in a RawImage.
void convertCvRGBAtoCvYUYV(cv::Mat const &src, cv::Mat &dst)
OpenCV does not provide conversion from RGBA to YUYV in cvtColor(), so this function provides it.
void convertCvGRAYtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a Gray cv::Mat to RawImage with already-allocated pixels and pixel type.
int itext(RawImage &img, std::string const &txt, int y=3, unsigned int col=jevois::yuyv::White, Font font=Font6x10)
Shorthand to write some text in an image, with x = 3 and return the next y position.
void drawCircle(RawImage &img, int x, int y, unsigned int rad, unsigned int thick, unsigned int col)
Draw a circle in a YUYV image.
void pasteGreyToYUYV(cv::Mat const &src, RawImage &dest, int dx, int dy)
Paste a grey byte image into a YUYV image.
void pasteBGRtoYUYV(cv::Mat const &src, RawImage &dst, int dx, int dy)
Paste a BGR byte image into a YUYV image.
void convertBayerToYUYV(RawImage const &src, RawImage &dst)
Convert from Bayer to YUYV, only used internally by Camera class.
void convertGreyToYUYV(RawImage const &src, RawImage &dst)
Convert from Grey (monochrome) to YUYV, only used internally by Camera class.
unsigned short constexpr White
YUYV color value.
Main namespace for all JeVois classes and functions.