27#define ISP_V4L2_PIX_FMT_META v4l2_fourcc( 'M', 'E', 'T', 'A' )
31#define JEVOISPRO_FMT_GUI v4l2_fourcc( 'J', 'V', 'U', 'I' )
42 std::string
fccstr(
unsigned int fcc);
45 std::string
cvtypestr(
unsigned int cvtype);
52 unsigned int strfcc(std::string
const & str);
58 unsigned int v4l2ImageSize(
unsigned int fcc,
unsigned int width,
unsigned int height);
76 void applyLetterBox(
unsigned int & imw,
unsigned int & imh,
unsigned int const winw,
unsigned int const winh,
80 std::vector<std::string>
split(std::string
const & input, std::string
const & regex =
"\\s+");
85 std::string
join(std::vector<T>
const & tokens, std::string
const & delimiter);
89 std::string
join<std::string>(std::vector<std::string>
const & tokens, std::string
const & delimiter);
99 std::string
strip(std::string
const & str);
103 std::string
extractString(std::string
const & str, std::string
const & startsep, std::string
const & endsep);
107 size_t replaceStringFirst(std::string & str, std::string
const & from, std::string
const & to);
111 size_t replaceStringAll(std::string & str, std::string
const & from, std::string
const & to);
115 std::string
replaceAll(std::string
const & str, std::string
const & from, std::string
const & to);
118 std::string
tolower(std::string
const & str);
123 std::filesystem::path
absolutePath(std::filesystem::path
const & root, std::filesystem::path
const & path);
134 std::string
sformat(
char const * fmt, ...)
138 __attribute__((format(__printf__, 1, 2)));
150 template <
typename T>
151 typename std::enable_if< ! std::is_integral<T>::value, T>::type
from_string(std::string
const & str);
155 template <
typename T>
156 typename std::enable_if<std::is_integral<T>::value, T>::type
from_string(std::string
const & str);
161 template <
typename T>
165 template <
typename dest_type,
typename source_type>
174 std::string
system(std::string
const & cmd,
bool errtoo =
true);
180 std::string
secs2str(std::vector<double> secs);
184 void secs2str(std::ostringstream & ss,
double secs);
191 void num2str(std::ostringstream & ss,
double n);
211#define XIOCTL(dev, req, mem) { }
222#define XIOCTL_QUIET(dev, req, mem) { }
234#define XIOCTL_QUIET_ONCE(dev, req, mem) { }
238#include <jevois/Util/details/UtilsImpl.H>
std::string join< std::string >(std::vector< std::string > const &tokens, std::string const &delimiter)
Concatenate a vector of string tokens into a string.
unsigned int cvBytesPerPix(unsigned int cvtype)
Return the number of bytes per pixel for a given OpenCV pixel type.
std::string strip(std::string const &str)
Strip white space (including CR, LF, tabs, etc) from the end of a string.
size_t replaceStringFirst(std::string &str, std::string const &from, std::string const &to)
Replace first instance of 'from' with 'to'.
unsigned int strfcc(std::string const &str)
Convert a JeVois video format string to V4L2 four-cc code (V4L2_PIX_FMT_...)
void flushcache()
Flush the caches, may sometimes be useful when running the camera in turbo mode.
std::string num2str(double n)
Report a number with variable multipliers (K, M, G, T, P, E, Z, Y), with precision of 2 decimal point...
std::string extractString(std::string const &str, std::string const &startsep, std::string const &endsep)
Extract a portion of a string between two delimiters.
unsigned int v4l2BytesPerPix(unsigned int fcc)
Return the number of bytes per pixel for a given V4L2_PIX_FMT_...
std::string tolower(std::string const &str)
Convert string to lowercase.
std::string secs2str(double secs)
Report a duration given in seconds with variable units (ns, us, ms, or s), with precision of 2 decima...
std::string getFileString(char const *fname, int skip=0)
Read one line from a file and return it as a string.
std::string cvtypestr(unsigned int cvtype)
Convert cv::Mat::type() code to to a string (e.g., CV_8UC1, CV_32SC3, etc)
std::string system(std::string const &cmd, bool errtoo=true)
Execute a command and grab stdout output to a string.
std::string join(std::vector< T > const &tokens, std::string const &delimiter)
Concatenate a vector of tokens into a string.
unsigned int whiteColor(unsigned int fcc)
Return a value that corresponds to white for the given video format.
std::string T from_string(std::string const &str)
Convert from string to a type.
std::string sformat(char const *fmt,...) __attribute__((format(__printf__
Create a string using printf style arguments.
std::string replaceWhitespace(std::string const &str, char rep='_')
Replace white space characters in a string with underscore (default) or another character.
dest_type clamped_convert(source_type source)
Clamped numerical conversion.
size_t replaceStringAll(std::string &str, std::string const &from, std::string const &to)
Replace all instances of 'from' with 'to'.
std::filesystem::path absolutePath(std::filesystem::path const &root, std::filesystem::path const &path)
Compute an absolute path from two paths.
bool stringStartsWith(std::string const &str, std::string const &prefix)
Return true if str starts with prefix (including if both strings are equal)
std::string fccstr(unsigned int fcc)
Convert a V4L2 four-cc code (V4L2_PIX_FMT_...) to a 4-char string.
std::vector< std::string > split(std::string const &input, std::string const ®ex="\\s+")
Split string into vector of tokens using a regex to specify what to split on; default regex splits by...
void applyLetterBox(unsigned int &imw, unsigned int &imh, unsigned int const winw, unsigned int const winh, bool noalias)
Apply a letterbox resizing to fit an image into a window.
std::string to_string(T const &val)
Convert from type to string.
unsigned int blackColor(unsigned int fcc)
Return a value that corresponds to black for the given video format.
unsigned int v4l2ImageSize(unsigned int fcc, unsigned int width, unsigned int height)
Return the image size in bytes for a given V4L2_PIX_FMT_..., width, height.
std::string replaceAll(std::string const &str, std::string const &from, std::string const &to)
Replace all instances of 'from' with 'to'.
Main namespace for all JeVois classes and functions.