Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed default paramter in public API
  • Loading branch information
Brent-A committed Oct 8, 2019
commit 17977589f862bd40e0c89ef1d1ec5524f645d2ef
24 changes: 23 additions & 1 deletion src/csharp/SDK/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Image : IMemoryOwner<byte>, IDisposable
/// <param name="widthPixels">Width of the image in pixels.</param>
/// <param name="heightPixels">Height of the image in pixels.</param>
/// <param name="strideBytes">Stride of the image in bytes. Must be as large as the width times the size of a pixel. Set to zero for the default if available for that format.</param>
public Image(ImageFormat format, int widthPixels, int heightPixels, int strideBytes = 0)
public Image(ImageFormat format, int widthPixels, int heightPixels, int strideBytes)
{
// Hook the native allocator and register this object.
// .Dispose() will be called on this object when the allocator is shut down.
Expand All @@ -61,6 +61,28 @@ public Image(ImageFormat format, int widthPixels, int heightPixels, int strideBy
out this.handle));
}

/// <summary>
/// Initializes a new instance of the <see cref="Image"/> class.
/// </summary>
/// <param name="format">The pixel format of the image. Must be a format with a constant pixel size.</param>
/// <param name="widthPixels">Width of the image in pixels.</param>
/// <param name="heightPixels">Height of the image in pixels.</param>
public Image(ImageFormat format, int widthPixels, int heightPixels)
{
// Hook the native allocator and register this object.
// .Dispose() will be called on this object when the allocator is shut down.
Allocator.Singleton.RegisterForDisposal(this);

#pragma warning disable CA2000 // Dispose objects before losing scope
AzureKinectException.ThrowIfNotSuccess(() => NativeMethods.k4a_image_create(
format,
widthPixels,
heightPixels,
0,
image_handle: out this.handle));
#pragma warning restore CA2000 // Dispose objects before losing scope
}

/// <summary>
/// Initializes a new instance of the <see cref="Image"/> class.
/// </summary>
Expand Down