8#include "webcface/common/webcface-config.h"
32 Size(
int width,
int height) : w_(width), h_(height) {}
38 int width()
const {
return w_; }
40 int rows()
const {
return h_; }
41 int cols()
const {
return w_; }
49 return Size{width, height};
56 return Size{width, height};
60 std::optional<int> w_, h_;
61 SizeOption(std::optional<int> width, std::optional<int> height)
62 : w_(width), h_(height) {}
68 std::optional<int> height);
70 std::optional<int> width);
71 std::optional<int>
rows()
const {
return h_; }
72 std::optional<int>
cols()
const {
return w_; }
80 std::optional<int> height) {
88 std::optional<int> width) {
104 std::shared_ptr<std::vector<unsigned char>>
data_;
115 const std::shared_ptr<std::vector<unsigned char>> &data,
141 int rows,
int cols, const
void *data,
143 :
ImageFrame(sizeHW(rows, cols), data, color_mode) {}
177 bool empty()
const {
return data_->size() == 0; }
209 int channels()
const;
231 std::shared_ptr<std::vector<unsigned char>>
dataPtr()
const {
242 const std::vector<unsigned char> &
data()
const {
return *data_; }
250 std::vector<unsigned char> &
data() {
return *data_; }
257 const unsigned char &
at(
int row,
int col,
int ch = 0)
const {
258 return dataPtr()->at((row * cols() + col) * channels() + ch);
267 unsigned char &
at(
int row,
int col,
int ch = 0) {
268 return dataPtr()->at((row * cols() + col) * channels() + ch);
(ver1.3から追加) 画像データ
Definition image_frame.h:101
unsigned char & at(int row, int col, int ch=0)
画像の要素にアクセス
Definition image_frame.h:267
const std::vector< unsigned char > & data() const
画像データ
Definition image_frame.h:242
ImageColorMode colorMode() const
色の並び順 (生画像データの場合)
Definition image_frame.h:220
ImageCompressMode compress_mode() const
Definition image_frame.h:224
ImageColorMode color_mode() const
Definition image_frame.h:213
bool empty() const
画像が空かどうかを返す
Definition image_frame.h:177
const unsigned char & at(int row, int col, int ch=0) const
画像の要素にアクセス
Definition image_frame.h:257
std::vector< unsigned char > & data()
画像データ (非const)
Definition image_frame.h:250
ImageCompressMode compressMode() const
画像の圧縮モード
Definition image_frame.h:229
int cols() const
画像の幅
Definition image_frame.h:202
const Size & size() const
画像のサイズ
Definition image_frame.h:182
std::shared_ptr< std::vector< unsigned char > > data_
Definition image_frame.h:104
int rows() const
画像の高さ
Definition image_frame.h:197
int height() const
画像の高さ
Definition image_frame.h:192
int width() const
画像の幅
Definition image_frame.h:187
ImageColorMode color_mode_
Definition image_frame.h:105
Size size_
Definition image_frame.h:103
ImageCompressMode cmp_mode_
Definition image_frame.h:106
std::shared_ptr< std::vector< unsigned char > > dataPtr() const
Definition image_frame.h:231
Definition image_frame.h:59
std::optional< int > rows() const
Definition image_frame.h:71
std::optional< int > cols() const
Definition image_frame.h:72
SizeOption(const Size &s)
Definition image_frame.h:66
Definition image_frame.h:30
int cols() const
Definition image_frame.h:41
int rows() const
Definition image_frame.h:40
int height() const
Definition image_frame.h:39
int width() const
Definition image_frame.h:38
Size sizeHW(int height, int width)
高さ × 幅 でサイズを指定
Definition image_frame.h:55
Size sizeWH(int width, int height)
幅 × 高さ でサイズを指定
Definition image_frame.h:48
ImageCompressMode
Definition image_frame.h:23
ImageColorMode
Definition image_frame.h:16
#define WEBCFACE_DLL
Definition webcface-config.h:60
#define WEBCFACE_CALL
Definition webcface-config.h:97
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103