public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc) { return(FromTexture(context, texture, origin, colorType, alpha, colorspace, releaseProc, null)); }
public static SKImage FromAdoptedTexture(GRContext context, GRBackendTexture texture, SKColorType colorType) { return(FromAdoptedTexture(context, texture, GRSurfaceOrigin.BottomLeft, colorType, SKAlphaType.Premul, null)); }
public SKPixmap WithColorType(SKColorType newColorType) { return(new SKPixmap(Info.WithColorType(newColorType), GetPixels(), RowBytes)); }
public SKBitmap(int width, int height, SKColorType colorType, SKAlphaType alphaType) : this(new SKImageInfo(width, height, colorType, alphaType)) { }
public SKImageInfo(int width, int height) { this.width = width; this.height = height; this.colorType = PlatformColorType; this.alphaType = SKAlphaType.Premul; }
public Bitmap(int width, int height, SKColorType colorType = (SKColorType.Bgra8888)) { nativeSkBitmap = new SKBitmap(new SKImageInfo(width, height, colorType)); nativeSkBitmap.Erase(SKColor.Empty); }
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType) => Create(context, texture, origin, 0, colorType, null, null);
public SKBitmap (int width, int height, SKColorType colorType, SKAlphaType alphaType) : this (new SKImageInfo (width, height, colorType, alphaType)) { }
public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType) => Create((GRRecordingContext)context, texture, origin, sampleCount, colorType);
public static SKSurface Create(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) => Create((GRRecordingContext)context, texture, origin, colorType, props);
public static SKSurface Create(int width, int height, SKColorType colorType, SKAlphaType alphaType, IntPtr pixels, int rowBytes, SKSurfaceProps props) => Create(new SKImageInfo(width, height, colorType, alphaType), pixels, rowBytes, props);
public static SKSurface Create(GRContext context, GRBackendTexture texture, SKColorType colorType) => Create((GRRecordingContext)context, texture, colorType);
public static SKSurface Create(GRRecordingContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (renderTarget == null) { throw new ArgumentNullException(nameof(renderTarget)); } return(GetObject(SkiaApi.sk_surface_new_backend_render_target(context.Handle, renderTarget.Handle, origin, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); }
public extern static bool sk_bitmap_can_copy_to(sk_bitmap_t cbitmap, SKColorType ct);
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace) => Create(context, texture, origin, sampleCount, colorType, colorspace, null);
public SKBitmap Copy (SKColorType colorType) { var destination = new SKBitmap (); if (!SkiaApi.sk_bitmap_copy (Handle, destination.Handle, colorType)) { destination.Dispose (); destination = null; } return destination; }
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, GRSurfaceOrigin.BottomLeft, 0, colorType, null, props);
public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, IntPtr pixels, int rowBytes, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), pixels, rowBytes, props);
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, origin, sampleCount, colorType, null, props);
public static SKSurface Create(GRRecordingContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKSurfaceProperties props) => Create(context, renderTarget, origin, colorType, null, props);
public static SKSurface Create(GRRecordingContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (texture == null) { throw new ArgumentNullException(nameof(texture)); } return(GetObject(SkiaApi.sk_surface_new_backend_texture(context.Handle, texture.Handle, origin, sampleCount, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero))); }
public SKPaintMetalSurfaceEventArgs(SKSurface surface, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType) { Surface = surface; BackendRenderTarget = renderTarget; ColorType = colorType; Origin = origin; }
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType) => Create(context, texture, origin, sampleCount, colorType);
public bool CanCopyTo(SKColorType colorType) { return(SkiaApi.sk_bitmap_can_copy_to(Handle, colorType)); }
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, SKColorType colorType, SKSurfaceProperties props) => Create(context, texture, colorType, props);
public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace) { return(FromTexture(context, texture, origin, colorType, alpha, colorspace, null, null)); }
public static SKSurface CreateAsRenderTarget(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) => Create(context, texture, origin, sampleCount, colorType, colorspace, props);
public static SKImage FromTexture(GRContext context, GRBackendTexture texture, GRSurfaceOrigin origin, SKColorType colorType, SKAlphaType alpha, SKColorSpace colorspace, SKImageTextureReleaseDelegate releaseProc, object releaseContext) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (texture == null) { throw new ArgumentNullException(nameof(texture)); } var cs = colorspace == null ? IntPtr.Zero : colorspace.Handle; var del = releaseProc != null && releaseContext != null ? new SKImageTextureReleaseDelegate((_) => releaseProc(releaseContext)) : releaseProc; var proxy = DelegateProxies.Create(del, DelegateProxies.SKImageTextureReleaseDelegateProxy, out _, out var ctx); return(GetObject(SkiaApi.sk_image_new_from_texture(context.Handle, texture.Handle, origin, colorType, alpha, cs, proxy, (void *)ctx))); }
public static SKSurface Create(GRRecordingContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, out CoreAnimation.ICAMetalDrawable drawable) => Create(context, layer, origin, sampleCount, colorType, colorspace, null, out drawable);
public extern static bool sk_bitmap_copy(sk_bitmap_t cbitmap, sk_bitmap_t dst, SKColorType ct);
public static SKSurface Create(GRRecordingContext context, CoreAnimation.CAMetalLayer layer, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props, out CoreAnimation.ICAMetalDrawable drawable) { void *drawablePtr; var surface = GetObject(SkiaApi.sk_surface_new_metal_layer(context.Handle, (void *)layer.Handle, origin, sampleCount, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero, &drawablePtr)); drawable = ObjCRuntime.Runtime.GetINativeObject <CoreAnimation.ICAMetalDrawable> ((IntPtr)drawablePtr, true); return(surface); }
public bool CanCopyTo (SKColorType colorType) { return SkiaApi.sk_bitmap_can_copy_to (Handle, colorType); }
public static SKSurface Create(GRRecordingContext context, MetalKit.MTKView view, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace) => Create(context, view, origin, sampleCount, colorType, colorspace, null);
public bool CopyTo (SKBitmap destination, SKColorType colorType) { if (destination == null) { throw new ArgumentNullException (nameof (destination)); } return SkiaApi.sk_bitmap_copy (Handle, destination.Handle, colorType); }
public static SKSurface Create(GRRecordingContext context, MetalKit.MTKView view, GRSurfaceOrigin origin, int sampleCount, SKColorType colorType, SKColorSpace colorspace, SKSurfaceProperties props) => GetObject(SkiaApi.sk_surface_new_metal_view(context.Handle, (void *)view.Handle, origin, sampleCount, colorType.ToNative(), colorspace?.Handle ?? IntPtr.Zero, props?.Handle ?? IntPtr.Zero));
public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), props);
public static SKSurface Create(int width, int height, SKColorType colorType, SKAlphaType alphaType) => Create(new SKImageInfo(width, height, colorType, alphaType));
static SKImageInfo() { #if WINDOWS_UWP var isUnix = false; #else var isUnix = Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix; #endif if (isUnix) { // Unix depends on the CPU endianess, but we use RGBA PlatformColorType = SKColorType.Rgba8888; } else { // Windows is always BGRA PlatformColorType = SKColorType.Bgra8888; } }
public Bitmap(int width, int height, int stride, SKColorType bgra8888 = (SKColorType.Bgra8888), IntPtr data = default(IntPtr)) { nativeSkBitmap = new SKBitmap(new SKImageInfo(width, height, bgra8888)); nativeSkBitmap.SetPixels(data); }
public SKImageInfo(int width, int height, SKColorType colorType, SKAlphaType alphaType) { this.width = width; this.height = height; this.colorType = colorType; this.alphaType = alphaType; }
public static SKSurface Create(GRRecordingContext context, GRBackendRenderTarget renderTarget, GRSurfaceOrigin origin, SKColorType colorType, SKColorSpace colorspace) => Create(context, renderTarget, origin, colorType, colorspace, null);