 |
GpuImage Class |
GpuImage represents an image that is stored in the graphics card's memory.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.CoreAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntaxpublic class GpuImage : GpuDeviceComponent, IDisposable
The GpuImage type exposes the following members.
Constructors | Name | Description |
---|
 | GpuImage(VulkanDevice, RawImageData, Boolean, String) |
Constructor
|
 | GpuImage(VulkanDevice, RawImageData, Boolean, Boolean, ImageUsageFlags, AccessFlags, ImageLayout, PipelineStageFlags, String) |
Constructor
|
 | GpuImage(VulkanDevice, Int32, Int32, Format, ImageUsageFlags, MemoryPropertyFlags, Int32, SampleCountFlags, ImageTiling, ImageLayout, ImageAspectFlags, Boolean, Int32, Boolean, String) |
Constructor that created a gpu image and allocates its memory based on the image parameters.
|
Top
Properties | Name | Description |
---|
 | HasTransparentPixels |
Gets or sets (only at init time) a Boolean that indicates that the GpuImage has some transparent pixels, e. g. pixels with alpha color smaller than 1.
This means that to show this GpuImage correctly some alpha-blending technique is required.
|
 | Height |
Height of the image in pixels
|
 | Image |
Gets the Vulkan Image.
|
 | ImageMemory |
Gets the VulkanMemoryInfo that represents the memory location of the buffer
|
 | ImageView |
Gets the Vulkan ImageView.
|
 | IsGpuDeviceCached |
Gets a Boolean that indicates that this GpuImage is cashed by the GpuDevice objects and cannot be disposed by calling Dispose method.
This means the GpuImage can be shared without worrying that someone will dispose this GpuImage or that it will be disposed when the Scene is disposed.
This flag is set when the GpuImage is cached by calling CacheObject(String, Object) method.
By default the Source is used as the cache key.
The GpuImage will be disposed when the GpuDevice will be disposed or if it is removed from the cache and then disposed.
|
 | IsPreMultipliedAlpha |
Gets or sets (only at init time) a Boolean that indicates that the colors in this GpuImage are alpha-premultiplied.
This means that the red, green and blue values are multiplied by the alpha value.
|
 | IsSceneCached |
Gets a Boolean that indicates that this GpuImage is cashed by Scene objects and cannot be disposed by calling Dispose method.
This means the GpuImage can be shared without worrying that someone will dispose this GpuImage.
This flag is set when the GpuImage is cached by calling Scene.CacheObject(String, Object) method.
By default the Source is used as the cache key.
The GpuImage will be disposed when the Scene will be disposed or if it is removed from the cache and then disposed.
|
 | MemoryProperties |
Gets the MemoryPropertyFlags that were used to crate this GpuImage.
|
 | MemorySize |
User memory size in bytes
|
 | Source |
Source can contain file name or other string that defines the source of this GpuImage.
|
 | Width |
Width of the image in pixels
|
Top
Methods | Name | Description |
---|
 | CopyDataFromImage |
Returns a new RawImageData with data from this image (stored in GPU memory).
When the image data cannot be retrieved, then null is returned.
|
 | CopyDataFromImage(Byte, Int64, Int32, Boolean) |
Copies data from image (stored in GPU memory) to the specified byte array.
Returns true when data was copied, otherwise false is returned (when image cannot be copied from GPU memory).
|
 | CopyDataToImage(Byte) |
Copies the data from the specified byte array to this image.
|
 | CopyDataToImage(Byte, Boolean) |
Copies the data from the specified byte array to this image.
|
 | CopyDataToImage(Byte, ImageLayout, AccessFlags, PipelineStageFlags) |
Copies the data from the specified byte array to this image and set the layout of the image to the specified values.
|
 | CopyDataToImageMipMaps |
Copies the data from the array of byte array to the mip maps of this image.
|
 | Dispose | |
 | Dispose(Boolean) |
Dispose
(Overrides ComponentBaseDispose(Boolean)) |
 | GetCurrentImageLayoutAndFlags |
Gets the current image layout
|
  | GetImageAspectFlags |
Returns the ImageAspectFlags for the specified format.
|
 | GetImageLayout |
Returns information about the layout of the image for the specified mip level.
|
 | GetImageRowStride |
Returns a row stride (number of bytes in one row of image data) of the image for the specified mip level.
|
 | GetMappedMemoryPtr |
Returns an IntPtr of the mapped memory.
The IntPtr can be used to get the content of this image or to copy new content to that location.
After using the memory call UnmapMemory method.
|
 | GetMappedMemoryPtr(Int64, Int64) |
Returns an IntPtr of the mapped memory with specified offset and size.
The IntPtr can be used to get the content of this image or to copy new content to that location.
After using the memory call UnmapMemory method.
|
 | GetMappedMemorySpan |
Returns a Span that can be used to get the content of this image or copy new content to that location.
After using the memory call UnmapMemory method.
|
 | GetMappedMemorySpan(Void, Byte) | |
 | Resize |
Resizes this image
|
 | ToString | (Overrides ObjectToString) |
 | UnmapMemory |
Unmaps the memory that was mapped by calling GetMappedMemoryPtr.
|
Top
Fields | Name | Description |
---|
  | AlwaysAllowCopyFromGpuImage |
Gets or sets a static Boolean that specifies if GpuImages are always created with usage mode that allows copying data from the image (using CopyDataFromImage method).
Note that when this value is set to false, it will be still possible to copy from most of the GpuImages
(from all of those that have generated mip-maps; only images without mip-maps or with predefined mip-maps data will not allow copying of the data).
Default value is true.
|
 | ImageCreateInfo |
Gets the ImageCreateInfo that was used to create this GpuImage
|
Top
See Also