|
fastdo
0.6.16
|
图片类 更多...
#include <eiengd.hpp>
Public 成员函数 | |
| Image () | |
| 构造函数1 默认 更多... | |
| Image (int width, int height, bool isTrueColor=true) | |
| 构造函数2 指定宽高创建一个图片, isTrueColor表示是采用真彩色图片还是256色调色板图片 更多... | |
| Image (winux::String const &filename) | |
| 构造函数3 从文件创建图片,支持png、jpg、gif、webp。 更多... | |
| ~Image () | |
| void | create (int width, int height) |
| 创建指定大小的256色调色板图片 更多... | |
| void | createTrueColor (int width, int height) |
| 创建指定大小的真彩图 更多... | |
| void | createFromFile (winux::String const &filename) |
| 从文件创建图片,支持png、jpg、gif、webp。 更多... | |
| bool | output (winux::String const &filename, winux::String const &type="") |
| 输出图片到文件 更多... | |
| bool | output (winux::Buffer *buf, winux::String const &type="") |
| 输出图片到Buffer 更多... | |
| void | destroy () |
| 销毁图片 更多... | |
| void | copy (Image &srcImg, int srcX, int srcY, int srcWidth, int srcHeight, int x, int y) |
| 拷贝图片 更多... | |
| void | copyResized (Image &srcImg, int srcX, int srcY, int srcWidth, int srcHeight, int x, int y, int width, int height) |
| 拷贝并缩放图片 更多... | |
| void | copyResampled (Image &srcImg, int srcX, int srcY, int srcWidth, int srcHeight, int x, int y, int width, int height) |
| 拷贝并缩放图片(重采样) 更多... | |
| void | debug () |
| Color | color (int red, int green, int blue, winux::Mixed const &mixed=winux::mxNull) |
| 分配一个颜色 更多... | |
| int | getWidth () const |
| 获取宽度 更多... | |
| int | getHeight () const |
| 获取高度 更多... | |
| winux::String | getType () const |
| 获取类型(扩展名) 更多... | |
| void | setJpegQuality (long quality) |
| 设置JPEG图片输出质量 更多... | |
| void | saveAlpha (bool isSave) |
| 设置标记以在保存PNG图像时保存完整的alpha通道信息(与单一透明色相反)。 更多... | |
| void | alphaBlending (bool isBlend) |
| 设定图像的混色模式 更多... | |
| int | colorAt (int x, int y) const |
| 相当于getpixel() 更多... | |
| int | colorsForIndex (int index) const |
| 获取指定颜色索引的颜色,调色板图用 更多... | |
| int | colorsTotal () const |
| 获取颜色总数,调色板图用 更多... | |
友元 | |
| class | Color |
| class | Graphics |
图片类
在文件 eiengd.hpp 第 121 行定义.
| eiengd::Image::Image | ( | ) |
构造函数1 默认
| eiengd::Image::Image | ( | int | width, |
| int | height, | ||
| bool | isTrueColor = true |
||
| ) |
构造函数2 指定宽高创建一个图片, isTrueColor表示是采用真彩色图片还是256色调色板图片
| eiengd::Image::Image | ( | winux::String const & | filename | ) |
构造函数3 从文件创建图片,支持png、jpg、gif、webp。
| eiengd::Image::~Image | ( | ) |
| void eiengd::Image::create | ( | int | width, |
| int | height | ||
| ) |
创建指定大小的256色调色板图片
| void eiengd::Image::createTrueColor | ( | int | width, |
| int | height | ||
| ) |
创建指定大小的真彩图
| void eiengd::Image::createFromFile | ( | winux::String const & | filename | ) |
从文件创建图片,支持png、jpg、gif、webp。
| bool eiengd::Image::output | ( | winux::String const & | filename, |
| winux::String const & | type = "" |
||
| ) |
输出图片到文件
类型判断,1.参数type指定 2.filename扩展名 3.内部_type
| bool eiengd::Image::output | ( | winux::Buffer * | buf, |
| winux::String const & | type = "" |
||
| ) |
输出图片到Buffer
类型判断,1.参数type指定 2.内部_type
| void eiengd::Image::destroy | ( | ) |
销毁图片
| void eiengd::Image::copy | ( | Image & | srcImg, |
| int | srcX, | ||
| int | srcY, | ||
| int | srcWidth, | ||
| int | srcHeight, | ||
| int | x, | ||
| int | y | ||
| ) |
拷贝图片
| void eiengd::Image::copyResized | ( | Image & | srcImg, |
| int | srcX, | ||
| int | srcY, | ||
| int | srcWidth, | ||
| int | srcHeight, | ||
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height | ||
| ) |
拷贝并缩放图片
| void eiengd::Image::copyResampled | ( | Image & | srcImg, |
| int | srcX, | ||
| int | srcY, | ||
| int | srcWidth, | ||
| int | srcHeight, | ||
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height | ||
| ) |
拷贝并缩放图片(重采样)
| void eiengd::Image::debug | ( | ) |
| Color eiengd::Image::color | ( | int | red, |
| int | green, | ||
| int | blue, | ||
| winux::Mixed const & | mixed = winux::mxNull |
||
| ) |
分配一个颜色
| int eiengd::Image::getWidth | ( | ) | const |
获取宽度
| int eiengd::Image::getHeight | ( | ) | const |
获取高度
| winux::String eiengd::Image::getType | ( | ) | const |
获取类型(扩展名)
| void eiengd::Image::setJpegQuality | ( | long | quality | ) |
设置JPEG图片输出质量
默认80,取值0~100。只有当输出JPEG图片时有效,其它图片类型无效。
| void eiengd::Image::saveAlpha | ( | bool | isSave | ) |
设置标记以在保存PNG图像时保存完整的alpha通道信息(与单一透明色相反)。
要使用本函数,必须将alphablending清位(Image::alphaBlending(false))。
| void eiengd::Image::alphaBlending | ( | bool | isBlend | ) |
设定图像的混色模式
| int eiengd::Image::colorAt | ( | int | x, |
| int | y | ||
| ) | const |
相当于getpixel()
| int eiengd::Image::colorsForIndex | ( | int | index | ) | const |
获取指定颜色索引的颜色,调色板图用
| int eiengd::Image::colorsTotal | ( | ) | const |
获取颜色总数,调色板图用
|
friend |
在文件 eiengd.hpp 第 209 行定义.
|
friend |
在文件 eiengd.hpp 第 210 行定义.