![]() |
Paradox Game Engine
v1.0.0 beta06
|
An unmanaged buffer of pixels. More...
Public Member Functions | |
PixelBuffer (int width, int height, PixelFormat format, int rowStride, int bufferStride, IntPtr dataPointer) | |
Initializes a new instance of the PixelBuffer struct. More... | |
unsafe void | CopyTo (PixelBuffer pixelBuffer) |
Copies this pixel buffer to a destination pixel buffer. More... | |
void | Save (Stream imageStream, ImageFileType fileType) |
Saves this pixel buffer to a stream. More... | |
unsafe T | GetPixel< T > (int x, int y) |
Gets the pixel value at a specified position. More... | |
unsafe void | SetPixel< T > (int x, int y, T value) |
Gets the pixel value at a specified position. More... | |
T[] | GetPixels< T > (int yOffset=0) |
Gets scanline pixels from the buffer. More... | |
void | GetPixels< T > (T[] pixels, int yOffset=0) |
Gets scanline pixels from the buffer. More... | |
unsafe void | GetPixels< T > (T[] pixels, int yOffset, int pixelIndex, int pixelCount) |
Gets scanline pixels from the buffer. More... | |
void | SetPixels< T > (T[] sourcePixels, int yOffset=0) |
Sets scanline pixels to the buffer. More... | |
unsafe void | SetPixels< T > (T[] sourcePixels, int yOffset, int pixelIndex, int pixelCount) |
Sets scanline pixels to the buffer. More... | |
Properties | |
int | Width [get] |
Gets the width. More... | |
int | Height [get] |
Gets the height. More... | |
PixelFormat | Format [get] |
Gets the format. More... | |
int | PixelSize [get] |
Gets the pixel size in bytes. More... | |
int | RowStride [get] |
Gets the row stride in number of bytes. More... | |
int | BufferStride [get] |
Gets the total size in bytes of this pixel buffer. More... | |
IntPtr | DataPointer [get] |
Gets the pointer to the pixel buffer. More... | |
An unmanaged buffer of pixels.
Definition at line 32 of file PixelBuffer.cs.
SiliconStudio.Paradox.Graphics.PixelBuffer.PixelBuffer | ( | int | width, |
int | height, | ||
PixelFormat | format, | ||
int | rowStride, | ||
int | bufferStride, | ||
IntPtr | dataPointer | ||
) |
Initializes a new instance of the PixelBuffer struct.
width | The width. |
height | The height. |
format | The format. |
rowStride | The row pitch. |
bufferStride | The slice pitch. |
dataPointer | The pixels. |
Definition at line 62 of file PixelBuffer.cs.
References DirectX.format, and DirectX.pixelSize.
unsafe void SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo | ( | PixelBuffer | pixelBuffer | ) |
Copies this pixel buffer to a destination pixel buffer.
pixelBuffer | The destination pixel buffer. |
The destination pixel buffer must have exactly the same dimensions (width, height) and format than this instance. Destination buffer can have different row stride.
Definition at line 127 of file PixelBuffer.cs.
References SiliconStudio.Paradox.Graphics.PixelBuffer.BufferStride, SiliconStudio.Paradox.Graphics.PixelBuffer.DataPointer, SiliconStudio.Paradox.Graphics.PixelBuffer.Format, SiliconStudio.Paradox.Graphics.PixelBuffer.Height, SiliconStudio.Paradox.Graphics.PixelBuffer.RowStride, and SiliconStudio.Paradox.Graphics.PixelBuffer.Width.
unsafe T SiliconStudio.Paradox.Graphics.PixelBuffer.GetPixel< T > | ( | int | x, |
int | y | ||
) |
Gets the pixel value at a specified position.
T | Type of the pixel data |
x | The x-coordinate. |
y | The y-coordinate. |
Caution, this method doesn't check bounding.
T | : | struct |
Definition at line 189 of file PixelBuffer.cs.
References DirectX.y.
T [] SiliconStudio.Paradox.Graphics.PixelBuffer.GetPixels< T > | ( | int | yOffset = 0 | ) |
Gets scanline pixels from the buffer.
T | Type of the pixel data |
yOffset | The y line offset. |
System.ArgumentException | If the sizeof(T) is an invalid size |
This method is working on a row basis. The yOffset is specifying the first row to get the pixels from.
T | : | struct |
Definition at line 220 of file PixelBuffer.cs.
References DirectX.pixelSize.
void SiliconStudio.Paradox.Graphics.PixelBuffer.GetPixels< T > | ( | T[] | pixels, |
int | yOffset = 0 |
||
) |
Gets scanline pixels from the buffer.
T | Type of the pixel data |
pixels | An allocated scanline pixel buffer |
yOffset | The y line offset. |
System.ArgumentException | If the sizeof(T) is an invalid size |
This method is working on a row basis. The yOffset is specifying the first row to get the pixels from.
T | : | struct |
Definition at line 244 of file PixelBuffer.cs.
unsafe void SiliconStudio.Paradox.Graphics.PixelBuffer.GetPixels< T > | ( | T[] | pixels, |
int | yOffset, | ||
int | pixelIndex, | ||
int | pixelCount | ||
) |
Gets scanline pixels from the buffer.
T | Type of the pixel data |
pixels | An allocated scanline pixel buffer |
yOffset | The y line offset. |
pixelIndex | Offset into the destination pixels buffer. |
pixelCount | Number of pixels to write into the destination pixels buffer. |
System.ArgumentException | If the sizeof(T) is an invalid size |
This method is working on a row basis. The yOffset is specifying the first row to get the pixels from.
T | : | struct |
Definition at line 262 of file PixelBuffer.cs.
void SiliconStudio.Paradox.Graphics.PixelBuffer.Save | ( | Stream | imageStream, |
ImageFileType | fileType | ||
) |
Saves this pixel buffer to a stream.
imageStream | The destination stream. |
fileType | Specify the output format. |
This method support the following format: dds, bmp, jpg, png, gif, tiff, wmp, tga
.
Definition at line 164 of file PixelBuffer.cs.
References DirectX.format.
unsafe void SiliconStudio.Paradox.Graphics.PixelBuffer.SetPixel< T > | ( | int | x, |
int | y, | ||
T | value | ||
) |
Gets the pixel value at a specified position.
T | Type of the pixel data |
x | The x-coordinate. |
y | The y-coordinate. |
value | The pixel value. |
Caution, this method doesn't check bounding.
T | : | struct |
Definition at line 204 of file PixelBuffer.cs.
References DirectX.y.
void SiliconStudio.Paradox.Graphics.PixelBuffer.SetPixels< T > | ( | T[] | sourcePixels, |
int | yOffset = 0 |
||
) |
Sets scanline pixels to the buffer.
T | Type of the pixel data |
sourcePixels | Source pixel buffer |
yOffset | The y line offset. |
System.ArgumentException | If the sizeof(T) is an invalid size |
This method is working on a row basis. The yOffset is specifying the first row to get the pixels from.
T | : | struct |
Definition at line 298 of file PixelBuffer.cs.
unsafe void SiliconStudio.Paradox.Graphics.PixelBuffer.SetPixels< T > | ( | T[] | sourcePixels, |
int | yOffset, | ||
int | pixelIndex, | ||
int | pixelCount | ||
) |
Sets scanline pixels to the buffer.
T | Type of the pixel data |
sourcePixels | Source pixel buffer |
yOffset | The y line offset. |
pixelIndex | Offset into the source sourcePixels buffer. |
pixelCount | Number of pixels to write into the source sourcePixels buffer. |
System.ArgumentException | If the sizeof(T) is an invalid size |
This method is working on a row basis. The yOffset is specifying the first row to get the pixels from.
T | : | struct |
Definition at line 316 of file PixelBuffer.cs.
|
get |
Gets the total size in bytes of this pixel buffer.
The size in bytes of the pixel buffer.
Definition at line 111 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().
|
get |
Gets the pointer to the pixel buffer.
The pointer to the pixel buffer.
Definition at line 117 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().
|
get |
Gets the format.
The format.
Definition at line 93 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().
|
get |
Gets the height.
The height.
Definition at line 87 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().
|
get |
Gets the pixel size in bytes.
The pixel size in bytes.
Definition at line 99 of file PixelBuffer.cs.
|
get |
Gets the row stride in number of bytes.
The row stride in number of bytes.
Definition at line 105 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().
|
get |
Gets the width.
The width.
Definition at line 81 of file PixelBuffer.cs.
Referenced by SiliconStudio.Paradox.Graphics.PixelBuffer.CopyTo().