-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathImageDecoderFactory.h
More file actions
50 lines (40 loc) · 1.39 KB
/
ImageDecoderFactory.h
File metadata and controls
50 lines (40 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef UI_IMAGE_IMAGE_DECODER_FACTORY_H_
#define UI_IMAGE_IMAGE_DECODER_FACTORY_H_
#include "duilib/Image/ImageDecoder.h"
#include "duilib/Image/ImageUtil.h"
namespace ui
{
/** 图片格式解码工程类
*/
class UILIB_API ImageDecoderFactory
{
public:
ImageDecoderFactory();
~ImageDecoderFactory();
/** 添加一个图片格式解码器
* @param [in] pImageDecoder 需要添加的图片解码器
*/
bool AddImageDecoder(const std::shared_ptr<IImageDecoder>& pImageDecoder);
/** 移除一个图片格式解码器
* @param [in] pImageDecoder 需要添加的图片解码器
*/
bool RemoveImageDecoder(const std::shared_ptr<IImageDecoder>& pImageDecoder);
/** 清除所有的图片格式解码器
*/
void Clear();
public:
/** 加载解码图片数据,返回解码后的图像数据
* @param [in] decodeParam 图片解码的相关参数
*/
std::unique_ptr<IImage> LoadImageData(const ImageDecodeParam& decodeParam);
/** 解码一个文件数据为位图(不支持多帧图片,如果图片为多帧,则只解码第一帧)
* @param [in] decodeParam 图片解码的相关参数
*/
std::shared_ptr<IBitmap> DecodeImageData(const ImageDecodeParam& decodeParam);
private:
/** 图片解码器
*/
std::vector<std::shared_ptr<IImageDecoder>> m_imageDecoders;
};
} // namespace ui
#endif // UI_IMAGE_IMAGE_DECODER_FACTORY_H_