10#include "webcface/common/webcface-config.h"
21 const Image &request(std::optional<int> rows, std::optional<int> cols,
23 std::optional<ImageColorMode> color_mode,
24 std::optional<double> frame_rate)
const;
32 using Field::lastName;
84 return child(std::to_string(index));
106 template <
typename F,
typename std::enable_if_t<std::is_invocable_v<F>,
107 std::
nullptr_t> =
nullptr>
110 [callback = std::move(callback)](
const auto &) { callback(); });
119 template <
typename T>
121 onChange(std::forward<T>(callback));
139 const Image &tryRequest()
const;
155 [[deprecated(
"Ambiguous image size")]]
157 request(std::optional<int> rows, std::optional<int> cols = std::nullopt,
158 std::optional<ImageColorMode> color_mode = std::nullopt,
159 std::optional<double> frame_rate = std::nullopt)
const {
160 return request(rows, cols, ImageCompressMode::raw, 0, color_mode,
175 request(std::optional<SizeOption> size = std::nullopt,
176 std::optional<ImageColorMode> color_mode = std::nullopt,
177 std::optional<double> frame_rate = std::nullopt)
const {
178 return request(size.value_or(
SizeOption{}).rows(),
180 ImageCompressMode::raw, 0, color_mode, frame_rate);
198 [[deprecated(
"Ambiguous image size")]]
200 request(std::optional<int> rows, std::optional<int> cols,
202 std::optional<double> frame_rate = std::nullopt)
const {
203 return request(rows, cols, cmp_mode, quality, std::nullopt, frame_rate);
222 std::optional<double> frame_rate = std::nullopt)
const {
223 return request(size.value_or(
SizeOption{}).rows(),
224 size.value_or(
SizeOption{}).cols(), cmp_mode, quality,
225 std::nullopt, frame_rate);
233 std::optional<ImageFrame> tryGet()
const;
259 [[deprecated]] std::chrono::system_clock::time_point time()
const;
262 const Image &free()
const;
265 const Image &clear()
const;
271 template <
typename T,
typename std::enable_if_t<std::is_same_v<T, Image>,
272 std::
nullptr_t> =
nullptr>
274 return static_cast<Field>(*this) ==
static_cast<Field>(other);
276 template <
typename T,
typename std::enable_if_t<std::is_same_v<T, Image>,
277 std::
nullptr_t> =
nullptr>
279 return static_cast<Field>(*this) !=
static_cast<Field>(other);
(ver1.3から追加) 画像データ
Definition image_frame.h:101
(ver1.3から追加) 画像の送受信データを表すクラス
Definition image.h:20
Image operator[](int index) const
Definition image.h:83
const Image & operator=(const ImageFrame &img) const
画像をセットする
Definition image.h:133
bool operator==(const T &other) const
Imageの参照先を比較
Definition image.h:273
Image child(int index) const
Definition image.h:55
Image operator[](const wchar_t *field) const
Definition image.h:76
Image child(std::wstring_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField (wstring)
Definition image.h:47
const Image & request(std::optional< SizeOption > size, ImageCompressMode cmp_mode, int quality, std::optional< double > frame_rate=std::nullopt) const
画像を圧縮されたフォーマットでリクエストする
Definition image.h:220
const Image & onChange(F callback) const
値が変化したときに呼び出されるコールバックを設定
Definition image.h:108
const Image & request(std::optional< int > rows, std::optional< int > cols=std::nullopt, std::optional< ImageColorMode > color_mode=std::nullopt, std::optional< double > frame_rate=std::nullopt) const
画像を生画像のフォーマットでリクエストする
Definition image.h:157
Image operator[](const char *field) const
Definition image.h:72
Image operator[](std::string_view field) const
Definition image.h:62
bool operator!=(const T &other) const
Definition image.h:278
ImageFrame get() const
画像を返す (データがない場合0x0の画像が返る)
Definition image.h:240
void appendListener(T &&callback) const
Definition image.h:120
Image operator[](std::wstring_view field) const
Definition image.h:67
const Image & request(std::optional< int > rows, std::optional< int > cols, ImageCompressMode cmp_mode, int quality, std::optional< double > frame_rate=std::nullopt) const
画像を圧縮されたフォーマットでリクエストする
Definition image.h:200
Image child(std::string_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField
Definition image.h:40
const Image & request(std::optional< SizeOption > size=std::nullopt, std::optional< ImageColorMode > color_mode=std::nullopt, std::optional< double > frame_rate=std::nullopt) const
画像を生画像のフォーマットでリクエストする
Definition image.h:175
Image parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition image.h:90
Image(const Field &base, const SharedString &field)
Definition image.h:29
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:67
Definition image_frame.h:59
ImageCompressMode
Definition image_frame.h:23
ClientDataの参照とメンバ名とデータ名を持つクラス
Definition field.h:71
Field parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition field.cc:33
Field child(const SharedString &field) const
Definition field.cc:42
#define WEBCFACE_DLL
Definition webcface-config.h:69
#define WEBCFACE_NS_END
Definition webcface-config.h:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117
#define WEBCFACE_CALL_FP
Definition webcface-config.h:107