Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- {$I SRL/osr.simba}
- //HACK TO WORK: Start it once, stop the script, use simba to target the debug image that showed up, start the script..
- 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;
- n := M.Max();
- for p in TPA do
- begin
- //H := Min(30, 180 - M[p.Y,p.X] / n * 180);
- //S := 100;
- //L := 60*min(1,h/5);
- //BMP.SetPixel(p.x, p.y, HSLToColor(H,S,L));
- BMP.SetPixel(p.X, p.Y, HSLToColor(90 - M[p.Y,p.X] / n * 90, 100, 60));
- end;
- 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