part 2... hope all this MT stuff will work ;-)
This commit is contained in:
@ -42,8 +42,15 @@ type
|
||||
Buckets: TBucketArray;
|
||||
ColorMap: TColorMapArray;
|
||||
|
||||
bounds: array[0..3] of extended;
|
||||
size: array[0..1] of extended;
|
||||
FinalXform: ^TXform;
|
||||
UseFinalXform: boolean;
|
||||
|
||||
camX0, camX1, camY0, camY1, // camera bounds
|
||||
camW, camH, // camera sizes
|
||||
Xsize, Ysize: double;
|
||||
bws, bhs, cosa, sina, rcX, rcY: double;
|
||||
// bounds: array[0..3] of extended;
|
||||
// size: array[0..1] of extended;
|
||||
ppux, ppuy: extended;
|
||||
FNrOfTreads: integer;
|
||||
WorkingThreads: array of TBucketFillerThread;
|
||||
@ -113,7 +120,7 @@ var
|
||||
scale: double;
|
||||
t0, t1: double;
|
||||
t2, t3: double;
|
||||
corner0, corner1: double;
|
||||
corner_x, corner_y: double;
|
||||
shift: Integer;
|
||||
begin
|
||||
scale := power(2, fcp.zoom);
|
||||
@ -127,8 +134,9 @@ begin
|
||||
t1 := (gutter_width) / (oversample * ppuy);
|
||||
t2 := (2 * max_gutter_width - gutter_width) / (oversample * ppux);
|
||||
t3 := (2 * max_gutter_width - gutter_width) / (oversample * ppuy);
|
||||
corner0 := fcp.center[0] - fcp.Width / ppux / 2.0;
|
||||
corner1 := fcp.center[1] - fcp.Height / ppuy / 2.0;
|
||||
corner_x := fcp.center[0] - fcp.Width / ppux / 2.0;
|
||||
corner_y := fcp.center[1] - fcp.Height / ppuy / 2.0;
|
||||
{
|
||||
bounds[0] := corner0 - t0;
|
||||
bounds[1] := corner1 - t1 + shift;
|
||||
bounds[2] := corner0 + fcp.Width / ppux + t2;
|
||||
@ -141,6 +149,31 @@ begin
|
||||
size[1] := 1.0 / (bounds[3] - bounds[1])
|
||||
else
|
||||
size[1] := 1;
|
||||
}
|
||||
camX0 := corner_x - t0;
|
||||
camY0 := corner_y - t1 + shift;
|
||||
camX1 := corner_x + fcp.Width / ppux + t2;
|
||||
camY1 := corner_y + fcp.Height / ppuy + t3; //+ shift;
|
||||
camW := camX1 - camX0;
|
||||
if abs(camW) > 0.01 then
|
||||
Xsize := 1.0 / camW
|
||||
else
|
||||
Xsize := 1;
|
||||
camH := camY1 - camY0;
|
||||
if abs(camH) > 0.01 then
|
||||
Ysize := 1.0 / camH
|
||||
else
|
||||
Ysize := 1;
|
||||
bws := (BucketWidth - 0.5) * Xsize;
|
||||
bhs := (BucketHeight - 0.5) * Ysize;
|
||||
|
||||
if FCP.FAngle <> 0 then
|
||||
begin
|
||||
cosa := cos(FCP.FAngle);
|
||||
sina := sin(FCP.FAngle);
|
||||
rcX := FCP.Center[0]*(1 - cosa) - FCP.Center[1]*sina - camX0;
|
||||
rcY := FCP.Center[1]*(1 - cosa) + FCP.Center[0]*sina - camY0;
|
||||
end;
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -317,6 +350,7 @@ begin
|
||||
Result.BucketWidth := BucketWidth;
|
||||
Result.BucketHeight := BucketHeight;
|
||||
Result.Buckets := @Buckets;
|
||||
{
|
||||
Result.size[0] := size[0];
|
||||
Result.size[1] := size[1];
|
||||
Result.bounds[0] := Bounds[0];
|
||||
@ -325,6 +359,18 @@ begin
|
||||
Result.bounds[3] := Bounds[3];
|
||||
Result.RotationCenter[0] := FCP.Center[0];
|
||||
Result.RotationCenter[1] := FCP.Center[1];
|
||||
}
|
||||
Result.camX0 := camX0;
|
||||
Result.camY0 := camY0;
|
||||
Result.camW := camW;
|
||||
Result.camH := camH;
|
||||
Result.bws := bws;
|
||||
Result.bhs := bhs;
|
||||
Result.cosa := cosa;
|
||||
Result.sina := sina;
|
||||
Result.rcX := rcX;
|
||||
Result.rcY := rcY;
|
||||
|
||||
Result.ColorMap := colorMap;
|
||||
Result.CriticalSection := CriticalSection;
|
||||
Result.Nrbatches := FNrBatches;
|
||||
|
Reference in New Issue
Block a user