equal
deleted
inserted
replaced
491 end; |
491 end; |
492 {$ENDIF} |
492 {$ENDIF} |
493 end; |
493 end; |
494 |
494 |
495 procedure Tint(r, g, b, a: Byte); inline; |
495 procedure Tint(r, g, b, a: Byte); inline; |
496 const |
496 var nc, tw: Longword; |
497 lastTint: Longword = 0; |
|
498 var |
|
499 nc, tw: Longword; |
|
500 begin |
497 begin |
501 nc:= (a shl 24) or (b shl 16) or (g shl 8) or r; |
498 nc:= (a shl 24) or (b shl 16) or (g shl 8) or r; |
502 |
499 |
503 if nc = lastTint then |
500 if nc = lastTint then |
504 exit; |
501 exit; |
505 |
502 |
506 if cGrayScale then |
503 if GrayScale then |
507 begin |
504 begin |
508 tw:= round(r * RGB_LUMINANCE_RED + g * RGB_LUMINANCE_GREEN + b * RGB_LUMINANCE_BLUE); |
505 tw:= round(r * RGB_LUMINANCE_RED + g * RGB_LUMINANCE_GREEN + b * RGB_LUMINANCE_BLUE); |
509 if tw > 255 then |
506 if tw > 255 then |
510 tw:= 255; |
507 tw:= 255; |
511 r:= tw; |
508 r:= tw; |