/// <summary> /// Initializes a new instance of the <see cref="RawImage"/> class. /// </summary> /// <param name="pixelFormat">The pixel format of the image.</param> /// <param name="size">The actual size of the image.</param> /// <param name="data">The raw image memory with readonly access.</param> /// <param name="rowLengthInBytes">The length in bytes of a one row.</param> public RawImage(RawPixelFormatCode pixelFormat, Size size, ReadOnlyMemory <byte> data, int rowLengthInBytes) { PixelFormat = pixelFormat; Size = size; Data = data; RowLengthInBytes = rowLengthInBytes; }
protected RawPixelFormat( RawPixelFormatCode code, int bytesPerPixel, IReadOnlyList <RawPixelChannelFormat> channels) { Code = code; BytesPerPixel = bytesPerPixel; Channels = channels; }
/// <summary> /// Initializes a new instance of the <see cref="RawImage"/> class. /// </summary> /// <param name="pixelFormat">The pixel format of the image.</param> /// <param name="size">The actual size of the image.</param> /// <param name="writableData">The raw image memory that is allowed to be modified, or null.</param> /// <param name="rowLengthInBytes">The length in bytes of a one row.</param> public RawImage(RawPixelFormatCode pixelFormat, Size size, Memory <byte> writableData, int rowLengthInBytes) { // TODO: Add verification. PixelFormat = pixelFormat; Size = size; WritableData = writableData; Data = writableData; RowLengthInBytes = rowLengthInBytes; }
/// <summary> /// Initializes a new instance of the <see cref="RawVideoStreamFormat"/> class. /// </summary> /// <param name="imagePixelFormat">The pixel format of frames.</param> /// <param name="resolution">The raw video resolution.</param> /// <param name="fps">The frames per second for equidistant video stream or null for others.</param> /// <param name="haveJitter"> /// Shows that frames timestamps have jitter and actual fps can slightly differ from the /// <see cref="Fps"/>. /// </param> public RawVideoStreamFormat( RawPixelFormatCode imagePixelFormat, Size resolution, double?fps, bool haveJitter) { ImagePixelFormat = imagePixelFormat; Resolution = resolution; Fps = fps; HaveJitter = haveJitter; }