Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

ImageDataT

Generic image container supporting both CHW (channel-height-width) and HWC (height-width-channel) layouts 支持CHW(通道-高度-宽度)和HWC(高度-宽度-通道)布局的通用图像容器

Definition

命名空间: DeploySharp.Data
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public class ImageData<T>
where T : struct, new(), Object
Inheritance
Object    ImageDataT
Derived

类型参数

T
Pixel component type (must be unmanaged) 像素组件类型(必须是非托管类型)

备注

This class provides: - Memory-efficient storage with Span support - Type-safe pixel/channel access - Conversion-free interoperability with native code - Support for common image formats (float, byte, etc.) 本类提供: - 支持Span的高效内存存储 - 类型安全的像素/通道访问 - 与本地代码的无转换互操作 - 支持常见图像格式(float、byte等)

构造函数

ImageDataT(Int32, Int32, Int32, ImageDataTDataFormat) Initializes a new blank image with the specified dimensions and format 使用指定尺寸和格式初始化新的空白图像
ImageDataT(T, Int32, Int32, Int32, ImageDataTDataFormat) Initializes a new image from existing data 从现有数据初始化新图像

属性

Channels Number of color channels 颜色通道数
Format Data layout format 数据布局格式
Height Image height in pixels 图像高度(像素)
Item Gets or sets a single channel pixel value (CHW format only) 获取或设置单个通道像素值(仅CHW格式)
Length Total number of elements in the buffer 缓冲区中的元素总数
Width Image width in pixels 图像宽度(像素)

方法

Clear Clears the image buffer (sets all elements to default(T)) 清除图像缓冲区(将所有元素设置为default(T))
Clone Creates a deep copy of the image 创建图像的深拷贝
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
Fill Fills the image buffer with specified value 使用指定值填充图像缓冲区
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetChannelPixelHWC Gets a channel pixel value (HWC format private access) 获取通道像素值(HWC格式内部访问)
GetChannelSpan Gets a span covering all pixels in specified channel (CHW format only) 获取覆盖指定通道所有像素的Span(仅CHW格式)
GetCHWIndex 
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetHWCIndex 
GetPixel Gets all components of a pixel (HWC format only) 获取像素的所有分量(仅HWC格式)
GetRawData 
GetRawSpan Gets direct access to the underlying buffer span 直接访问底层缓冲区Span
GetTypeGets the Type of the current instance.
(继承自 Object。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
SetPixel Sets all components of a pixel (HWC format only) 设置像素的所有分量(仅HWC格式)
ToStringReturns a string that represents the current object.
(继承自 Object。)

字段

参见