예제 #1
0
 static SKCodecOptions()
 {
     Default = new SKCodecOptions(SKZeroInitialized.No);
 }
예제 #2
0
        public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, SKCodecOptions options)
        {
            var colorTableCount = 0;

            return(GetPixels(info, pixels, options, IntPtr.Zero, ref colorTableCount));
        }
예제 #3
0
		public SKCodecResult GetPixels (SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
		{
			return GetPixels (info, pixels, rowBytes, options, colorTable == null ? IntPtr.Zero : colorTable.ReadColors (), ref colorTableCount);
		}
예제 #4
0
 public SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount) =>
 StartScanlineDecode(info, options);
예제 #5
0
 public unsafe SKCodecResult StartIncrementalDecode(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
 {
     return(StartIncrementalDecode(info, pixels, rowBytes, options, colorTable == null ? IntPtr.Zero : colorTable.ReadColors(), ref colorTableCount));
 }
예제 #6
0
 public SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
 {
     return(StartScanlineDecode(info, options, colorTable == null ? IntPtr.Zero : colorTable.ReadColors(), ref colorTableCount));
 }
예제 #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 = 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));
        }
예제 #8
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));
        }
예제 #9
0
		public unsafe SKCodecResult StartIncrementalDecode(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
		{
			return StartIncrementalDecode (info, pixels, rowBytes, options, colorTable == null ? IntPtr.Zero : colorTable.ReadColors (), ref colorTableCount);
		}
예제 #10
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));
        }
예제 #11
0
		public SKCodecResult StartIncrementalDecode (SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options)
		{
			int colorTableCount = 0;
			return StartIncrementalDecode (info, pixels, rowBytes, options, IntPtr.Zero, ref colorTableCount);
		}
예제 #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);
		}
예제 #13
0
		public SKCodecResult GetPixels (SKImageInfo info, IntPtr pixels, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
		{
			return GetPixels (info, pixels, info.RowBytes, options, colorTable, ref colorTableCount);
		}
예제 #14
0
 public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
 {
     return(GetPixels(info, pixels, rowBytes, options, colorTable == null ? IntPtr.Zero : colorTable.ReadColors(), ref colorTableCount));
 }
예제 #15
0
 public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, SKCodecOptions options) =>
 GetPixels(info, pixels, info.RowBytes, options);
예제 #16
0
 public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount)
 {
     return(GetPixels(info, pixels, info.RowBytes, options, colorTable, ref colorTableCount));
 }
예제 #17
0
 public SKCodecResult GetPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount) =>
 GetPixels(info, pixels, rowBytes, options);
예제 #18
0
        public SKCodecResult StartIncrementalDecode(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options)
        {
            int colorTableCount = 0;

            return(StartIncrementalDecode(info, pixels, rowBytes, options, IntPtr.Zero, ref colorTableCount));
        }
예제 #19
0
        // incremental (start)

        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));
            }
        }
예제 #20
0
        public SKCodecResult StartScanlineDecode(SKImageInfo info, SKCodecOptions options)
        {
            int colorTableCount = 0;

            return(StartScanlineDecode(info, options, IntPtr.Zero, ref colorTableCount));
        }
예제 #21
0
 public SKCodecResult StartIncrementalDecode(SKImageInfo info, IntPtr pixels, int rowBytes, SKCodecOptions options, SKColorTable colorTable, ref int colorTableCount) =>
 StartIncrementalDecode(info, pixels, rowBytes, options);
예제 #22
0
 static SKCodecOptions()
 {
     Default = new SKCodecOptions(SKZeroInitialized.No);
 }
예제 #23
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));
        }