📄 rgb2hsv.h
字号:
//
// Rgb2Hsv.h
// Pipeline stage converts a color image to hue, saturation, value
//
// Copyright (C) 2003, 2006 by Jon A. Webb (Contact via GMail; username is jonawebb)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef CRgb2Hsv_h
#define CRgb2Hsv_h
#include "ImageSize.h"
#include "PipelineStage.h"
#include <e32cons.h>
#include <e32std.h>
namespace Algorithm
{
class CRgb2Hsv :
public Core::MPipelineStage
{
// Lifecycle
public:
IMPORT_C static CRgb2Hsv* NewL();
~CRgb2Hsv(void);
private:
CRgb2Hsv(void);
///////////////////// Overrides ////////////////////////
//
// Overrides from MPipelineStage:
//
// Operations
public:
Core::CImage FrontL();
void PushL(Core::CImage);
// Accessors
public:
bool Empty() const;
//
//
/////////////////// End of overrides ///////////////////
// operations
// RGBtoHSV
// Converts input rgb color value to HSV value
// All data are unsigned char
// r,g,b values are from 0 to 255
// h = [0,242],255
// magenta = 0 red = 40 yellow = 80
// yellowish-green = 81 green = 121 cyan = 161
// cyanish-blue = 162 blue = 202 bluish-magenta = 242
// if s == 0 or r = g = b, then h = 255 (undefined)
// s = [0,255],
// v = [0,255]
//
static void CRgb2Hsv::RGBtoHSV(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char *h,
unsigned char *s,
unsigned char *v );
private:
// Attributes
bool ibEmpty;
Core::CImage iImage;
Core::IImageSize iSize;
};
};
#endif // CRgb2Hsv_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -