PixelData buffer's allocate / release function is only need for C++ side memory.
And C# cannot control that allocation method.
So ReleaseFunction enum is unneccesary arguments at NUI.
But now, Tize.TV.FLUX use this ReleaseFunction.
So we leave it and will be deprecated later.
Signed-off-by: Eunki Hong <h.pichulia@gmail.com>
pixelBuffer[6] = (byte)(0xFF * color2.Z);
pixelBuffer[7] = (byte)(0xFF * color2.W);
- PixelData pixelData = new PixelData(pixelBuffer, size, width, height, PixelFormat.RGBA8888, PixelData.ReleaseFunction.DeleteArray );
+ PixelData pixelData = new PixelData(pixelBuffer, size, width, height, PixelFormat.RGBA8888);
Texture texture = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, width, height);
texture.Upload(pixelData);
public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PixelData_New")]
- public static extern global::System.IntPtr New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5, int jarg6);
+ public static extern global::System.IntPtr New([global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] jarg1, uint jarg2, uint jarg3, uint jarg4, int jarg5);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_PixelData__SWIG_0")]
public static extern global::System.IntPtr NewPixelData();
/// <param name="pixelFormat">The pixel format.</param>
/// <param name="releaseFunction">The function used to release the memory.</param>
/// <since_tizen> 5 </since_tizen>
+ /// This will be deprecated after API level 9. ReleaseFunction is not useful in C#.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction releaseFunction) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ }
+
+ /// <summary>
+ /// Creates a PixelData object.
+ /// </summary>
+ /// <param name="buffer">The raw pixel data.</param>
+ /// <param name="bufferSize">The size of the buffer in bytes.</param>
+ /// <param name="width">Buffer width in pixels.</param>
+ /// <param name="height">Buffer height in pixels.</param>
+ /// <param name="pixelFormat">The pixel format.</param>
+ /// <since_tizen> 5 </since_tizen>
/// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction releaseFunction) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat, (int)releaseFunction), true)
+ public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// Enumeration for function to release the pixel buffer.
/// </summary>
/// <since_tizen> 5 </since_tizen>
- /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ /// This will be deprecated after API level 9. ReleaseFunction is not useful in C#.
[EditorBrowsable(EditorBrowsableState.Never)]
public enum ReleaseFunction
{
byte[] buffer = new byte[1024];
- var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8, PixelData.ReleaseFunction.Free);
+ var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free))
+ using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8))
{
var testingTarget = new PixelData(PixelData.getCPtr(pixelData).Handle, true);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888, PixelData.ReleaseFunction.Free);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");