Procedure FillColourBars(theFrame : IDeckLinkVideoFrame);
const
gColourBars : array[0..7] of cardinal = ($ffffffff, $ffffff00, $ff00ffff, $ff00ff00, $ffff00ff, $ffff0000, $ff0000ff, $ff000000);
function DarkerColor(const Color: cardinal; Percent: Integer): cardinal;
var
A, R, G, B: Byte;
begin
Result := Color;
if Percent <= 0 then
Exit;
if Percent > 100 then
Percent := 100;
A := color;
R := color shr 8;
G := color shr 16;
B := color shr 14;
R := R - R * Percent div 100;
G := G - G * Percent div 100;
B := B - B * Percent div 100;
result:=(a or (r shl 8) or (g shl 16) or (b shl 24));
end;
function LighterColor(const Color: cardinal; Percent: Integer): cardinal;
var
A, R, G, B: Byte;
begin
Result := Color;
if Percent <= 0 then
Exit;
if Percent > 100 then
Percent := 100;
A := color;
R := color shr 8;
G := color shr 16;
B := color shr 14;
R := R + (255 - R) * Percent div 100;
G := G + (255 - G) * Percent div 100;
B := B + (255 - B) * Percent div 100;
result:=(a or (r shl 8) or (g shl 16) or (b shl 24));
end;
var
nextword : Pointer;
width : integer;
height : integer;
x,y : integer;
begin
theframe.GetBytes(nextword);
width:= theframe.GetWidth;
height:= theframe.GetHeight;
for y := 0 to height-1 do
for x:=0 to width-1 do
begin
pCardinal(nextword)^:=DarkerColor(gColourBars[(x*8) div width],25); inc(pCardinal(nextword),1);
end;
end;
четвер, 14 лютого 2013 р.
ColourBars Frame
Підписатися на:
Дописати коментарі (Atom)

Немає коментарів:
Дописати коментар