Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" height="600px" width="1000px" id="svg2249" sodipodi:version="0.32" inkscape:version="0.45.1" sodipodi:docname="bicycling.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" sodipodi:docbase="M:\Documents\map-icons\svg\recreation">
<metadata id="metadata2260">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
</cc:Work>
<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
</cc:License>
</rdf:RDF>
</metadata>
<defs id="defs2258"/>
<sodipodi:namedview inkscape:window-height="573" inkscape:window-width="797" inkscape:pageshadow="2" inkscape:pageopacity="0.0" guidetolerance="10.0" gridtolerance="10.0" objecttolerance="10.0" borderopacity="1.0" bordercolor="#666666" pagecolor="#ffffff" id="base" inkscape:zoom="0.62833333" inkscape:cx="500" inkscape:cy="300" inkscape:window-x="174" inkscape:window-y="181" inkscape:current-layer="svg2249"/>
<circle cx="215" cy="409" r="161" style="fill:none;stroke:#000000;stroke-width:40px" id="circle2251" sodipodi:cx="215" sodipodi:cy="409" sodipodi:rx="161" sodipodi:ry="161" transform="matrix(-1,0,0,1,1005,0)"/>
<circle cx="790" cy="406" r="161" style="fill:none;stroke:#000000;stroke-width:40px" id="circle2253" sodipodi:cx="790" sodipodi:cy="406" sodipodi:rx="161" sodipodi:ry="161" transform="matrix(-1,0,0,1,1005,0)"/>
<path style="fill:#000000;fill-rule:evenodd;stroke:none" d="M 575.51563,15.467118 C 708.0821,16.75919 685.60007,1.7711686 756.92238,230.98455 C 815.02489,414.12586 808.69613,394.15363 809,407 C 809.21296,416.98022 801.15667,424.89312 791.03306,425.57043 C 769.97946,423.44166 778.83508,427.84741 705.84252,201.18078 C 439.13037,482.5364 539.19408,436.91194 395.65936,442.62576 C 207.01701,440.81686 191.68443,452.4455 189.44484,424.79518 C 189.70326,415.40613 194.09629,409.80716 323.5618,121.67535 L 311.15792,87.564675 L 268.51958,86.789433 L 270.07006,51.128275 L 428.99479,51.128275 C 443.03529,70.337063 423.30967,70.250925 352.24577,86.01419 L 364.64965,120.9001 L 681.72386,121.67535 C 660.36162,47.079788 672.42095,51.731243 576.29087,51.903518 L 575.51563,15.467118 z M 690.88585,159.91012 L 380.62248,159.36001 L 470.29079,400.30922 L 690.88585,159.91012 z M 343.21484,174.21304 L 431.23282,405.26023 L 238.6935,405.81034 L 343.21484,174.21304 z " id="path2255"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="layeroriginal"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<BuildModes Count="3">
<Item1 Name="Debug" Default="True"/>
<Item2 Name="Release">
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="layeroriginal"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="Release macOS">
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
</MacroValues>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="layeroriginal"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="darwin"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item3>
<SharedMatrixOptions Count="1">
<Item1 ID="024990494567" Modes="Release macOS" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
</SharedMatrixOptions>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<RequiredPackages Count="3">
<Item1>
<PackageName Value="bgracontrols"/>
</Item1>
<Item2>
<PackageName Value="BGRABitmapPack"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="layeroriginal.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="layeroriginal"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<IncludeAssertionCode Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<IOChecks Value="True"/>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
<VerifyObjMethodCallValidity Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
<UseHeaptrc Value="True"/>
<TrashVariables Value="True"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,20 @@
program layeroriginal;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Unit1;
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,266 @@
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, BCButton, BGRAVirtualScreen, BGRALayers, BGRAStreamLayers,
BGRABitmap, BGRABitmapTypes, BGRALayerOriginal;
type
{ TForm1 }
TForm1 = class(TForm)
BCFlipX: TBCButton;
BCRotUD: TBCButton;
BCSave: TBCButton;
BCFlipY: TBCButton;
BCRotCW: TBCButton;
BCRotCCW: TBCButton;
BCColor1: TBCButton;
BCColor2: TBCButton;
BGRAVirtualScreen1: TBGRAVirtualScreen;
ColorDialog1: TColorDialog;
cbInterp: TComboBox;
cbRepeat: TComboBox;
cbGradientType: TComboBox;
SaveDialog1: TSaveDialog;
procedure BCRotUDClick(Sender: TObject);
procedure BCSaveClick(Sender: TObject);
procedure BCFlipXClick(Sender: TObject);
procedure BCFlipYClick(Sender: TObject);
procedure BCRotCWClick(Sender: TObject);
procedure BCRotCCWClick(Sender: TObject);
procedure BCColor1Click(Sender: TObject);
procedure BCColor2Click(Sender: TObject);
procedure BGRAVirtualScreen1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure BGRAVirtualScreen1MouseMove(Sender: TObject; {%H-}Shift: TShiftState;
{%H-}X, {%H-}Y: Integer);
procedure BGRAVirtualScreen1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
procedure cbGradientTypeChange(Sender: TObject);
procedure cbInterpChange(Sender: TObject);
procedure cbRepeatChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
procedure OriginalChange(Sender: TObject; {%H-}AOriginal: TBGRALayerCustomOriginal;
var {%H-}ADiff: TBGRAOriginalDiff);
procedure SetVSCursor(ACursor: TOriginalEditorCursor);
public
FLayers: TBGRALayeredBitmap;
end;
var
Form1: TForm1;
implementation
uses BGRATransform, BGRASVGOriginal, BGRAGradientOriginal, BGRALazPaint;
{$R *.lfm}
{ TForm1 }
procedure TForm1.BCFlipXClick(Sender: TObject);
begin
FLayers.HorizontalFlip;
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.BCSaveClick(Sender: TObject);
begin
if SaveDialog1.Execute then
begin
RegisterLazPaintFormat;
try
FLayers.SaveToFile(SaveDialog1.FileName);
except
on ex:exception do
ShowMessage(ex.Message);
end;
end;
end;
procedure TForm1.BCRotUDClick(Sender: TObject);
begin
FLayers.RotateUD;
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.BCFlipYClick(Sender: TObject);
begin
FLayers.VerticalFlip;
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.BCRotCWClick(Sender: TObject);
begin
FLayers.RotateCW;
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.BCRotCCWClick(Sender: TObject);
begin
FLayers.RotateCCW;
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.BCColor1Click(Sender: TObject);
var
orig: TBGRALayerGradientOriginal;
begin
orig := FLayers.Original[0] as TBGRALayerGradientOriginal;
ColorDialog1.Color:= orig.StartColor;
if ColorDialog1.Execute then orig.StartColor := ColorToBGRA(ColorDialog1.Color);
end;
procedure TForm1.BCColor2Click(Sender: TObject);
var
orig: TBGRALayerGradientOriginal;
begin
orig := FLayers.Original[0] as TBGRALayerGradientOriginal;
ColorDialog1.Color:= orig.EndColor;
if ColorDialog1.Execute then orig.EndColor := ColorToBGRA(ColorDialog1.Color);
end;
procedure TForm1.BGRAVirtualScreen1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
newCursor: TOriginalEditorCursor;
begin
FLayers.MouseDown(Button=mbRight,Shift,X,Y,newCursor);
SetVSCursor(newCursor);
end;
procedure TForm1.BGRAVirtualScreen1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
newCursor: TOriginalEditorCursor;
begin
FLayers.MouseMove(Shift,X,Y,newCursor);
SetVSCursor(newCursor);
end;
procedure TForm1.BGRAVirtualScreen1MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
newCursor: TOriginalEditorCursor;
begin
FLayers.MouseUp(Button=mbRight,Shift,X,Y,newCursor);
SetVSCursor(newCursor);
end;
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
FLayers.Draw(Bitmap, 0,0);
FLayers.DrawEditor(Bitmap, 0, 0,0, 8);
end;
procedure TForm1.cbGradientTypeChange(Sender: TObject);
var
orig: TBGRALayerGradientOriginal;
begin
orig := FLayers.Original[0] as TBGRALayerGradientOriginal;
orig.GradientType := TGradientType(cbGradientType.ItemIndex);
end;
procedure TForm1.cbInterpChange(Sender: TObject);
var
orig: TBGRALayerGradientOriginal;
begin
orig := FLayers.Original[0] as TBGRALayerGradientOriginal;
orig.ColorInterpolation := TBGRAColorInterpolation(cbInterp.ItemIndex);
end;
procedure TForm1.cbRepeatChange(Sender: TObject);
var
orig: TBGRALayerGradientOriginal;
begin
orig := FLayers.Original[0] as TBGRALayerGradientOriginal;
orig.Repetition := TBGRAGradientRepetition(cbRepeat.ItemIndex);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
grad: TBGRALayerGradientOriginal;
svg: TBGRALayerSVGOriginal;
img: TBGRALayerImageOriginal;
gradStream: TMemoryStream;
idxBike, idxImg: Integer;
begin
FLayers := TBGRALayeredBitmap.Create(640,480);
flayers.OnOriginalChange := @OriginalChange;
cbGradientType.ItemIndex:= 0;
cbInterp.ItemIndex := 0;
cbRepeat.ItemIndex := 0;
gradStream := TMemoryStream.Create;
grad := TBGRALayerGradientOriginal.Create;
grad.SetColors([CSSWhite, CSSSkyBlue, CSSOrange, CSSRed],
[0, 0.2, 0.8, 1]);
grad.GradientType:= gtLinear;
grad.Origin := PointF(FLayers.Width/2,40);
grad.XAxis := grad.origin+PointF(0,400);
grad.SaveToStream(gradStream); //save original definition
grad.Free;
grad := TBGRALayerGradientOriginal.Create;
gradStream.Position:= 0;
grad.LoadFromStream(gradStream); // load original definition
FLayers.AddLayerFromOwnedOriginal(grad);
gradStream.free;
svg := TBGRALayerSVGOriginal.Create;
svg.LoadFromFile(Application.Location + 'bicycling.svg');
idxBike := FLayers.AddLayerFromOwnedOriginal(svg);
FLayers.LayerOpacity[idxBike] := 192;
FLayers.LayerOriginalMatrix[idxBike] := AffineMatrixTranslation((FLayers.Width-svg.Width*0.5)/2,(FLayers.Height-svg.Height*0.5)/2)*
AffineMatrixScale(0.5,0.5)*
AffineMatrixTranslation(svg.Width/2,svg.Height/2)*
AffineMatrixRotationDeg(30)*
AffineMatrixTranslation(-svg.Width/2,-svg.Height/2);
FLayers.RenderLayerFromOriginal(idxBike);
img := TBGRALayerImageOriginal.Create;
img.LoadFromFile(Application.Location + 'lazarus.jpg');
idxImg := FLayers.AddLayerFromOwnedOriginal(img);
FLayers.LayerOriginalMatrix[idxImg] := AffineMatrixTranslation(0, FLayers.Height - img.Height);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FLayers.Free;
end;
procedure TForm1.OriginalChange(Sender: TObject;
AOriginal: TBGRALayerCustomOriginal;
var ADiff: TBGRAOriginalDiff);
begin
BGRAVirtualScreen1.DiscardBitmap;
end;
procedure TForm1.SetVSCursor(ACursor: TOriginalEditorCursor);
begin
case ACursor of
oecDefault: BGRAVirtualScreen1.Cursor := crDefault;
oecMove: BGRAVirtualScreen1.Cursor := crSize;
oecMoveE: BGRAVirtualScreen1.Cursor := crSizeE;
oecMoveW: BGRAVirtualScreen1.Cursor := crSizeW;
oecMoveN: BGRAVirtualScreen1.Cursor := crSizeN;
oecMoveS: BGRAVirtualScreen1.Cursor := crSizeS;
oecMoveNE: BGRAVirtualScreen1.Cursor := crSizeNE;
oecMoveNW: BGRAVirtualScreen1.Cursor := crSizeNW;
oecMoveSW: BGRAVirtualScreen1.Cursor := crSizeSW;
oecMoveSE: BGRAVirtualScreen1.Cursor := crSizeSE;
end;
end;
end.