P2 := Colortogray ( p1, aMethod ) end end finallyĪBitmap. GetScanline ( Y )) for X := 0 to ( aBitmap. ![]() Write, bd2 )) then begin try for Y := 0 to ( aBitmap. P1, p2 : PAlphaColorArray begin Result := TBitmap. B, 2.2 )), 1 / 2.2 ) ) else begin RGBToHSL ( aColor, H, S, L ) Exit ( HSLtoRGB ( 0, 0, L )) end end exit ( Makecolor ( gris, gris, gris )) end function ConvertToGrayscale ( const aBitmap : TBitmap const aMethod : TAlgorithm = algnone ): TBitmap var Minvalue ()) / 2 ) Īlpow : gris := round ( power (( 0.2126 * power ( c. B ) div 3 Īlglightness : gris := Round (( maxvalue () + ![]() Type Talgorithm = ( algnone, algluminosity, algaverage, alglightness, alpow ) function ConvertToGrayscale ( const aBitmap : TBitmap const aMethod : TAlgorithm = algnone ) : TBitmap overload function ConvertToGrayscale ( const FileName : String const aMethod : TAlgorithm = algnone ) : TBitmap overload function ConvertToGrayscale ( const aStream : TMemoryStream const aMethod : TAlgorithm = algnone ) : TBitmap overload įunction Colortogray ( const aColor : Talphacolor const aAlgo : TAlgorithm = algnone ) : Talphacolor varĪlgluminosity : gris := Round (( 0.2126 * c. Not tested on 11.1 yet but I wrote this unit (for FMX)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |