7#ifndef MSGPACK_DEFINE_MAP
8#define MSGPACK_DEFINE_MAP(...)
31#ifdef MSGPACK_ADD_ENUM
40 int width_ = 0, height_ = 0;
41 std::shared_ptr<std::vector<unsigned char>>
data_;
45 bool empty()
const {
return !data_ || data_->empty(); }
48 throw "ImageFrame data is empty";
54 throw "ImageFrame data is empty";
66 MSGPACK_NVP(
"h", height_), MSGPACK_NVP(
"w", width_),
67 MSGPACK_NVP(
"l", color_mode_),
68 MSGPACK_NVP(
"p", cmp_mode_))
72 std::optional<int> rows = std::nullopt, cols = std::nullopt;
73 std::optional<ImageColorMode> color_mode = std::nullopt;
76 std::optional<double> frame_rate = std::nullopt;
79 return rows == rhs.
rows && cols == rhs.
cols &&
96 unsigned int req_id,
const ImageReq &ireq)
98 member(member), field(field), req_id(req_id) {}
100 MSGPACK_NVP(
"f", field), MSGPACK_NVP(
"w", cols),
101 MSGPACK_NVP(
"h", rows), MSGPACK_NVP(
"l", color_mode),
102 MSGPACK_NVP(
"p", cmp_mode), MSGPACK_NVP(
"q", quality),
103 MSGPACK_NVP(
"r", frame_rate))
108 unsigned int req_id = 0;
114 req_id(req_id), sub_field(sub_field) {}
116 MSGPACK_NVP(
"d", data_), MSGPACK_NVP(
"w", width_),
117 MSGPACK_NVP(
"h", height_), MSGPACK_NVP(
"l", color_mode_),
118 MSGPACK_NVP(
"p", cmp_mode_))
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
#define MSGPACK_DEFINE_MAP(...)
Definition canvas2d.h:10
ImageCompressMode
Definition image.h:21
ImageColorMode
Definition image.h:14
unsigned char * rawPtr() const
Definition image.h:46
bool empty() const
Definition image.h:45
std::size_t rawSize() const
Definition image.h:52
std::shared_ptr< std::vector< unsigned char > > data_
Definition image.h:41
std::optional< int > rows
Definition image.h:72
std::optional< ImageColorMode > color_mode
Definition image.h:73
bool operator!=(const ImageReq &rhs) const
Definition image.h:83
bool operator==(const ImageReq &rhs) const
Definition image.h:78
int quality
Definition image.h:75
ImageCompressMode cmp_mode
Definition image.h:74
std::optional< int > cols
Definition image.h:72
SharedString field
Definition image.h:60
Image(const SharedString &field, const ImageFrame &img)
Definition image.h:62
型からkindを取得するためだけのベースクラス
Definition base.h:53
unsigned int req_id
Definition image.h:92
SharedString field
Definition image.h:91
SharedString member
Definition image.h:90
Req(const SharedString &member, const SharedString &field, unsigned int req_id, const ImageReq &ireq)
Definition image.h:95
client->server 以降Recvを送るようリクエスト
Definition pack.h:40
Res(unsigned int req_id, const SharedString &sub_field, const ImageFrame &img)
Definition image.h:111
SharedString sub_field
Definition image.h:109
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103