#include <bevfill.h>
Inheritance diagram for CBevelFillFlat:
Public Member Functions | |
COLORREF | CalcPixelValue (BYTE value, double Pos, INT32 Contrast) |
Do a flat fill. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (CBevelFillFlat) |
Definition at line 144 of file bevfill.h.
|
Do a flat fill.
Implements CBevelFill. Definition at line 224 of file bevfill.cpp. 00225 { 00226 double RValue = value; 00227 double GValue = value; 00228 double BValue = value; 00229 double AValue = value; 00230 00231 if (AValue < SplitValue) 00232 { 00233 AValue *= 255.0 / SplitValue; 00234 } 00235 else 00236 { 00237 AValue = 255.0 - AValue; 00238 AValue *= 255.0 / (255.0 - SplitValue); 00239 00240 AValue = 1.0 - (AValue / 255.0); 00241 AValue *= AValue; 00242 AValue = (1.0 - AValue) * 255.0; 00243 } 00244 00245 AValue *= 200.0 / 255.0; 00246 00247 RValue += 0.5; 00248 GValue += 0.5; 00249 BValue += 0.5; 00250 00251 EnsureValueRange(&AValue); 00252 00253 BYTE RByte = (BYTE)RValue; 00254 BYTE GByte = (BYTE)GValue; 00255 BYTE BByte = (BYTE)BValue; 00256 BYTE AByte = (BYTE)AValue; 00257 00258 return RByte | (GByte << 8) | (BByte << 16) | (AByte << 24); 00259 }
|
|
|