Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- {$I SRL/osr.simba}
- var
- BMP: TMufasaBitmap;
- x: Int32;
- P: TPoint;
- rect: TRectangle;
- M: TSingleMatrix;
- n: Double;
- TPA: TPointArray;
- mouses: TPointArray;
- h,s,l: Extended;
- pts: TPointArray;
- begin
- SRL_GAUSS_CUTOFF := 5.5;
- BMP := GetMufasaBitmap(CreateBitmap(500, 500));
- BMP.Debug();
- M.SetSize(500,500);
- rect := Box(Random(190, 200), Random(190, 200), Random(250, 350), Random(250, 350)).ToRectangle.Rotate(Radians(Random(360)));
- pts := [[Random(100, 400),Random(100, 400)],[Random(100, 400),Random(100, 400)],[Random(100, 400),Random(100, 400)],[Random(100, 400),Random(100, 400)]];
- repeat
- BMP.DrawRect(rect, clOrange);
- for x:=1 to 3 do
- begin
- if x <> 3 then
- P := pts[x]
- else
- P := Mouse.Position();
- mouses.append(p);
- for 0 to 10000 do
- with srl.rowp(P, rect) do
- begin
- M[Y,X] += 1;
- M[Y+1,X] += 1;
- M[Y-1,X] += 1;
- M[Y,X-1] += 1;
- M[Y,X+1] += 1;
- TPA.Append(Point(X,Y));
- end;
- end;
- //max of heatmap
- n := M.Max();
- //value to heat
- for p in TPA do
- BMP.SetPixel(p.X, p.Y, HSLToColor(90 - M[p.Y,p.X] / n * 90, 100, 60));
- for p in mouses do
- BMP.DrawCircleFilled(P, 5, False, clRed);
- DrawBitmapDebugImg(bmp.getIndex());
- BMP.Clear();
- TPA := [];
- mouses := [];
- M.Fill(TBox([0,0,490,490]), 0);
- until False;
- BMP.Free();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement