Skip to content

Commit

Permalink
Regenerate methods/enums for libvips 8.14
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Mar 24, 2023
1 parent 54a7f33 commit bbc2c7d
Show file tree
Hide file tree
Showing 10 changed files with 406 additions and 214 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Ensure code is AOT-friendly ([#196](https://github.com/kleisauke/net-vips/issues/196)).

### Changed
- Update methods/enums for libvips 8.14.
- The [NetVips.Extensions](https://www.nuget.org/packages/NetVips.Extensions/) package is now only supported on Windows when targeting .NET 7.0. See https://aka.ms/systemdrawingnonwindows for more information.

## [2.2.0] - 2022-07-25
Expand Down
12 changes: 10 additions & 2 deletions samples/NetVips.Samples/Samples/GenerateImageClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ public GenerateImageClass()
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsDirection"), "Enums.Direction");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsExtend"), "Enums.Extend");
_gTypeToCSharpDict.Add(FailOnType, "Enums.FailOn");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignDzContainer"), "Enums.ForeignDzContainer");
if (NetVips.TypeFind("VipsOperation", "dzsave") != IntPtr.Zero)
{
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignDzContainer"), "Enums.ForeignDzContainer");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignDzLayout"), "Enums.ForeignDzLayout");
}
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignDzDepth"), "Enums.ForeignDzDepth");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignDzLayout"), "Enums.ForeignDzLayout");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignHeifCompression"), "Enums.ForeignHeifCompression");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignPpmFormat"), "Enums.ForeignPpmFormat");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignSubsample"), "Enums.ForeignSubsample");
Expand All @@ -85,6 +88,11 @@ public GenerateImageClass()
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsPrecision"), "Enums.Precision");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsRegionShrink"), "Enums.RegionShrink");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsSize"), "Enums.Size");
if (NetVips.AtLeastLibvips(8, 14))
{
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsTextWrap"), "Enums.TextWrap");
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignHeifEncoder"), "Enums.ForeignHeifEncoder");
}

// Flags
_gTypeToCSharpDict.Add(NetVips.TypeFromName("VipsForeignFlags"), "Enums.ForeignFlags");
Expand Down
50 changes: 48 additions & 2 deletions src/NetVips/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,31 @@ public enum ForeignPngFilter
All = None | Sub | Up | Avg | Paeth // "all"
}

/// <summary>
/// The selected encoder to use.
/// </summary>
/// <remarks>
/// If libheif hasn't been compiled with the selected encoder, it will
/// fallback to the default encoder based on <see cref="ForeignHeifCompression"/>.
/// </remarks>
public enum ForeignHeifEncoder
{
/// <summary>Pick encoder automatically.</summary>
Auto = 0, // "auto"

/// <summary>AOM</summary>
Aom = 1, // "aom"

/// <summary>RAV1E</summary>
Rav1e = 2, // "rav1e"

/// <summary>SVT-AV1</summary>
Svt = 3, // "svt"

/// <summary>x265</summary>
X265 = 4 // "x265"
}

/// <summary>
/// The netpbm file format to save as.
/// </summary>
Expand All @@ -523,7 +548,10 @@ public enum ForeignPpmFormat
Ppm = 2, // "ppm"

/// <summary>Images are 32-bit float pixels.</summary>
Pfm = 3 // "pfm"
Pfm = 3, // "pfm"

/// <summary>Images are anymap images -- the image format is used to pick the saver.</summary>
Pnm = 4 // "pnm"
}

/// <summary>
Expand Down Expand Up @@ -649,7 +677,7 @@ public enum Intent

/// <summary>
/// Pick the algorithm vips uses to decide image "interestingness".
/// This is used by <see cref="Image.Smartcrop"/>, for example, to decide what parts of the image to keep.
/// This is used by <see cref="O:Image.Smartcrop"/>, for example, to decide what parts of the image to keep.
/// </summary>
public enum Interesting
{
Expand Down Expand Up @@ -1049,6 +1077,24 @@ public enum Size
Force = 3 // "force"
}

/// <summary>
/// Sets the word wrapping style for <see cref="O:Image.Text"/> when used with a maximum width.
/// </summary>
public enum TextWrap
{
/// <summary>Wrap at word boundaries.</summary>
Word = 0, // "word"

/// <summary>Wrap at character boundaries.</summary>
Char = 1, // "char"

/// <summary>Wrap at word boundaries, but fall back to character boundaries if there is not enough space for a full word.</summary>
WordChar = 2, // "word-char"

/// <summary>No wrapping.</summary>
None = 3 // "none"
}

#endregion

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NetVips/GValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GValue : IDisposable
internal Internal.GValue.Struct Struct;

/// <summary>
/// Track whether <see cref="Dispose(bool)"/> has been called.
/// Track whether <see cref="O:Dispose"/> has been called.
/// </summary>
private bool _disposed;

Expand Down
Loading

0 comments on commit bbc2c7d

Please sign in to comment.