public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceReleaseDelegate releaseProc, object context, SKSurfaceProperties props) { var cinfo = SKImageInfoNative.FromManaged(ref info); if (releaseProc == null) { return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, IntPtr.Zero, IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); } else { var ctx = new NativeDelegateContext(context, releaseProc); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, releaseDelegate, ctx.NativeContext, props?.Handle ?? IntPtr.Zero))); } }
public bool InstallPixels(SKImageInfo info, IntPtr pixels, int rowBytes, SKBitmapReleaseDelegate releaseProc, object context) { var cinfo = SKImageInfoNative.FromManaged(ref info); if (releaseProc == null) { return(SkiaApi.sk_bitmap_install_pixels(Handle, ref cinfo, pixels, (IntPtr)rowBytes, IntPtr.Zero, IntPtr.Zero)); } else { var ctx = new NativeDelegateContext(context, releaseProc); return(SkiaApi.sk_bitmap_install_pixels(Handle, ref cinfo, pixels, (IntPtr)rowBytes, releaseDelegate, ctx.NativeContext)); } }
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 = ⊂ } var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_codec_start_scanline_decode(Handle, ref cinfo, ref nativeOptions, colorTable, ref colorTableCount)); }
// 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)); }
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)); }
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 = ⊂ } var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_codec_start_incremental_decode(Handle, ref cinfo, pixels, (IntPtr)rowBytes, ref nativeOptions, colorTable, ref colorTableCount)); }
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_render_target(context.Handle, budgeted, ref cinfo, 0, IntPtr.Zero))); }
public static SKSurface Create(GRContext context, bool budgeted, SKImageInfo info, int sampleCount, SKSurfaceProps props) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_render_target(context.Handle, budgeted, ref cinfo, sampleCount, ref props))); }
public bool TryAllocPixels(SKImageInfo info, SKBitmapAllocFlags flags) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_bitmap_try_alloc_pixels_with_flags(Handle, ref cinfo, flags)); }
public SKCodecResult StartIncrementalDecode(SKImageInfo info, IntPtr pixels, int rowBytes) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_codec_start_incremental_decode(Handle, ref cinfo, pixels, (IntPtr)rowBytes, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero)); }
public static SKSurface Create(SKImageInfo info, IntPtr pixels, int rowBytes, SKSurfaceProps props) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster_direct(ref cinfo, pixels, (IntPtr)rowBytes, ref props))); }
public bool ReadPixels(SKImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes, int srcX, int srcY, SKTransferFunctionBehavior behavior) { var cinfo = SKImageInfoNative.FromManaged(ref dstInfo); return(SkiaApi.sk_pixmap_read_pixels(Handle, &cinfo, (void *)dstPixels, (IntPtr)dstRowBytes, srcX, srcY, behavior)); }
public void Reset(SKImageInfo info, IntPtr addr, int rowBytes, SKColorTable ctable = null) { var cinfo = SKImageInfoNative.FromManaged(ref info); SkiaApi.sk_pixmap_reset_with_params(Handle, ref cinfo, addr, (IntPtr)rowBytes, ctable == null ? IntPtr.Zero : ctable.Handle); }
private bool TryAllocPixels(SKImageInfo info, SKColorTable ctable, SKBitmapAllocFlags flags = SKBitmapAllocFlags.None) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_bitmap_try_alloc_pixels_with_color_table(Handle, ref cinfo, ctable != null ? ctable.Handle : IntPtr.Zero, flags)); }
public bool ReadPixels(SKImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes, int srcX, int srcY) { var cinfo = SKImageInfoNative.FromManaged(ref dstInfo); return(SkiaApi.sk_surface_read_pixels(Handle, ref cinfo, dstPixels, (IntPtr)dstRowBytes, srcX, srcY)); }
public static SKSurface Create(SKImageInfo info, SKSurfaceProps props) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref cinfo, ref props))); }
public void Reset(SKImageInfo info, IntPtr addr, int rowBytes) { var cinfo = SKImageInfoNative.FromManaged(ref info); SkiaApi.sk_pixmap_reset_with_params(Handle, &cinfo, (void *)addr, (IntPtr)rowBytes); }
public bool ReadPixels(SKImageInfo dstInfo, IntPtr dstPixels, int dstRowBytes, int srcX, int srcY, SKImageCachingHint cachingHint) { var cinfo = SKImageInfoNative.FromManaged(ref dstInfo); return(SkiaApi.sk_image_read_pixels(Handle, &cinfo, (void *)dstPixels, (IntPtr)dstRowBytes, srcX, srcY, cachingHint)); }
public static SKSurface Create(SKImageInfo info, int rowBytes, SKSurfaceProperties props) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(GetObject <SKSurface> (SkiaApi.sk_surface_new_raster(ref cinfo, (IntPtr)rowBytes, props?.Handle ?? IntPtr.Zero))); }
public SKCodecResult StartScanlineDecode(SKImageInfo info) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_codec_start_scanline_decode(Handle, ref cinfo, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero)); }
public bool TryAllocPixels(SKImageInfo info, int rowBytes) { var cinfo = SKImageInfoNative.FromManaged(ref info); return(SkiaApi.sk_bitmap_try_alloc_pixels(Handle, ref cinfo, (IntPtr)rowBytes)); }