26#include <linux/videodev2.h>
80 WDRtype
wdr = WDRtype::Linear;
81 CropType
crop = CropType::Scale;
89 std::string
path()
const;
92 std::string
sopath(
bool delete_old_versions =
false)
const;
104 unsigned int osize()
const;
107 unsigned int csize()
const;
110 unsigned int c2size()
const;
114 static float uvcToFps(
unsigned int interval);
117 static unsigned int fpsToUvc(
float fps);
121 static float v4l2ToFps(
struct v4l2_fract
const & interval);
124 static struct v4l2_fract
fpsToV4l2(float fps);
127 bool match(
unsigned int oformat,
unsigned int owidth,
unsigned int oheight,
float oframespersec)
const;
130 std::string
ostr()
const;
133 std::string
cstr()
const;
136 std::string
c2str()
const;
142 std::string
str()
const;
177 std::vector<VideoMapping>
loadVideoMappings(CameraSensor s,
size_t & defidx,
bool checkso =
true,
178 bool hasgui =
false);
221 bool checkso,
bool hasgui);
Main namespace for all JeVois classes and functions.
Simple struct to hold video mapping definitions for the processing Engine.
WDRtype wdr
Type of wide-dynamic-range (WDR) to use, if sensor supports it.
static struct v4l2_fract fpsToV4l2(float fps)
Convert from fps to V4L2 interval.
unsigned int cfmt
camera pixel format
unsigned int ow
output width
unsigned int csize() const
Return the size in bytes of a camera image.
unsigned int c2fmt
When crop is CropScale, pixel format of the scaled images, otherwise 0.
static float v4l2ToFps(struct v4l2_fract const &interval)
Convert from V4L2 interval to fps.
static unsigned int fpsToUvc(float fps)
Convert from fps to USB/UVC interval.
std::string modinfopath() const
Return the full absolute path and file name of the module's modinfo.html file.
bool hasSameSpecsAs(VideoMapping const &other) const
Equality operator for specs but not vendor or module name.
JEVOIS_DEFINE_ENUM_CLASS(CropType,(Scale)(Crop)(CropScale))
Enum for VideoMapping crop or rescale.
unsigned int c2w
When crop is CropScale, width of the scaled images, otherwise 0.
CropType crop
Type of crop/scale to apply if camera size does not match sensor native.
std::string modulename
Name of the Module that will process this mapping.
unsigned int osize() const
Return the size in bytes of an output image.
std::string ostr() const
Convenience function to print out FCC WxH @ fps, for the output (UVC) format.
std::string cstr() const
Convenience function to print out FCC WxH @ fps, for the input (camera) format.
std::string str() const
Convenience function to print out the whole mapping in a human-friendly way.
std::string c2str() const
Convenience function to print out FCC WxH @ fps, for the scaled camera input format,...
std::string cstrall() const
Convenience function to print out FCC WxH @ fps plus possibly second stream, for the input (camera) f...
float cfps
camera frame rate in frames/sec
JEVOIS_DEFINE_ENUM_CLASS(WDRtype,(Linear)(DOL))
Enum for VideoMapping wide-dynamic-range (WDR) type.
bool ispython
True if the module is written in Python; affects behavior of sopath() only.
std::string menustr2() const
Convenience function to print out the whole mapping in a human-friendly way to be used in a menu.
void setModuleType()
Determine whether module is C++ or python and set ispython flag accordingly.
unsigned int c2size() const
Return the size in bytes of a scaled camera image, if stream==RawAndScaled, otherwise 0.
std::vector< VideoMapping > loadVideoMappings(CameraSensor s, size_t &defidx, bool checkso=true, bool hasgui=false)
Load all the video mappings from the default config file.
std::string path() const
Return the full absolute path the module's directory.
unsigned int cw
camera width
float ofps
output frame rate in frames/sec
unsigned int c2h
When crop is CropScale, height of the scaled images, otherwise 0.
unsigned int ch
camera height
bool isSameAs(VideoMapping const &other) const
Equality operator for specs and also vendor or module name.
unsigned int oh
output height
unsigned int uvcformat
USB-UVC format number (1-based)
static float uvcToFps(unsigned int interval)
Convert from USB/UVC interval to fps.
unsigned int uvcframe
USB UVC frame number (1-based)
std::string srcpath() const
Return the full absolute path and file name of the module's .C or .py file.
std::string menustr() const
Convenience function to print out the whole mapping in a human-friendly way to be used in a menu.
std::ostream & operator<<(std::ostream &out, VideoMapping const &m)
Stream a VideoMapping out, intended for machines.
std::string vendor
Module creator name, used as a directory to organize the modules.
std::string sopath(bool delete_old_versions=false) const
Return the full absolute path and file name of the module's .so or .py file.
bool match(unsigned int oformat, unsigned int owidth, unsigned int oheight, float oframespersec) const
Return true if this VideoMapping's output format is a match to the given output parameters.
std::vector< VideoMapping > videoMappingsFromStream(CameraSensor s, std::istream &is, size_t &defidx, bool checkso, bool hasgui)
Parse all the mappings in a config file and also indicate which one is the default.
std::string cmakepath() const
Return the full absolute path and file name of the module's CMakeLists.txt file.
unsigned int ofmt
output pixel format, or 0 for no output over USB
std::istream & operator>>(std::istream &in, VideoMapping &m)
Stream a VideoMapping in, intended for machines.