#include <wx_image.h>
|
static std::shared_ptr< WXImage > | fromFile (const std::string &fileName) |
|
static std::shared_ptr< WXImage > | fromEncodedData (const uint8_t *data, size_t size) |
|
static std::shared_ptr< WXImage > | fromColor (int width, int height, uint8_t r, uint8_t g, uint8_t b) |
|
static std::shared_ptr< WXImage > | fromBuffer (int width, int height, const uint8_t *rgbData) |
|
static std::shared_ptr< WXImage > | fromRGBAData (int width, int height, const uint8_t *rgbaData) |
|
static std::shared_ptr< WXImage > | fromImage (WXImage *other) |
|
static WXImage * | fromFile2 (const std::string &fileName) |
|
static WXImage * | fromEncodedData2 (const uint8_t *data, size_t size) |
|
static WXImage * | fromColor2 (int width, int height, uint8_t r, uint8_t g, uint8_t b) |
|
static WXImage * | fromBuffer2 (int width, int height, const uint8_t *rgbData) |
|
static WXImage * | fromRGBAData2 (int width, int height, const uint8_t *rgbaData) |
|
◆ DataFormat
图像数据格式
Enumerator |
---|
UNK | 未知格式
|
RGB | 三通道RGB格式
|
RGBA | 四通道RGBA格式
|
ALPHA8 | 单通道ALPHA格式
|
FLOAT32 | 单通道浮点值
|
◆ data()
virtual uint8_t * wonxai::WXImage::data |
( |
| ) |
|
|
virtual |
◆ dataFormat()
virtual DataFormat wonxai::WXImage::dataFormat |
( |
| ) |
|
|
virtual |
◆ fromBuffer()
static std::shared_ptr< WXImage > wonxai::WXImage::fromBuffer |
( |
int |
width, |
|
|
int |
height, |
|
|
const uint8_t * |
rgbData |
|
) |
| |
|
static |
根据给定的图像像素数据,创建WXImage对象,数据格式必须为RGB三通道,且连续存储
- Exceptions
-
◆ fromBuffer2()
static WXImage * wonxai::WXImage::fromBuffer2 |
( |
int |
width, |
|
|
int |
height, |
|
|
const uint8_t * |
rgbData |
|
) |
| |
|
static |
◆ fromColor()
static std::shared_ptr< WXImage > wonxai::WXImage::fromColor |
( |
int |
width, |
|
|
int |
height, |
|
|
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
|
static |
创建一副纯色图,颜色值由r,g,b三个值指定
- Exceptions
-
◆ fromColor2()
static WXImage * wonxai::WXImage::fromColor2 |
( |
int |
width, |
|
|
int |
height, |
|
|
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
|
static |
◆ fromEncodedData()
static std::shared_ptr< WXImage > wonxai::WXImage::fromEncodedData |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
static |
从图片原数据(即图片编码数据)创建WXImage对象,支持jpg和png图片
- Exceptions
-
◆ fromEncodedData2()
static WXImage * wonxai::WXImage::fromEncodedData2 |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
static |
◆ fromFile()
static std::shared_ptr< WXImage > wonxai::WXImage::fromFile |
( |
const std::string & |
fileName | ) |
|
|
static |
从图片文件创建WXImage对象,支持jpg和png图片
- Exceptions
-
◆ fromFile2()
static WXImage * wonxai::WXImage::fromFile2 |
( |
const std::string & |
fileName | ) |
|
|
static |
◆ fromImage()
static std::shared_ptr< WXImage > wonxai::WXImage::fromImage |
( |
WXImage * |
other | ) |
|
|
static |
从另外一个WXImage对象复制一个新的WXImage对象
- Exceptions
-
◆ fromRGBAData()
static std::shared_ptr< WXImage > wonxai::WXImage::fromRGBAData |
( |
int |
width, |
|
|
int |
height, |
|
|
const uint8_t * |
rgbaData |
|
) |
| |
|
static |
根据给定的图像像素数据,创建WXImage对象,数据格式必须为RGBA四通道,且连续存储
- Exceptions
-
◆ fromRGBAData2()
static WXImage * wonxai::WXImage::fromRGBAData2 |
( |
int |
width, |
|
|
int |
height, |
|
|
const uint8_t * |
rgbaData |
|
) |
| |
|
static |
◆ height()
virtual int wonxai::WXImage::height |
( |
| ) |
|
|
virtual |
◆ toEncodedData()
virtual void wonxai::WXImage::toEncodedData |
( |
std::string & |
encodedData, |
|
|
const std::string & |
imgType |
|
) |
| |
|
virtual |
将图片保存为编码后的数据,支持jpg和png格式 param[in] encodedData 用于接收编码后的二进制数据 param[in] imgType 图片编码类型:jpg or png
- Exceptions
-
◆ toFile()
virtual void wonxai::WXImage::toFile |
( |
const std::string & |
fileName | ) |
|
|
virtual |
将图片保存到文件,支持jpg和png图片 param[in] fileName 目标文件路径,扩展名必须为".jpg"或者".png"(不区分大小写)
- Exceptions
-
◆ width()
virtual int wonxai::WXImage::width |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following file: