Esempio n. 1
0
        public unsafe SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
        {
            var nativeOptions = SKCodecOptionsInternal.FromManaged(ref options);
            var cinfo         = SKImageInfoNative.FromManaged(ref info);

            return(SkiaApi.sk_codec_start_scanline_decode(Handle, ref cinfo, ref nativeOptions, colorTable, ref colorTableCount));
        }
Esempio n. 2
0
        public SKCodecResult StartIncrementalDecode(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_start_incremental_decode(Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions));
            }
        }
Esempio n. 3
0
        public unsafe SKCodecResult StartIncrementalDecode(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_start_incremental_decode(Handle, ref cinfo, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount));
        }
Esempio n. 4
0
        public unsafe SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options, IntPtr colorTable, ref int colorTableCount)
        {
            var nativeOptions = new SKCodecOptionsInternal {
                fZeroInitialized = options.ZeroInitialized,
                fSubset          = null,
                fFrameIndex      = (IntPtr)options.FrameIndex,
                fHasPriorFrame   = options.HasPriorFrame
            };

            if (options.HasSubset)
            {
                var subset = options.Subset.Value;
                nativeOptions.fSubset = ⊂
            }
            return(SkiaApi.sk_codec_start_scanline_decode(Handle, ref info, ref nativeOptions, colorTable, ref colorTableCount));
        }
Esempio n. 5
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));
        }
Esempio n. 6
0
        // scanline (start)

        public SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options)
        {
            var nInfo    = SKImageInfoNative.FromManaged(ref info);
            var nOptions = new SKCodecOptionsInternal {
                fZeroInitialized = options.ZeroInitialized,
                fSubset          = null,
                fFrameIndex      = options.FrameIndex,
                fPriorFrame      = options.PriorFrame,
            };
            var subset = default(SKRectI);

            if (options.HasSubset)
            {
                subset           = options.Subset.Value;
                nOptions.fSubset = ⊂
            }

            return(SkiaApi.sk_codec_start_scanline_decode(Handle, &nInfo, &nOptions));
        }
Esempio n. 7
0
        public unsafe SKCodecResult StartIncrementalDecode(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
            };

            if (options.HasSubset)
            {
                var subset = options.Subset.Value;
                nativeOptions.fSubset = ⊂
            }
            return(SkiaApi.sk_codec_start_incremental_decode(Handle, ref info, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount));
        }
Esempio n. 8
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);
            var nOptions = new SKCodecOptionsInternal {
                fZeroInitialized = options.ZeroInitialized,
                fSubset          = null,
                fFrameIndex      = options.FrameIndex,
                fPriorFrame      = options.PriorFrame,
            };
            var subset = default(SKRectI);

            if (options.HasSubset)
            {
                subset           = options.Subset.Value;
                nOptions.fSubset = ⊂
            }
            return(SkiaApi.sk_codec_get_pixels(Handle, &nInfo, (void *)pixels, (IntPtr)rowBytes, &nOptions));
        }
Esempio n. 9
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));
        }
Esempio n. 10
0
		public extern static SKCodecResult sk_codec_start_incremental_decode(sk_codec_t codec, ref SKImageInfo info, IntPtr pixels, IntPtr rowBytes, ref SKCodecOptionsInternal options, IntPtr ctableZero, IntPtr ctableCountZero);
Esempio n. 11
0
		public extern static SKCodecResult sk_codec_get_pixels(sk_codec_t codec, ref SKImageInfo info, IntPtr pixels, IntPtr rowBytes, ref SKCodecOptionsInternal options, IntPtr ctable, ref int ctableCount);
Esempio n. 12
0
		public unsafe SKCodecResult StartIncrementalDecode(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_start_incremental_decode (Handle, ref info, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount);
		}