#include <stdint.h>
#include <stddef.h>
#include "wx_api.h"
Go to the source code of this file.
|
WX_API int | WXImage_FromFile (const char *fileName, WXImage_t **img_p) |
|
WX_API int | WXImage_FromEncodedData (const uint8_t *data, size_t size, WXImage_t **img_p) |
|
WX_API int | WXImage_FromColor (int width, int height, uint8_t r, uint8_t g, uint8_t b, WXImage_t **img_p) |
|
WX_API int | WXImage_FromBuffer (int width, int height, const uint8_t *rgbData, WXImage_t **img_p) |
|
WX_API void | WXImage_Release (WXImage_t *img) |
|
WX_API int | WXImage_ToFile (WXImage_t *img, const char *fileName) |
|
WX_API int | WXImage_ToEncodedData (WXImage_t *img, const char *imgType, uint8_t *encodedData, size_t encodedDataCapcity, size_t *encodedDataSize) |
|
WX_API int | WXImage_Width (WXImage_t *img) |
|
WX_API int | WXImage_Height (WXImage_t *img) |
|
WX_API uint8_t * | WXImage_Data (WXImage_t *img) |
|
WX_API WXImageDataFormat_e | WXImage_DataFormat (WXImage_t *img) |
|
◆ WXImage_t
◆ WXImageDataFormat_e
◆ WXImageDataFormat_e
WXImage_t 图像数据格式
Enumerator |
---|
WXImgDF_UNK | 未知格式
|
WXImgDF_RGB | 三通道RGB格式
|
WXImgDF_RGBA | 四通道RGBA格式
|
WXImgDF_ALPHA8 | 单通道ALPHA格式
|
WXImgDF_FLOAT32 | 单通道浮点值
|
◆ WXImage_Data()
WX_API uint8_t * WXImage_Data |
( |
WXImage_t * |
img | ) |
|
返回图片数据,调用者不能从外面释放,也不需要单独释放
◆ WXImage_DataFormat()
◆ WXImage_FromBuffer()
WX_API int WXImage_FromBuffer |
( |
int |
width, |
|
|
int |
height, |
|
|
const uint8_t * |
rgbData, |
|
|
WXImage_t ** |
img_p |
|
) |
| |
◆ WXImage_FromColor()
WX_API int WXImage_FromColor |
( |
int |
width, |
|
|
int |
height, |
|
|
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
WXImage_t ** |
img_p |
|
) |
| |
◆ WXImage_FromEncodedData()
WX_API int WXImage_FromEncodedData |
( |
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
WXImage_t ** |
img_p |
|
) |
| |
◆ WXImage_FromFile()
WX_API int WXImage_FromFile |
( |
const char * |
fileName, |
|
|
WXImage_t ** |
img_p |
|
) |
| |
◆ WXImage_Height()
◆ WXImage_Release()
WX_API void WXImage_Release |
( |
WXImage_t * |
img | ) |
|
◆ WXImage_ToEncodedData()
WX_API int WXImage_ToEncodedData |
( |
WXImage_t * |
img, |
|
|
const char * |
imgType, |
|
|
uint8_t * |
encodedData, |
|
|
size_t |
encodedDataCapcity, |
|
|
size_t * |
encodedDataSize |
|
) |
| |
将图片保存为编码后的数据,支持jpg和png格式
- See also
- wonxai::WXImage::toEncodedData
- Note
- encodedData的空间由调用者自行分配和管理
- Parameters
-
[in] | img | WXImage对象 |
[in] | imgType | 图片编码类型:jpg or png |
[out] | encodedData | - 用于接收编码后的二进制数据 |
[in] | encodedDataCapcity | - encodedData空间长度 |
[out] | encodedDataSize | - 返回的编码后的图片数据的长度 |
- Returns
成功 - 0
失败 - 错误码
◆ WXImage_ToFile()
WX_API int WXImage_ToFile |
( |
WXImage_t * |
img, |
|
|
const char * |
fileName |
|
) |
| |
◆ WXImage_Width()