示例#1
0
        /// <summary>
        /// <see cref="av_image_fill_pointers(ref byte_ptrArray4, AVPixelFormat, int, byte*, int_array4)"/>
        /// </summary>
        public static unsafe Ptr4 ToPlaneData(IntPtr sourceData, Int32x4 linesizes, PixelFormat pixelFormat, int height)
        {
            byte_ptrArray4 ret;

            av_image_fill_pointers(ref ret, (AVPixelFormat)pixelFormat, height, (byte *)sourceData, linesizes).ThrowIfError();
            return(ret);
        }
示例#2
0
 /// <summary>
 /// <see cref="av_image_copy_to_buffer(byte*, int, byte_ptrArray4, int_array4, AVPixelFormat, int, int, int)"/>
 /// </summary>
 public static unsafe int CopyToBuffer(
     PixelFormat pixelFormat,
     int width,
     int height,
     DataPointer dest,
     Ptr4 sourceData, Int32x4 sourceLinesize,
     int align = 1)
 {
     return(av_image_copy_to_buffer(
                (byte *)dest.Pointer, dest.Length,
                sourceData, sourceLinesize,
                (AVPixelFormat)pixelFormat,
                width, height, align).ThrowIfError());
 }
示例#3
0
 /// <summary>
 /// <see cref="sws_scale(SwsContext*, byte*[], int[], int, int, byte*[], int[])"/>
 /// </summary>
 public void Convert(Ptr4 sourceData, Int32x4 sourceLinesize, int sourceSliceH, Ptr4 destData, Int32x4 destLinesize, int sourceSliceY = 0) =>
 sws_scale(this,
           srcSlice: sourceData.ToBytePtrArray(), srcStride: sourceLinesize.ToArray(), srcSliceY: sourceSliceY, srcSliceH: sourceSliceH,
           destData.ToBytePtrArray(), destLinesize.ToArray()).ThrowIfError();