📄 fcdibeffect.htm
字号:
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<title>FCDibEffect类</title>
</head>
<body bgcolor="#ffffe7" lang=ZH-CN style='tab-interval:21.0pt'>
<h2 align="center"><b><font color="#FF0000">FCDibEffect类说明</font></b></h2><table width="85%" border="1" bordercolor="#3399FF" align="center" cellpadding="0" bgcolor="#D0FFE0">
<tr> <td rowspan="2">文件位置 :</td><td width="85%" height="19"><font color="#FF0000">\FLib\Include\Pic\Effect.h</font></td></tr>
<tr> <td height="19"><font color="#FF0000">\FLib\Source\Pic\Effect.cpp</font></td></tr>
<tr> <td>使用方法 :</td><td width="85%" height="8"><font color="#FF0000">#include "fool.h"</font></td></tr>
<tr> <td>说明 :</td><td width="85%" height="9"> 1 . 所有函数如非特别指明则<font color="#FF0000">只对
24 和 32 位色</font>有效,必须先调用<font color="#FF0000">ConvertTo32Bit</font>进行转换。<br>
有些函数标注“(>=8Bit)”表示对8位色以上DIB都有效。<br> <br> 2 . 对于矩形,右和下边界与图形学里一样为开区间 (即不包含)。<br>
如选全图为 :(0, 0, 800, 600) 而不是 (0, 0, 799, 599)<br> <br> 3 . 打开一幅新图像前要调用->ClearAllList
()<br> <br> 4 . 如果注明 : (支持 AUTO-Undo/Redo)<br> 则当m_UndoFlag == true时, 函数自动保存当前DIB。<br>
</td></tr> </table><h2><font color="#FF0000"><b>成员函数(Member Functions):</b></font></h2><table width="85%" border="1" bordercolor="#3399FF" align="center" cellpadding="0" bgcolor="#CCFFFF">
<tr> <td colspan="2"> <div align="center"><font color="#FF0000"><b>一般操作</b></font></div></td></tr>
<tr> <td width="50%"> <div align="center">函数原型</div></td><td width="50%"> <div align="center">功能</div></td></tr>
<tr> <td width="50%"><font color="#FF0000">FCDibEffect (bool bUndo = false</font><font color="#FF0000">)<br>
FCDibEffect (FCDibEffect & dib)<br> </font></td><td width="50%">构造函数。</td></tr>
<tr> <td width="50%"><font color="#FF0000">void AddToUndoList ()</font></td><td width="50%">把当前DIB加入Undo
List。</td></tr> <tr> <td width="50%"><font color="#FF0000">void ClearAllList ()</font></td><td width="50%">清空Undo/Redo队列。</td></tr>
<tr> <td><font color="#FF0000">void SetUndoEnable (bool bEnable = false)<br> </font><font color="#FF0000">BOOL GetUndoFlag
()<br> bool IsUndoEnable () <br> bool IsRedoEnable () <br> </font></td><td width="50%">设置自动Undo/Redo。</td></tr>
<tr> <td width="50%"><font color="#FF0000">void Undo ()</font></td><td rowspan="2">撤销/重作一步操作。</td></tr>
<tr> <td width="50%"><font color="#FF0000">void Redo ()</font></td></tr> </table><BR><BR><TABLE WIDTH="85%" BORDER="1" BORDERCOLOR="#3399FF" ALIGN="center" CELLPADDING="0" BGCOLOR="#CCFFFF">
<TR> <TD COLSPAN="3"> <DIV ALIGN="center"><B><FONT COLOR="#FF0000">区域处理</FONT></B></DIV></TD></TR>
<TR> <TD WIDTH="50%"> <DIV ALIGN="center">函数原型</DIV></TD><TD COLSPAN="2"> <DIV ALIGN="center">功能</DIV></TD></TR>
<TR> <TD ROWSPAN="4"><FONT COLOR="#FF0000"> void SetRectRgn (int nLeft, int nTop,
<BR> int nRight, int nBottom)<BR> void SetRoundRectRgn (int nLeft, int
nTop,<BR> </FONT> <FONT COLOR="#FF0000"> int nRight, int nBottom,<BR> </FONT>
<FONT COLOR="#FF0000"> int nWidthEllipse,<BR> </FONT> <FONT COLOR="#FF0000">
int nHeightEllipse)<BR> void SetEllipticRgn (int nLeft, int nTop,<BR> int
nRight, int nBottom)<BR> void SetPolygonRgn (POINT * ppt,<BR> int cNumPoint,<BR>
int nFillMode = ALTERNATE)</FONT></TD><TD WIDTH="10%">矩形</TD><TD WIDTH="90%" ROWSPAN="4">选择处理区域。</TD></TR><TR><TD WIDTH="10%">圆角矩形</TD></TR><TR><TD WIDTH="10%">椭圆</TD></TR><TR><TD WIDTH="10%">多边形</TD></TR><TR><TD><FONT COLOR="#FF0000">bool HasSelection
()<BR> bool IsInSelection (int x, int y)</FONT></TD><TD COLSPAN="2">测试。</TD></TR>
<TR><TD><FONT COLOR="#FF0000">void GetBoundBox (RECT * rect)<BR> void ClearSelection
()</FONT></TD><TD COLSPAN="2"> </TD></TR> </TABLE><BR><BR><table width="85%" border="1" bordercolor="#3399FF" align="center" cellpadding="0" bgcolor="#CCFFFF">
<tr> <td colspan="3"> <div align="center"><b><font color="#FF0000">平移</font></b></div></td></tr>
<tr> <td width="50%"> <div align="center">函数原型</div></td><td colspan="2"> <div align="center">功能</div></td></tr>
<tr> <td><font color="#FF0000">void operator << (int iWidth)</font><font color="#FF0000"><BR>void operator
>> (int iWidth)</font></td><td rowspan="2"> 图象左/右,上/下平移,用白色填充。</td><td rowspan="3" width="10%">
<div align="center"><font color="#FF0000">>= 8 bit</font></div></td></tr> <tr>
<td><font color="#FF0000">void ShiftUp (int iHeight)<BR></font><font color="#FF0000">void ShiftDown
(int iHeight)</font></td></tr> <tr> <td><font color="#FF0000">void ColShiftUp
(int iCol, int iHeight)<BR></font><font color="#FF0000">void ColShiftDown (int
iCol, int iHeight)</font></td><td width="40%"> <p>iCol列上/下移动iHeight象素。<br> 用白色填充。</p></td></tr>
</table><br> <br> <table width="85%" border="1" bordercolor="#3399FF" align="center" cellpadding="0" bgcolor="#CCFFFF">
<tr> <td colspan="2"> <div align="center"><b><font color="#FF0000">特效处理 (支持 AUTO-Undo/Redo)</font></b></div></td></tr>
<tr> <td width="50%"> <div align="center">函数原型</div></td><td width="50%"> <div align="center">功能</div></td></tr>
<tr> <td width="50%"><font color="#FF0000">void AddFrame (int iLeft,<br> int
iTop,<br> int iRight,<br> int iBottom)<br> void EraseFrame (int
iLeft,<br> int iTop,<br> int iRight,<br> int iBottom)
</font></td><td width="50%">加/减边框。<font color="#EC5F00">(全图)</font> (边框用黑色填充)<br>
<br> 适用于 :<font color="#FF0000">>= 8 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">
void DuplicateFrame (int iLeft,<br> int iTop,<br> int iRight,<br>
int iBottom)</font></td><td width="50%">同<font color="#FF0000">AddFrame</font>,但边缘象素用边界填充。<font color="#999999"><br>
<br> </font>适用于 :<font color="#999999"><font color="#999999"><font color="#FF0000">24,32
bit</font></font> </font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Flip
()</font></td><td width="50%">上下翻转。<br> <br> 适用于 :<font color="#FF0000">>=
8 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Mirror
()</font></td><td width="50%">左右镜像。<br> <br> 适用于 :<font color="#FF0000">>=
8 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Rotate90
()</font></td><td width="50%">顺时针旋转 90'。<font color="#EC5F00">(全图)<br> <br> </font>适用于
:<font color="#FF0000">>= 8 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Rotate270
()</font></td><td width="50%">顺时针旋转 270'。<font color="#EC5F00">(全图)<br> <br> </font>适用于
:<font color="#FF0000">>= 8 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Rotate
(int iAngle)</font></td><td width="50%">顺时针旋转 iAngle 度。<font color="#EC5F00">(全图)</font><br>
iAngle :[1..89]<br> <font color="#FF0000">暂用 PlgBlt 实现,需要Win2000。<br> <br> </font>适用于
:<FONT COLOR="#FF0000">all</FONT></td></tr> <tr> <td width="50%"><font color="#FF0000">BOOL Stretch
(DWORD dwWidth, DWORD dwHeight,<br> int iType = TRUE)</font></td><td width="50%">缩放。<font color="#EC5F00">(全图)</font><br>
iType == TRUE 为宽高成比例缩放。<br> <br> 适用于 :<FONT COLOR="#FF0000">all</FONT></td></tr>
<tr> <td width="50%"><font color="#FF0000"> void AdjustRGB (int iValueR,<br> </font>
<font color="#FF0000"> int iValueG,<br> </font> <font color="#FF0000">
int iValueB)</font></td><td width="50%">调节RGB值。<br> <br> 适用于 :<font color="#FF0000">!=
16 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000"> void AdjustBrightness
(int iValue,<br> </font> <font color="#FF0000"> </font> <font color="#FF0000">
BOOL bFlag = TRUE)</font><font color="#FF0000"><br> void AdjustBrightnessPixel
(int x, int y,<br> </font> <font color="#FF0000"> int iValue,<br>
</font> <font color="#FF0000"> BOOL bFlag = TRUE)</font></td><td>调节亮度。<br>
iValue :bFlag == TRUE, 则iValue为按增量<br> bFlag == FALSE, 则iValue为按百分比,<br>
如 150 (means 新值为原来的150%)<br> (按增量调节会加亮黑色区域,而比值不会)<br> <br> 适用于 :<font color="#FF0000">!=
16 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000"> void AdjustContrast
(int iPercent)</font><font color="#FF0000"><br> void AdjustContrastPixel (int
x, int y,<br> </font> <font color="#FF0000"> int iPercent)</font></td><td>调节对比度。<br>
iPercent :为按百分比的增量。,<br> 如 150 (means 新值为原来的150%)<br> <br> 适用于 :<font color="#FF0000">!=
16 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void AdjustHue
(int iPercent)</font></td><td>调节色调。<br> iPercent :同上。<br> <br> 适用于 :<font color="#FF0000">!=
16 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">void AdjustSaturation
(int iPercent)</font></td><td>调节饱和度。<br> iPercent :同上。<br> <br> 适用于 :<font color="#FF0000">!=
16 bit</font></td></tr> <tr> <td width="50%" height="14"><font color="#FF0000">void AdjustHS
(int iPercentHue, int iPercentSat)</font></td><td height="14">调节色调 &&
饱和度。<br> iPercentHue/iPercentSat:同上。<br> <br> 适用于 :<font color="#FF0000">!= 16
bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000"> void Negate ()</font></td><td>颜色反转。<br>
<br> 适用于 :<font color="#FF0000">!= 16 bit</font></td></tr> <tr> <td width="50%"><font color="#FF0000">
void Emboss (int iStep = 2,<br> int nDirection = DIRECT_RIGHT)</font></td><td>浮雕效果。<br>
iStep :越大效果越显著。<br> <font color="#999999">nDirection :运算方向(reserved)。<br> <br>
</font>适用于 :<font color="#999999"><font color="#FF0000">24,32 bit</font></font></td></tr>
<tr> <td width="50%"><font color="#FF0000"> void Windy (int nStep,<br>
int nDirection = DIRECT_RIGHT, <br> bool bSmooth = true)</font></td><td>风化效果。(使用平均算法)<br>
nStep :风化程度,必须 >=1 。<br> nDirection :DIRECT_RIGHT<br> DIRECT_LEFT<br>
bSmooth :柔和风化。<br> <font color="#999999">内部调用WindySoftLine进行行运算。<br> <br> </font>适用于
:<font color="#999999"><font color="#999999"><font color="#FF0000">24,32 bit</font></font>
</font></td></tr> <tr> <td width="50%"><font color="#FF0000"> void Column ()</font></td><td>柱面效果。<br>
<br> 适用于 :<font color="#999999"><font color="#999999"><font color="#FF0000">>=
16 bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void SmoothAverage
(int iBlockLen)</font></td><td> 模糊效果(使用平均算法)。<br> iBlockLen :小正方形边长( >= 2 )<br>
<font color="#999999">内部调用SmoothAverageNoEdge进行图象主体运算。</font><br> <br> 适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Sharp
(int iStep = 1)</font></td><td> 锐化效果。<br> iStep :值越大效果越显著。<br> <br> 适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Mosaic
(int iBlockLen)</font></td><td> 马赛克效果。<br> iBlockLen :小正方形边长( >= 2 )<br> <br>
适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Stripe
(int iSwing, int iFrequency)</font></td><td>带状效果。<br> iSwing :振幅[0..100]<br> iFrequency
:频率 >=0<br> <br> 适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void ConvoluteDIB
(int * iElement,<br> int iLength,<br> int iDivisor)</font></td><td>
卷积运算。<br> iElement :从矩阵左上角开始按行存储<br> iLength :为矩阵宽度( >= 3 )<br> <font color="#999999">内部调用ConvoluteDIBNoEdge进行图象主体运算。</font><br>
<br> 适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> <tr> <td width="50%"><font color="#FF0000">void Algorithm
(int iAlgorithm)</font></td><td>基于卷积的特效算法。<br> iAlgorithm :见StdDefine.h<br> <br>
适用于 :<font color="#999999"><font color="#999999"><font color="#999999"><font color="#999999"><font color="#FF0000">24,32</font></font></font><font color="#FF0000">
bit</font></font></font></td></tr> </table><br> <br> <h2 align="center"><img src="stripe.gif" width="94%" height="2"><br>
</h2><table align=center bgcolor=ghostwhite border=0 cellpadding=0 cellspacing=0
width=650> <tbody> <tr> <td width="85%"> <p align=center>版权所有 <br> (C)1999 - 2002
付黎<br> <a href="mailto:crazybit@263.net">给我发信</a> <a
href="javascript:window.close()">关闭窗口</a> </p></td></tr> </tbody> </table><p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -