1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace YOLODetectProcessLib
- {
- /// <summary>
- /// 图像
- /// </summary>
- public interface IImage : IDisposable
- {
- /// <summary>
- /// 图像数据
- /// </summary>
- byte[] DataBuffer { get; }
- /// <summary>
- /// 宽度
- /// </summary>
- int Width { get; set; }
- /// <summary>
- /// 高度
- /// </summary>
- int Height { get; set; }
- /// <summary>
- /// 通道数
- /// </summary>
- int Channel { get; set; }
- /// <summary>
- /// 步长
- /// </summary>
- int Stride { get; set; }
- /// <summary>
- /// 图像区的长度
- /// </summary>
- int DataBufferSize { get; set; }
- /// <summary>
- /// 从文件中加载
- /// </summary>
- /// <param name="filePath"></param>
- /// <returns></returns>
- void ReadFromFile(string filePath);
- /// <summary>
- /// 写入到文件
- /// </summary>
- /// <param name="filePath"></param>
- /// <returns></returns>
- void SaveIntoFile(string filePath);
- /// <summary>
- /// 复制
- /// </summary>
- /// <returns></returns>
- IImage Clone();
- /// <summary>
- /// 从外部数组复制到图像数据区
- /// </summary>
- /// <param name="data"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- /// <param name="channel"></param>
- void CopyFrom(byte[] data, int width, int height, int channel);
- /// <summary>
- /// 设置DataBuffer的尺寸
- /// </summary>
- void SetDataBufferSize(int newSize);
- }
- }
|