namespace XP.Camera;
/// 相机设备信息。
public record CameraInfo(
string ModelName,
string SerialNumber,
string VendorName,
string DeviceType
);
/// 图像采集成功事件参数。
public class ImageGrabbedEventArgs : EventArgs
{
public byte[] PixelData { get; }
public int Width { get; }
public int Height { get; }
public string PixelFormat { get; }
public ImageGrabbedEventArgs(byte[] pixelData, int width, int height, string pixelFormat)
{
PixelData = pixelData;
Width = width;
Height = height;
PixelFormat = pixelFormat;
}
}
/// 图像采集失败事件参数。
public class GrabErrorEventArgs : EventArgs
{
public int ErrorCode { get; }
public string ErrorDescription { get; }
public GrabErrorEventArgs(int errorCode, string errorDescription)
{
ErrorCode = errorCode;
ErrorDescription = errorDescription;
}
}