Skip to content

Commit

Permalink
Use SourceGenerator for native code of MagickImageCollection.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Jun 27, 2024
1 parent c38bf91 commit 93e590f
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 1,367 deletions.
8 changes: 4 additions & 4 deletions src/Magick.NET/MagickImageCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public void Morph(int frames)
ThrowIfCountLowerThan(2);

using var imageAttacher = new TemporaryImageAttacher(_images);
var images = _nativeInstance.Morph(_images[0], frames);
var images = _nativeInstance.Morph(_images[0], (nuint)frames);
ReplaceImages(images);
}

Expand Down Expand Up @@ -837,7 +837,7 @@ public IMagickImage<QuantumType> Polynomial(double[] terms)
Throw.IfNullOrEmpty(nameof(terms), terms);

using var imageAttacher = new TemporaryImageAttacher(_images);
var image = _nativeInstance.Polynomial(_images[0], terms, terms.Length);
var image = _nativeInstance.Polynomial(_images[0], terms, (nuint)terms.Length);
return MagickImage.Create(image, GetSettings());
}

Expand Down Expand Up @@ -1791,7 +1791,7 @@ private void AddImages(byte[] data, int offset, int count, IMagickReadSettings<Q
settings.Ping = ping;
settings.FileName = fileName;

var result = _nativeInstance.ReadBlob(settings, data, offset, count);
var result = _nativeInstance.ReadBlob(settings, data, (nuint)offset, (nuint)count);
AddImages(result, settings);
}

Expand Down Expand Up @@ -1901,7 +1901,7 @@ private void SetDefines(IWriteDefines defines)
private IMagickImage<QuantumType> Smush(int offset, bool stack)
{
using var imageAttacher = new TemporaryImageAttacher(_images);
var image = _nativeInstance.Smush(_images[0], offset, stack);
var image = _nativeInstance.Smush(_images[0], (nuint)offset, stack);
return MagickImage.Create(image, GetSettings());
}

Expand Down
988 changes: 98 additions & 890 deletions src/Magick.NET/Native/MagickImageCollection.cs

Large diffs are not rendered by default.

Loading

0 comments on commit 93e590f

Please sign in to comment.