Pascal to BASM
From: Alexandru Preda (alexandru.preda_at_adpharma.ro)
Date: 02/20/05
- Next message: Pierre le Riche: "Re: Pascal to BASM"
- Previous message: Dennis Landi: "Re: Can I use one of the new MMs?"
- Next in thread: Pierre le Riche: "Re: Pascal to BASM"
- Reply: Pierre le Riche: "Re: Pascal to BASM"
- Reply: Lars: "Re: Pascal to BASM"
- Reply: Lord Crc: "Re: Pascal to BASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 20 Feb 2005 07:35:37 +0200
Hello,
I was wondering if anyone can help me converting the following function:
function LinearInterpolator(PWX, PWY: byte; C11, C21: PByte): byte;
function CombineReg(X, Y, W: byte): byte;
begin
if W = 0 then
Result := Y
else if W = 255 then
Result := X
else Result := round(X * W/255 + (1 - W/255) * Y);
end;
var C1, C3: byte;
begin
if PWX > $FF then
PWX := $FF;
if PWY > $FF then
PWY := $FF;
C1 := C11^;
Inc(C11);
C3 := C21^;
Inc(C21);
Result := CombineReg(CombineReg(C1, C11^, PWX), CombineReg(C3, C21^,
PWX), PWY);
end;
Thank you in advance.
Alex
- Next message: Pierre le Riche: "Re: Pascal to BASM"
- Previous message: Dennis Landi: "Re: Can I use one of the new MMs?"
- Next in thread: Pierre le Riche: "Re: Pascal to BASM"
- Reply: Pierre le Riche: "Re: Pascal to BASM"
- Reply: Lars: "Re: Pascal to BASM"
- Reply: Lord Crc: "Re: Pascal to BASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|