sk_codec_get_pixels() private method

private sk_codec_get_pixels ( IntPtr codec, SKImageInfo &info, IntPtr pixels, IntPtr rowBytes, SKCodecOptionsInternal &options, IntPtr ctable, int &ctableCount ) : SKCodecResult
codec System.IntPtr
info SKImageInfo
pixels IntPtr
rowBytes IntPtr
options SKCodecOptionsInternal
ctable IntPtr
ctableCount int
return SKCodecResult
Ejemplo n.º 1
0
        public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options)
        {
            if (pixels == IntPtr.Zero)
            {
                throw new ArgumentNullException(nameof(pixels));
            }

            var nInfo = SKImageInfoNative.FromManaged(ref info);

            unsafe {
                var nOptions = new SKCodecOptionsInternal {
                    fZeroInitialized = options.ZeroInitialized,
                    fSubset          = null,
                    fFrameIndex      = options.FrameIndex,
                    fPriorFrame      = options.PriorFrame,
                    fPremulBehavior  = options.PremulBehavior,
                };
                var subset = default(SKRectI);
                if (options.HasSubset)
                {
                    subset           = options.Subset.Value;
                    nOptions.fSubset = ⊂
                }
                return(SkiaApi.sk_codec_get_pixels(Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions));
            }
        }
Ejemplo n.º 2
0
        public unsafe SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
        {
            if (pixels == IntPtr.Zero)
            {
                throw new ArgumentNullException(nameof(pixels));
            }

            var nativeOptions = SKCodecOptionsInternal.FromManaged(ref options);
            var cinfo         = SKImageInfoNative.FromManaged(ref info);

            return(SkiaApi.sk_codec_get_pixels(Handle, ref cinfo, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount));
        }
Ejemplo n.º 3
0
        public unsafe SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
        {
            if (pixels == IntPtr.Zero)
            {
                throw new ArgumentNullException(nameof(pixels));
            }

            var nativeOptions = new SKCodecOptionsInternal {
                fZeroInitialized = options.ZeroInitialized,
                fSubset          = null
            };

            if (options.HasSubset)
            {
                var subset = options.Subset.Value;
                nativeOptions.fSubset = ⊂
            }
            return(SkiaApi.sk_codec_get_pixels(Handle, ref info, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount));
        }
Ejemplo n.º 4
0
        public unsafe SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
        {
            if (pixels == IntPtr.Zero)
            {
                throw new ArgumentNullException(nameof(pixels));
            }

            var nativeOptions = new SKCodecOptionsInternal {
                fZeroInitialized = options.ZeroInitialized,
                fSubset          = null,
                fFrameIndex      = (IntPtr)options.FrameIndex,
                fHasPriorFrame   = options.HasPriorFrame,
                fPremulBehavior  = options.PremulBehavior,
            };

            if (options.HasSubset)
            {
                var subset = options.Subset.Value;
                nativeOptions.fSubset = ⊂
            }
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(SkiaApi.sk_codec_get_pixels(Handle, ref cinfo, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount));
        }
Ejemplo n.º 5
0
 public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
 {
     return(SkiaApi.sk_codec_get_pixels(Handle, ref info, pixels, (IntPtr)rowBytes, ref options, colorTable, ref colorTableCount));
 }