gem.c

来自「gif图像文件软件解码器的arm版本的源代码程序」· C语言 代码 · 共 59 行

C
59
字号
///////////////////////////////////////////////////////////////////////////////
//
//  gem.c
//
//  DESCRIPTION
//        Define color match function.

//
///////////////////////////////////////////////////////////////////////////////

/*
  Include declarations.
*/
#include "gifcommon.h"

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
+   C o l o r M a t c h                                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ColorMatch() returns true if two pixels are identical in color.
%
%  The format of the ColorMatch method is:
%
%      void ColorMatch(const PixelPacket *p,const PixelPacket *q,
%        const double fuzz)
%
%  A description of each parameter follows:
%
%    o p: Pixel p.
%
%    o q: Pixel q.
%
%    o distance:  Define how much tolerance is acceptable to consider
%      two colors as the same.
%
%
*/
unsigned int ColorMatch
(
    const PixelPacket   *p,
    const PixelPacket   *q
)
{
    if ((p->red == q->red) && (p->green == q->green) && (p->blue == q->blue))
    {
        return(OP_TRUE);
    }
    else 
    {
        return(OP_FALSE);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?