Go to the documentation of this file.
36 #ifndef SENSOR_MSGS_IMAGE_ENCODINGS_H
37 #define SENSOR_MSGS_IMAGE_ENCODINGS_H
45 namespace image_encodings
47 const std::string
RGB8 =
"rgb8";
48 const std::string
RGBA8 =
"rgba8";
49 const std::string
RGB16 =
"rgb16";
50 const std::string
RGBA16 =
"rgba16";
51 const std::string
BGR8 =
"bgr8";
52 const std::string
BGRA8 =
"bgra8";
53 const std::string
BGR16 =
"bgr16";
54 const std::string
BGRA16 =
"bgra16";
55 const std::string
MONO8=
"mono8";
56 const std::string
MONO16=
"mono16";
101 const std::string
YUV422=
"yuv422";
105 "8UC",
"8SC",
"16UC",
"16SC",
"32SC",
"32FC",
"64FC"};
108 static inline bool isColor(
const std::string& encoding)
110 return encoding ==
RGB8 || encoding ==
BGR8 ||
116 static inline bool isMono(
const std::string& encoding)
121 static inline bool isBayer(
const std::string& encoding)
129 static inline bool hasAlpha(
const std::string& encoding)
166 if (encoding.substr(0, prefix.size()) != prefix)
168 if (encoding.size() == prefix.size())
170 int n_channel = atoi(encoding.substr(prefix.size(),
171 encoding.size() - prefix.size()).c_str());
179 throw std::runtime_error(
"Unknown encoding " + encoding);
183 static inline int bitDepth(
const std::string& encoding)
187 if (encoding ==
MONO8 ||
214 if (encoding.substr(0, prefix.size()) != prefix)
216 if (encoding.size() == prefix.size())
217 return atoi(prefix.c_str());
218 int n_channel = atoi(encoding.substr(prefix.size(),
219 encoding.size() - prefix.size()).c_str());
221 return atoi(prefix.c_str());
227 throw std::runtime_error(
"Unknown encoding " + encoding);
const std::string BAYER_RGGB8
const std::string TYPE_8UC3
const std::string TYPE_8UC1
const std::string TYPE_16SC4
const std::string TYPE_16UC4
const std::string BAYER_GBRG8
static bool isColor(const std::string &encoding)
const std::string TYPE_8UC4
const std::string TYPE_8SC4
const std::string TYPE_64FC3
static bool isBayer(const std::string &encoding)
const std::string ABSTRACT_ENCODING_PREFIXES[]
const std::string TYPE_16UC1
const std::string TYPE_32FC4
const std::string TYPE_16SC3
const std::string TYPE_8SC1
static bool hasAlpha(const std::string &encoding)
const std::string BAYER_BGGR8
const std::string TYPE_32SC2
static int numChannels(const std::string &encoding)
static bool isMono(const std::string &encoding)
const std::string TYPE_8SC3
const std::string BAYER_BGGR16
const std::string TYPE_32SC3
const std::string BAYER_GBRG16
const std::string TYPE_32SC4
static int bitDepth(const std::string &encoding)
const std::string TYPE_16SC2
const std::string TYPE_32FC2
const std::string TYPE_32FC3
const std::string TYPE_32SC1
const std::string TYPE_32FC1
const std::string TYPE_8SC2
const std::string TYPE_8UC2
const std::string TYPE_16UC2
const std::string TYPE_16SC1
const std::string TYPE_64FC4
const std::string TYPE_16UC3
const std::string BAYER_GRBG8
const std::string TYPE_64FC1
Tools for manipulating sensor_msgs.
const std::string BAYER_GRBG16
const std::string TYPE_64FC2
const std::string BAYER_RGGB16
sensor_msgs
Author(s): Tully Foote
autogenerated on Wed Mar 2 2022 00:06:55