ImageEn, unit imageenproc
TImageEnProc.GetHSVChannel
TImageEnProc
.GetHSVChannel
Declaration
function GetHSVChannel(Channel: Integer):
TIEBitmap
; overload;
procedure GetHSVChannel(BitmapH, BitmapS, BitmapV:
TIEBitmap
); overload;
Description
Return a Bitmap with the specified HSV channel or all channels. The resulting Bitmap is a gray level representation of the specified channel.
Channel
is the HSV channel. You can use the following constants:
Constants
Description
HSV_Hue
(0)
Hue
HSV_Sat
(1)
Saturation
HSV_Val
(2)
Value
Note:
◼
If the image
PixelFormat
is not ie24RGB, it will be converted
◼
You need to free the bitmap returned by GetHSVChannel()
Demos
Demos\ImageEditing\CompleteEditor\PhotoEn.dpr
Demos\ImageEditing\EveryMethod\EveryMethod.dpr
Image Testing
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Return the Hue channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Hue );
// Return the Saturation channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Sat );
// Return the Value channel of the image
bmp1 := ImageEnView1.Proc.GetHSVChannel( HSV_Val );
Example
HueBMP := ImageEnView1.Proc.GetHSVChannel( HSV_Hue );
SatBMP := ImageEnView1.Proc.GetHSVChannel( HSV_Sat );
ValBMP := ImageEnView1.Proc.GetHSVChannel( HSV_Val );
ImageEnView2.IEBitmap.Assign(HueBMP); // copy Hue channel
ImageEnView3.IEBitmap.Assign(SatBMP); // copy Saturation channel
ImageEnView4.IEBitmap.Assign(ValBMP); // copy Value channel
HueBMP.Free;
SatBMP.Free;
ValBMP.Free;
ImageEnView2.Update();
ImageEnView3.Update();
ImageEnView4.Update();
// Which is the same as...
ImageEnView1.Proc.GetHSVChannel( ImageEnView2.IEBitmap, ImageEnView3.IEBitmap, ImageEnView4.IEBitmap);
ImageEnView2.Update();
ImageEnView3.Update();
ImageEnVIew4.Update();