|
CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
类 BUI::GImage 继承关系图:Public 成员函数 | |
| GImage () | |
| virtual | ~GImage () |
| virtual bool | LoadBufferImage (unsigned char *buffer, UINT dwSize) |
| void | GetPixel (int x, int y, uint32_t &r, uint32_t &g, uint32_t &b, uint32_t &a) const |
| 获得像素点颜色 | |
| void | SetPixel (int x, int y, uint32_t r, uint32_t g, uint32_t b, uint32_t a) |
| 设置像素点颜色 | |
| void | Filter (GImage *image_src, std::function< void(int x, int y, GImage *dst, GImage *src1)> call_back) |
| void | FilterDouble (GImage *image_src1, GImage *image_src2, std::function< void(int x, int y, GImage *dst, GImage *src1, GImage *src2)> call_back) |
| UBYTE * | Buffer () const |
| 像素数据内存指针,可以直接访问。访问时需要注意像素格式 | |
| SIZE | ImageSize (BOOL isPixelFormat=FALSE) const |
| 位图尺寸 | |
| int | WidthPixel () const |
| int | HeightPixel () const |
| void | AttachOtherMemImage (unsigned char *pixel, int w, int h, int stride, PixelFormatType fmt) |
| void | AllocImage (int w, int h, PixelFormatType fmt, BOOL clear) |
| 根据大小重新分配内存 | |
| PixelFormatType | GetPixelFormat () const |
| 位图的像素格式 | |
| void | TransformMatrix (Transform2d *mtx, RECT *rc, double angle, double scale_x, double scale_y) |
| 获取图片输出到指定矩形区域内时的变换矩阵 | |
| UBYTE * | RowPtr (int x, int y) |
| 获得像素点内存指针 | |
| void | GetClientRectInFrames (RECT *rc, BOOL isHroz, int current, int frameCounts) const |
| 获得多帧图片的某一帧,在图像中的坐标 | |
| void | GetImageDrawInfoInFrames (ImageDrawInfo *info, BOOL isHroz, int current, int frameCounts) const |
| 获得多帧图片的某一帧,绘制信息 | |
| void | GetImageDrawInfo (ImageDrawInfo *info) const |
| 获得整张位图的绘制信息 | |
| void | GetImageDrawInfoInArea (ImageDrawInfo *info, int x, int y, int w, int h) const |
| 获得位图某一区域的绘制信息 | |
| int | Stride () const |
| 图片一水平行,所占的字节数。当Stride() < 0 时,表示第一行,存储在内存中的高地址。 | |
| int | StrideAbs () const |
| 图片一水平行,所占的字节数的绝对值 | |
| UINT | PixelBitCounts () const |
| 单个像素点占的比特数 | |
| void | Gamma (float gamma, UINT channel, double(*f)(double)=NULL) |
| void | HistogramEqualize (GImage *source, int color_chanel, uint8_t *p, int len) |
| 图像均衡化 | |
| void | Destory () |
| 销毁并释放内存 | |
| void | CopyForm (const unsigned char *data, int w, int h, int bpp) |
| void | MakeShaddow (int dx, int dy, int blursize, const GColor &color) |
| 根据透明度。生成阴影格式。必须是具有alpha通道图像 | |
| void | CloneFrom (const GImage *other) |
| 克隆 | |
| void | ToGray (GrayConv conv_type=GrayDesaturation) |
| 取GrayConv组合值 | |
| void | GetImageChanelIndex (int &ir, int &ig, int &ib, int &ia) |
| 获得图像颜色通道索引 | |
| void | SaveAsImageFile (LPCTSTR file_png_path, LPCTSTR fmt) |
| void | RemoveBackColor (uint8_t r, uint8_t g, uint8_t b) |
| 清除指定背景颜色 | |
| unsigned int | GetTexID () |
静态 Public 成员函数 | |
| static BOOL | SaveAsJPG (LPCTSTR file_png_path, const unsigned char *data, int w, int h, PixelFormatType fmt, int stride) |
Public 属性 | |
| unsigned int | m_tex_id |
Protected 属性 | |
| BOOL | m_is_attach_other |
| int | m_width |
| int | m_height |
| UINT | m_bpp |
| int | m_stride |
| unsigned char * | m_pixels |
| PixelFormatType | m_pixel_format |
| int | m_rgb_order [4] |
class GImage
| BUI::GImage::GImage | ( | ) |
|
virtual |
| void BUI::GImage::AllocImage | ( | int | w, |
| int | h, | ||
| PixelFormatType | fmt, | ||
| BOOL | clear | ||
| ) |
根据大小重新分配内存
| w:宽度 | |
| h:高度 | |
| fmt:分配内存的像素格式。用于计算单个像素大小 | |
| clear | 若clear=TRUE,则用0清除内存。 |
| void BUI::GImage::AttachOtherMemImage | ( | unsigned char * | pixel, |
| int | w, | ||
| int | h, | ||
| int | stride, | ||
| PixelFormatType | fmt | ||
| ) |
| UBYTE * BUI::GImage::Buffer | ( | ) | const |
像素数据内存指针,可以直接访问。访问时需要注意像素格式
| void BUI::GImage::CloneFrom | ( | const GImage * | other | ) |
克隆
| void BUI::GImage::CopyForm | ( | const unsigned char * | data, |
| int | w, | ||
| int | h, | ||
| int | bpp | ||
| ) |
| void BUI::GImage::Destory | ( | ) |
销毁并释放内存
| void BUI::GImage::Filter | ( | GImage * | image_src, |
| std::function< void(int x, int y, GImage *dst, GImage *src1)> | call_back | ||
| ) |
| void BUI::GImage::FilterDouble | ( | GImage * | image_src1, |
| GImage * | image_src2, | ||
| std::function< void(int x, int y, GImage *dst, GImage *src1, GImage *src2)> | call_back | ||
| ) |
| void BUI::GImage::Gamma | ( | float | gamma, |
| UINT | channel, | ||
| double(*)(double) | f = NULL |
||
| ) |
| void BUI::GImage::GetClientRectInFrames | ( | RECT * | rc, |
| BOOL | isHroz, | ||
| int | current, | ||
| int | frameCounts | ||
| ) | const |
获得多帧图片的某一帧,在图像中的坐标
| rc:输出矩形区域 | |
| isHroz | 若isHroz=TRUE,表示位图帧与帧之间,水平排列。若isHroz=FALSE,表示垂直排列 |
| current | 当前帧序号。从0开始 |
| frameCounts | 位图内帧的总数 |
| void BUI::GImage::GetImageChanelIndex | ( | int & | ir, |
| int & | ig, | ||
| int & | ib, | ||
| int & | ia | ||
| ) |
获得图像颜色通道索引
| void BUI::GImage::GetImageDrawInfo | ( | ImageDrawInfo * | info | ) | const |
获得整张位图的绘制信息
| void BUI::GImage::GetImageDrawInfoInArea | ( | ImageDrawInfo * | info, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) | const |
获得位图某一区域的绘制信息
| void BUI::GImage::GetImageDrawInfoInFrames | ( | ImageDrawInfo * | info, |
| BOOL | isHroz, | ||
| int | current, | ||
| int | frameCounts | ||
| ) | const |
获得多帧图片的某一帧,绘制信息
| rc:输出矩形区域 | |
| isHroz | 若isHroz=TRUE,表示位图帧与帧之间,水平排列。若isHroz=FALSE,表示垂直排列 |
| current | 当前帧序号。从0开始 |
| frameCounts | 位图内帧的总数 |
| void BUI::GImage::GetPixel | ( | int | x, |
| int | y, | ||
| uint32_t & | r, | ||
| uint32_t & | g, | ||
| uint32_t & | b, | ||
| uint32_t & | a | ||
| ) | const |
获得像素点颜色
| (x,y):像素坐标 | |
| (r,g,b,a) | 输出各个通道颜色 |
| PixelFormatType BUI::GImage::GetPixelFormat | ( | ) | const |
位图的像素格式
| unsigned int BUI::GImage::GetTexID | ( | ) |
| int BUI::GImage::HeightPixel | ( | ) | const |
| void BUI::GImage::HistogramEqualize | ( | GImage * | source, |
| int | color_chanel, | ||
| uint8_t * | p, | ||
| int | len | ||
| ) |
图像均衡化
| color_chanel | 颜色通道:-1表示rgb三个通道, 0,1,2 分别代表R,G,B。 |
| p | |
| len |
位图尺寸
| isPixelFormat | 若为FALSE,则用实际尺寸乘以系统缩放,也就是在屏幕中显示的大小 若为TRUE,则返回实际像素大小 |
|
virtual |
被 BUI::GImageGIF 重载.
| void BUI::GImage::MakeShaddow | ( | int | dx, |
| int | dy, | ||
| int | blursize, | ||
| const GColor & | color | ||
| ) |
根据透明度。生成阴影格式。必须是具有alpha通道图像
| UINT BUI::GImage::PixelBitCounts | ( | ) | const |
单个像素点占的比特数
| void BUI::GImage::RemoveBackColor | ( | uint8_t | r, |
| uint8_t | g, | ||
| uint8_t | b | ||
| ) |
清除指定背景颜色
| (r,g,b):三原色分量 |
| UBYTE * BUI::GImage::RowPtr | ( | int | x, |
| int | y | ||
| ) |
获得像素点内存指针
| (x,y) | 像素点坐标 |
|
static |
| void BUI::GImage::SetPixel | ( | int | x, |
| int | y, | ||
| uint32_t | r, | ||
| uint32_t | g, | ||
| uint32_t | b, | ||
| uint32_t | a | ||
| ) |
设置像素点颜色
| (x,y):像素坐标 | |
| (r,g,b,a) | 各个通道颜色 |
| int BUI::GImage::Stride | ( | ) | const |
图片一水平行,所占的字节数。当Stride() < 0 时,表示第一行,存储在内存中的高地址。
| int BUI::GImage::StrideAbs | ( | ) | const |
图片一水平行,所占的字节数的绝对值
| void BUI::GImage::ToGray | ( | GrayConv | conv_type = GrayDesaturation | ) |
取GrayConv组合值
| void BUI::GImage::TransformMatrix | ( | Transform2d * | mtx, |
| RECT * | rc, | ||
| double | angle, | ||
| double | scale_x, | ||
| double | scale_y | ||
| ) |
获取图片输出到指定矩形区域内时的变换矩阵
| mtx:输出变换矩阵 | |
| rc | 目标区域 |
| angle:旋转弧度(0-2pi) | |
| scale_x | 水平方向缩放 |
| scale_y | 垂直方向缩放 |
| int BUI::GImage::WidthPixel | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| unsigned int BUI::GImage::m_tex_id |
|
protected |