VectSharp 2.6.1
A light library for C# vector graphics
|
Represents a raster image, created from raw pixel data. Consider using the derived classes included in the NuGet package "VectSharp.MuPDFUtils" if you need to load a raster image from a file or a Stream. More...
Public Member Functions | |
RasterImage (IntPtr pixelData, int width, int height, bool hasAlpha, bool interpolate) | |
Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format. More... | |
RasterImage (ref DisposableIntPtr pixelData, int width, int height, bool hasAlpha, bool interpolate) | |
Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format. More... | |
RasterImage (byte[] data, int width, int height, PixelFormats pixelFormat, bool interpolate) | |
Creates a new RasterImage instance copying the specified pixel data. More... | |
void | ClearPNGCache () |
Disposes the PNGStream. Also useful if is is necessary to regenerate it, e.g. because the underlying image pixel data has changed. More... | |
void | Dispose () |
Properties | |
IntPtr | ImageDataAddress [get] |
The memory address of the image pixel data. More... | |
IDisposable | DataHolder [get] |
An IDisposable that will be disposed when the image is disposed. More... | |
string | Id [get] |
A univocal identifier for this image. More... | |
bool | HasAlpha [get] |
Determines whether the image has an alpha channel. More... | |
int | Width [get] |
The width in pixels of the image. More... | |
int | Height [get] |
The height in pixels of the image. More... | |
bool | Interpolate [get] |
Determines whether the image should be interpolated when it is resized. More... | |
MemoryStream | PNGStream [get] |
Contains a representation of the image in PNG format. Generated at the first access and cached until the image is disposed. More... | |
Represents a raster image, created from raw pixel data. Consider using the derived classes included in the NuGet package "VectSharp.MuPDFUtils" if you need to load a raster image from a file or a Stream.
Definition at line 100 of file RasterImage.cs.
VectSharp.RasterImage.RasterImage | ( | IntPtr | pixelData, |
int | width, | ||
int | height, | ||
bool | hasAlpha, | ||
bool | interpolate | ||
) |
Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format.
pixelData | The address of the image pixel data in RGB or RGBA format. |
width | The width in pixels of the image. |
height | The height in pixels of the image. |
hasAlpha | true if the image is in RGBA format, false if it is in RGB format. |
interpolate | Whether the image should be interpolated when it is resized. |
Definition at line 172 of file RasterImage.cs.
VectSharp.RasterImage.RasterImage | ( | ref DisposableIntPtr | pixelData, |
int | width, | ||
int | height, | ||
bool | hasAlpha, | ||
bool | interpolate | ||
) |
Creates a new RasterImage instance from the specified pixel data in RGB or RGBA format.
pixelData | The address of the image pixel data in RGB or RGBA format wrapped in a DisposableIntPtr. The RasterImage will take ownership of this memory. |
width | The width in pixels of the image. |
height | The height in pixels of the image. |
hasAlpha | true if the image is in RGBA format, false if it is in RGB format. |
interpolate | Whether the image should be interpolated when it is resized. |
Definition at line 190 of file RasterImage.cs.
VectSharp.RasterImage.RasterImage | ( | byte[] | data, |
int | width, | ||
int | height, | ||
PixelFormats | pixelFormat, | ||
bool | interpolate | ||
) |
Creates a new RasterImage instance copying the specified pixel data.
data | The image pixel data that will be copied. |
width | The width in pixels of the image. |
height | The height in pixels of the image. |
pixelFormat | The format of the pixel data. |
interpolate | Whether the image should be interpolated when it is resized. |
Definition at line 209 of file RasterImage.cs.
void VectSharp.RasterImage.ClearPNGCache | ( | ) |
Disposes the PNGStream. Also useful if is is necessary to regenerate it, e.g. because the underlying image pixel data has changed.
Definition at line 263 of file RasterImage.cs.
void VectSharp.RasterImage.Dispose | ( | ) |
Definition at line 297 of file RasterImage.cs.
|
get |
An IDisposable that will be disposed when the image is disposed.
Definition at line 110 of file RasterImage.cs.
|
get |
Determines whether the image has an alpha channel.
Definition at line 120 of file RasterImage.cs.
|
get |
The height in pixels of the image.
Definition at line 130 of file RasterImage.cs.
|
get |
A univocal identifier for this image.
Definition at line 115 of file RasterImage.cs.
|
get |
The memory address of the image pixel data.
Definition at line 105 of file RasterImage.cs.
|
get |
Determines whether the image should be interpolated when it is resized.
Definition at line 135 of file RasterImage.cs.
|
get |
Contains a representation of the image in PNG format. Generated at the first access and cached until the image is disposed.
Definition at line 142 of file RasterImage.cs.
|
get |
The width in pixels of the image.
Definition at line 125 of file RasterImage.cs.