diff options
author | Erich Eckner <git@eckner.net> | 2017-12-20 09:50:29 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-12-20 09:50:29 +0100 |
commit | 0ce6df471313204f722fa910a7a995d526d08908 (patch) | |
tree | 0a0fbe48721d937d87a4bb78c89660b86573eae7 /werteunit.inc | |
parent | 7ea5def04a5543022e46720d00b765382615a00f (diff) | |
download | epost-0ce6df471313204f722fa910a7a995d526d08908.tar.xz |
werteunit.inc: lambda-zu-omega-Transformation repariert (ist nun glatter und erzeugt somit keine Kanten mehr in der Phase)
Diffstat (limited to 'werteunit.inc')
-rw-r--r-- | werteunit.inc | 83 |
1 files changed, 46 insertions, 37 deletions
diff --git a/werteunit.inc b/werteunit.inc index de62f39..30efbc0 100644 --- a/werteunit.inc +++ b/werteunit.inc @@ -102,60 +102,69 @@ end; {$IFDEF tLLWerte_kopiereLOVerzerrt} //procedure tLLWerte.kopiereLOVerzerrt(original: pTLLWerteSingle; xMin,xMax,tMin,tMax: longint; verhHo,verhVe: extended); var - i,j,hV,hB,vV,vB,h,v: int64; + i,j,h,v: int64; + hV,hB,vV,vB,xAnteil,yAnteil: extended; begin gibAus(intToStr(xMin)+' .. '+intToStr(xMax)+' x '+intToStr(tMin)+' .. '+intToStr(tMax),1); for i:=tMin to tMax do begin if verhVe>0 then begin - vV:=max( - 0, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i+0.5)/verhVe/(params.tSiz-1)) - ) - ); - vB:=min( - params.tSiz-1, - round( - (params.tSiz-1-i+0.5)/ - (1 + (i-0.5)/verhVe/(params.tSiz-1)) - ) - ); + vV:= + max( + 0, + (params.tSiz-1-(i+1))/ + (1 + (i+1)/verhVe/(params.tSiz-1)) + ); + vB:= + min( + params.tSiz, + (params.tSiz-1-i)/ + (1 + i/verhVe/(params.tSiz-1)) + ); end else begin - vV:=i; - vB:=i; + vV:=i; // Pixel starten bei i und enden bei i+1 + vB:=i+1; end; for j:=xMin to xMax do begin if verhHo>0 then begin - hV:=max( - 0, - round( - (params.xSteps-1-(j+0.5))/ - (1 + (j+0.5)/verhHo/(params.xSteps-1)) - ) - ); - hB:=min( - params.xSteps-1, - round( - (params.xSteps-1-(j-0.5))/ - (1 + (j-0.5)/verhHo/(params.xSteps-1)) - ) - ); + hV:= + max( + 0, + (params.xSteps-1-(j+1))/ + (1 + (j+1)/verhHo/(params.xSteps-1)) + ); + hB:= + min( + params.xSteps, + (params.xSteps-1-j)/ + (1 + j/verhHo/(params.xSteps-1)) + ); end else begin hV:=j; - hB:=j; + hB:=j+1; end; werte[j+i*params.xSteps]:=0; - for h:=hV to hB do - for v:=vV to vB do + for h:=max(0,floor(hV)) to min(params.xSteps-1,ceil(hB)) do begin + xAnteil:=1; + if h=floor(hV) then // linker Rand + xAnteil:=xAnteil-(hV-h); // hV-h fehlt am ganzen Pixel + if h=ceil(hB) then // rechter Rand + xAnteil:=xAnteil-(1+h-hB); // 1+h-hB fehlt am ganzen Pixel (1+h ist der rechte Rand des Pixels!) + for v:=max(0,floor(vV)) to min(params.tSiz-1,ceil(vB)) do begin + yAnteil:=1; // s.o. + if v=floor(vV) then + yAnteil:=yAnteil-(vV-v); + if v=ceil(vB) then + yAnteil:=yAnteil-(1+v-vB); werte[j+i*params.xSteps]:= werte[j+i*params.xSteps]+ - original^.werte[h+v*params.xSteps]; - if (hB>=hV) and (vB>=vV) then + original^.werte[h+v*original^.params.xSteps]*xAnteil*yAnteil; + end; + end; + if (hB>hV) and (vB>vV) then werte[j+i*params.xSteps]:= - werte[j+i*params.xSteps] / (hB+1-hV) / (vB+1-vV); + werte[j+i*params.xSteps] / (hB-hV) / (vB-vV); end; end; end; |