From 5fb738898bb8209906c46bb91c06f0b92e5796d6 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Mon, 20 Apr 2015 22:51:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/LCUI/LCUI.h | 4 ++-- include/LCUI/draw.h | 26 +++++++------------------- include/LCUI/draw/background.h | 2 +- include/LCUI/graph.h | 4 ++-- include/LCUI/misc/rect.h | 4 +++- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/include/LCUI/LCUI.h b/include/LCUI/LCUI.h index a29630a9..d1f51115 100755 --- a/include/LCUI/LCUI.h +++ b/include/LCUI/LCUI.h @@ -175,8 +175,8 @@ struct LCUI_Graph_ { union { int w, width; }; /**< 宽度,一个整数值,单位为像素(px) */ union { int h, height; }; /**< 高度,一个整数值,单位为像素(px) */ struct { - int top; /**< 源图形中的引用区域所在的坐标 */ - int left; + int top; /**< 源图形中的引用区域的上边距 */ + int left; /**< 源图形中的引用区域的左边距 */ LCUI_BOOL is_valid; /**< 标志,指示是否引用了另一图形 */ LCUI_Graph *source; /**< 所引用的源图形 */ } quote; diff --git a/include/LCUI/draw.h b/include/LCUI/draw.h index 5c5cd3a5..6a7607c0 100644 --- a/include/LCUI/draw.h +++ b/include/LCUI/draw.h @@ -1,7 +1,7 @@ /* **************************************************************************** * LCUI_Draw.h -- The graphics draw module of LCUI. * - * Copyright (C) 2012 by + * Copyright (C) 2012-2015 by * Liu Chao * * This file is part of the LCUI project, and may only be used, modified, and @@ -23,7 +23,7 @@ /* **************************************************************************** * LCUI_Draw.h -- LCUI的图形绘制模块 * - * 版权所有 (C) 2012 归属于 + * 版权所有 (C) 2012-2015 归属于 * 刘超 * * 这个文件是LCUI项目的一部分,并且只可以根据GPLv2许可协议来使用、更改和发布。 @@ -56,37 +56,25 @@ LCUI_BEGIN_HEADER #include #include -LCUI_API int -Graph_Rotate(LCUI_Graph *src, int rotate_angle, LCUI_Graph *des); /* * 功能:旋转图形 * 说明:指定旋转中心点坐标以及旋转角度,即可得到旋转后的图形 * 本源代码参考自互联网相关代码 * 算法有待优化完善。 */ - -/* 载入BMP图片文件 */ -LCUI_API int Graph_LoadBMP( const char *filepath, LCUI_Graph *out ); - -/* 载入jpeg图片文件 */ -LCUI_API int Graph_LoadJPEG( const char *filepath, LCUI_Graph *out ); - -/* 载入png图片文件 */ -LCUI_API int Graph_LoadPNG( const char *filepath, LCUI_Graph *out ); +LCUI_API int Graph_Rotate( LCUI_Graph *src, int rotate_angle, LCUI_Graph *des ); /* 将图像数据写入至png文件 */ -LCUI_API int Graph_WritePNG( const char *file_name, LCUI_Graph *graph ); +LCUI_API int Graph_WritePNG( const char *file_name, const LCUI_Graph *graph ); /* 载入指定图片文件的图像数据 */ LCUI_API int Graph_LoadImage( const char *filepath, LCUI_Graph *out ); -LCUI_API int -GaussianSmooth( LCUI_Graph *src, LCUI_Graph *des, double sigma ); -/* 对图像进行高斯模糊处理 */ +/* 对图像进行高斯模糊处理 */ +LCUI_API int GaussianSmooth( LCUI_Graph *src, LCUI_Graph *des, double sigma ); -LCUI_API int -Graph_Smooth( LCUI_Graph *src, LCUI_Graph *des, double sigma ); /* 对图像进行模糊处理 */ +LCUI_API int Graph_Smooth( LCUI_Graph *src, LCUI_Graph *des, double sigma ); LCUI_END_HEADER diff --git a/include/LCUI/draw/background.h b/include/LCUI/draw/background.h index d35ab521..0ba304b2 100644 --- a/include/LCUI/draw/background.h +++ b/include/LCUI/draw/background.h @@ -54,7 +54,7 @@ LCUI_API void Background_Init( LCUI_Background *bg ); */ LCUI_API void Graph_DrawBackground( LCUI_Graph *graph, - const LCUI_Background *bg, + LCUI_Background *bg, const LCUI_Size *box_size, const LCUI_Rect *rect ); diff --git a/include/LCUI/graph.h b/include/LCUI/graph.h index a98f14d5..f2be917d 100644 --- a/include/LCUI/graph.h +++ b/include/LCUI/graph.h @@ -1,7 +1,7 @@ /* *************************************************************************** * LCUI_Graph.h -- The base graphics handling module for LCUI * - * Copyright (C) 2012-2014 by + * Copyright (C) 2012-2015 by * Liu Chao * * This file is part of the LCUI project, and may only be used, modified, and @@ -23,7 +23,7 @@ /* **************************************************************************** * LCUI_Graph.h -- LCUI的基本图形处理模块 * - * 版权所有 (C) 2012-2014 归属于 + * 版权所有 (C) 2012-2015 归属于 * 刘超 * * 这个文件是LCUI项目的一部分,并且只可以根据GPLv2许可协议来使用、更改和发布。 diff --git a/include/LCUI/misc/rect.h b/include/LCUI/misc/rect.h index b3040a6b..dd994515 100755 --- a/include/LCUI/misc/rect.h +++ b/include/LCUI/misc/rect.h @@ -66,7 +66,9 @@ LCUI_API LCUI_BOOL LCUIRect_IsCoverRect( LCUI_Rect rect1, LCUI_Rect rect2 ); * @param[out] out 矩形A和B重叠处的矩形 * @returns 如果两个矩形重叠,则返回TRUE,否则返回FALSE */ -LCUI_API LCUI_BOOL LCUIRect_GetOverlayRect( LCUI_Rect *a, LCUI_Rect *b, LCUI_Rect *out ); +LCUI_API LCUI_BOOL LCUIRect_GetOverlayRect( const LCUI_Rect *a, + const LCUI_Rect *b, + LCUI_Rect *out ); /** * 根据重叠矩形 rect1,将矩形 rect2 分割成四个矩形