Class PixelData
Definition
- Assembly:
- Tizen.NUI.dll
The PixelData object holds a pixel buffer.
The PixelData takes over the ownership of the pixel buffer.
The buffer memory must not be released outside of this class, instead,
the PixelData object will release it automatically when the reference count falls to zero.
public class PixelData : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourcePixelData(byte[], uint, uint, uint, PixelFormat, ReleaseFunction)
Creates a PixelData object.
Declaration
public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction _)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | buffer | The raw pixel data. |
| uint | bufferSize | The size of the buffer in bytes. |
| uint | width | Buffer width in pixels. |
| uint | height | Buffer height in pixels. |
| PixelFormat | pixelFormat | The pixel format. |
| PixelData.ReleaseFunction | _ | Not used parameter. |
PixelData(byte[], uint, uint, uint, PixelFormat)
Creates a PixelData object.
Declaration
public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | buffer | The raw pixel data. |
| uint | bufferSize | The size of the buffer in bytes. |
| uint | width | Buffer width in pixels. |
| uint | height | Buffer height in pixels. |
| PixelFormat | pixelFormat | The pixel format. |
Methods
View SourceGenerateUrl()
Generate Url from pixel data.
Declaration
public ImageUrl GenerateUrl()
Returns
| Type | Description |
|---|---|
| ImageUrl |
Remarks
This API should not be called at worker thread.
GenerateUrl(bool)
Generate Url from pixel data with pre-multiplied by alpha information.
Declaration
public ImageUrl GenerateUrl(bool preMultiplied)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | preMultiplied | The raw pixel data pre-multiplied by alpha. |
Returns
| Type | Description |
|---|---|
| ImageUrl |
Remarks
This API should not be called at worker thread.
GetHeight()
Gets the height of the buffer in pixels.
Declaration
public uint GetHeight()
Returns
| Type | Description |
|---|---|
| uint | The height of the buffer in pixels. |
GetPixelFormat()
Gets the pixel format.
Declaration
public PixelFormat GetPixelFormat()
Returns
| Type | Description |
|---|---|
| PixelFormat | The pixel format. |
GetStrideBytes()
Gets the stride of the buffer in bytes. 0 means the buffer is tightly packed
Declaration
public uint GetStrideBytes()
Returns
| Type | Description |
|---|---|
| uint | The stride of the buffer in bytes. |
GetWidth()
Gets the width of the buffer in pixels.
Declaration
public uint GetWidth()
Returns
| Type | Description |
|---|---|
| uint | The width of the buffer in pixels. |
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.InteropServices.HandleRef | swigCPtr |