tpSurface类
Utils
2025-07-05
基础信息
头文件: | include <tpSurface.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | |
派生类: |
Public 类型
enum tpImageType {
SAVE_BMP_FMT, SAVE_JPG_FMT, SAVE_PNG_FMT
}
Public 成员函数
tpSurface(IPiDSSurface *surface=nullptr) | ||
---|---|---|
tpSurface(const tpString &fileName, IPiDSSurface *surface=nullptr) | ||
~tpSurface() | ||
fromFile(const tpString &filename, bool convertToFit=true) | 加载图片资源文件,支持png, jpg, bmp, xpm, web, tiff, SVG | |
tpShared< tpSurface > tpSurface::scaled | scaled(const ItpSize &size) | 指定size对图片进行缩放 |
tpShared< tpSurface > tpSurface::scaled | scaled(const uint32_t &width, const uint32_t &height) | 指定size对图片进行缩放 |
create(IPiDSSurface *surface) | ||
create(void *address, int32_t width, int32_t height, int32_t format, int32_t stride, int32_t rmask=0, int32_t gmask=0, int32_t bmask=0, int32_t amask=0, uint8_t alpha=0xff, bool enableColroKey=false, uint32_t colorKey=0, tpRect *clip=nullptr, bool convertToFit=false) | ||
create(tpSurface *surface, bool bShareMemoried=true) | ||
surface() | ||
renderer() | ||
matrix() | ||
glassBlur(const int32_t &radius) | 对图片资源进行模糊处理(会对原始数据进行更新) | |
stride() | ||
width() | 获取surface的宽度 | |
height() | 获取surface的高度 | |
format() | ||
rmask() | ||
gmask() | ||
bmask() | ||
amask() | ||
setClipRect(tpRect *rect) | ||
clipRect() | ||
clear() | ||
fill(tpRect *rect, int32_t color) | ||
hasSurface() | ||
hasImage() | ||
virtual tpSurface * tpSurface::copy | copy(tpRect &rect) | |
virtual tpSurface * tpSurface::copy | copy(int32_t x, int32_t y, int32_t w, int32_t h) | |
directBlitF(tpSurface &surface, tpRect &src, tpRect &dst) | ||
directBlitT(tpSurface &surface, tpRect &src, tpRect &dst) | ||
strenchBlitF(tpSurface &surface, tpRect &src, tpRect &dst) | ||
strenchBlitT(tpSurface &surface, tpRect &src, tpRect &dst) | ||
save(const tpString &filename, tpImageType type, int32_t jpguality=100) | 指定文件名保存资源文件数据 TODO,需要重构,可以支持不给入类型自动根据类型存储 | |
save(const tpString &filename, tpRect &rect, tpImageType type, int32_t jpguality=100) | ||
release() | 释放内部所有资源,释放后Surface即无效 |
成员枚举类型说明
enum tpSurface::tpImageType
名称 | 值 | 描述 |
---|---|---|
SAVE_BMP_FMT | 0 | |
SAVE_JPG_FMT | 1 | |
SAVE_PNG_FMT | 2 |
成员函数说明
tpSurface::tpSurface(IPiDSSurface *surface=nullptr)
暂无注释...
tpSurface::tpSurface(const tpString &fileName, IPiDSSurface *surface=nullptr)
暂无注释...
virtual
tpSurface::~tpSurface()
暂无注释...
virtual
bool tpSurface::fromFile(const tpString &filename, bool convertToFit=true)
点击查看...
加载图片资源文件,支持png, jpg, bmp, xpm, web, tiff, SVG
返回值:
加载结果
tpShared< tpSurface > tpSurface::scaled(const ItpSize &size)
点击查看...
指定size对图片进行缩放
返回值:
缩放后的资源对象
tpShared< tpSurface > tpSurface::scaled(const uint32_t &width, const uint32_t &height)
点击查看...
指定size对图片进行缩放
返回值:
缩放后的资源对象
virtual
bool tpSurface::create(IPiDSSurface *surface)
暂无注释...
virtual
bool tpSurface::create(void *address, int32_t width, int32_t height, int32_t format, int32_t stride, int32_t rmask=0, int32_t gmask=0, int32_t bmask=0, int32_t amask=0, uint8_t alpha=0xff, bool enableColroKey=false, uint32_t colorKey=0, tpRect *clip=nullptr, bool convertToFit=false)
暂无注释...
virtual
bool tpSurface::create(tpSurface *surface, bool bShareMemoried=true)
暂无注释...
virtual
IPitpSurfacePtr * tpSurface::surface()
暂无注释...
virtual
IPiRendererPtr * tpSurface::renderer()
暂无注释...
virtual
void * tpSurface::matrix()
暂无注释...
void tpSurface::glassBlur(const int32_t &radius)
点击查看...
对图片资源进行模糊处理(会对原始数据进行更新)
virtual
int32_t tpSurface::stride()
暂无注释...
virtual
int32_t tpSurface::width()
点击查看...
获取surface的宽度
返回值:
宽度值
virtual
int32_t tpSurface::height()
点击查看...
获取surface的高度
返回值:
高度值
virtual
int32_t tpSurface::format()
暂无注释...
virtual
int32_t tpSurface::rmask()
暂无注释...
virtual
int32_t tpSurface::gmask()
暂无注释...
virtual
int32_t tpSurface::bmask()
暂无注释...
virtual
int32_t tpSurface::amask()
暂无注释...
virtual
void tpSurface::setClipRect(tpRect *rect)
暂无注释...
virtual
ItpRect tpSurface::clipRect()
暂无注释...
virtual
void tpSurface::clear()
暂无注释...
virtual
void tpSurface::fill(tpRect *rect, int32_t color)
暂无注释...
virtual
bool tpSurface::hasSurface()
暂无注释...
virtual
bool tpSurface::hasImage()
暂无注释...
virtual
tpSurface * tpSurface::copy(tpRect &rect)
暂无注释...
virtual
tpSurface * tpSurface::copy(int32_t x, int32_t y, int32_t w, int32_t h)
暂无注释...
virtual
void tpSurface::directBlitF(tpSurface &surface, tpRect &src, tpRect &dst)
暂无注释...
virtual
void tpSurface::directBlitT(tpSurface &surface, tpRect &src, tpRect &dst)
暂无注释...
virtual
void tpSurface::strenchBlitF(tpSurface &surface, tpRect &src, tpRect &dst)
暂无注释...
virtual
void tpSurface::strenchBlitT(tpSurface &surface, tpRect &src, tpRect &dst)
暂无注释...
virtual
bool tpSurface::save(const tpString &filename, tpImageType type, int32_t jpguality=100)
点击查看...
指定文件名保存资源文件数据 TODO,需要重构,可以支持不给入类型自动根据类型存储
返回值:
linebreak
virtual
bool tpSurface::save(const tpString &filename, tpRect &rect, tpImageType type, int32_t jpguality=100)
暂无注释...
virtual
bool tpSurface::release()
点击查看...
释放内部所有资源,释放后Surface即无效
返回值:
释放结果