Skip to content

Commit

Permalink
EGE/include/ege/colorbase.h: 修复代码缩进和换行;颜色转换函数添加 ynothrow 。
Browse files Browse the repository at this point in the history
Signed-off-by: FrankHB <frankhb1989@gmail.com>
  • Loading branch information
FrankHB committed Apr 14, 2020
1 parent 9308a56 commit 158f30e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions Compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ YEGE 以 [misakamm 的 xege](http://github.com/misakamm/xege) 为基础修改,
* 修复 `putimage_`* 系列函数剪裁区域和坐标变换的问题。
* 参见 [wysaid/xege pull request 5](https://github.com/wysaid/xege/pull/5) 。
* 参见 [wysaid/xege pull request 9](https://github.com/wysaid/xege/pull/9) 。
* 颜色转换函数添加 `ynothrow`

## 19.01

Expand Down
32 changes: 15 additions & 17 deletions EGE/include/ege/colorbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,82 +30,80 @@ using ConstBitmapPtr = const color_int_t*;
#endif

yconstfn color_int_t
RGBTOBGR(MonoType color)
RGBTOBGR(MonoType color) ynothrow
{
return ((color & 0xFF) << 16) | ((color & 0xFF0000) >> 16)
| (color & 0xFF00FF00);
| (color & 0xFF00FF00);
}

yconstfn color_int_t
EGERGB(MonoType r, MonoType g, MonoType b)
EGERGB(MonoType r, MonoType g, MonoType b) ynothrow
{
return (b << 16) | (g << 8) | r;
}

yconstfn color_int_t
EGERGBA(MonoType r, MonoType g, MonoType b, MonoType a)
EGERGBA(MonoType r, MonoType g, MonoType b, MonoType a) ynothrow
{
return EGERGB(r, g, b) | a << 24;
}

yconstfn color_int_t
EGEARGB(MonoType a, MonoType r, MonoType g,
MonoType b)
EGEARGB(MonoType a, MonoType r, MonoType g, MonoType b) ynothrow
{
return EGERGB(r, g, b) | a << 24;
}


yconstfn color_int_t
EGEACOLOR(MonoType a, color_int_t color)
EGEACOLOR(MonoType a, color_int_t color) ynothrow
{
return (color & 0xFFFFFF) | (a << 24);
}

yconstfn color_int_t
EGECOLORA(MonoType a, color_int_t color)
EGECOLORA(MonoType a, color_int_t color) ynothrow
{
return (color & 0xFFFFFF) | (a << 24);
}


yconstfn MonoType
EGEGET_R(color_int_t c)
EGEGET_R(color_int_t c) ynothrow
{
return (c >> 16) & 0xFF;
}

yconstfn MonoType
EGEGET_G(color_int_t c)
EGEGET_G(color_int_t c) ynothrow
{
return (c >> 8) & 0xFF;
}

yconstfn MonoType
EGEGET_B(color_int_t c)
EGEGET_B(color_int_t c) ynothrow
{
return c & 0xFF;
}

yconstfn MonoType
EGEGET_A(color_int_t c)
EGEGET_A(color_int_t c) ynothrow
{
return (c >> 24) & 0xFF;
}

yconstfn color_int_t
EGEGRAY(color_int_t gray)
EGEGRAY(color_int_t gray) ynothrow
{
return (gray << 16) | (gray << 8) | gray;
}

yconstfn color_int_t
EGEGRAYA(color_int_t gray, MonoType a)
EGEGRAYA(color_int_t gray, MonoType a) ynothrow
{
return EGEGRAY(gray) | (a << 24);
}

yconstfn color_int_t
EGEAGRAY(MonoType a, color_int_t gray)
EGEAGRAY(MonoType a, color_int_t gray) ynothrow
{
return EGEGRAY(gray) | (a << 24);
}
Expand Down

0 comments on commit 158f30e

Please sign in to comment.