コード例 #1
0
        public static void EmbossMaskFilter(SKCanvas canvas, int width, int height)
        {
            canvas.DrawColor(SKColors.White);

            SKPoint3 direction = new SKPoint3(1.0f, 1.0f, 1.0f);

            using (var paint = new SKPaint())
                using (var filter = SKMaskFilter.CreateEmboss(2.0f, direction, 0.3f, 0.1f))
                {
                    paint.IsAntialias = true;
                    paint.TextSize    = 120;
                    paint.TextAlign   = SKTextAlign.Center;
                    paint.MaskFilter  = filter;

                    canvas.DrawText("Skia", width / 2f, height / 2f, paint);
                }
        }
コード例 #2
0
		public static SKImageFilter CreateSpotLitDiffuse(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
		{
			return GetObject<SKImageFilter>(SkiaApi.sk_imagefilter_new_spot_lit_diffuse(ref location, ref target, specularExponent, cutoffAngle, lightColor, surfaceScale, kd, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle));
		}
コード例 #3
0
		public static SKImageFilter CreateDistantLitDiffuse(SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
		{
			return GetObject<SKImageFilter>(SkiaApi.sk_imagefilter_new_distant_lit_diffuse(ref direction, lightColor, surfaceScale, kd, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle));
		}
コード例 #4
0
ファイル: SkiaApi.cs プロジェクト: rossmerr/SkiaSharp
 public extern static sk_imagefilter_t sk_imagefilter_new_spot_lit_specular(ref SKPoint3 location, ref SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #5
0
ファイル: SkiaApi.cs プロジェクト: prepare/HTML-Renderer
		public extern static sk_imagefilter_t sk_imagefilter_new_point_lit_diffuse(ref SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #6
0
 public static SKImageFilter CreateSpotLitDiffuse(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float kd, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(GetObject <SKImageFilter>(SkiaApi.sk_imagefilter_new_spot_lit_diffuse(&location, &target, specularExponent, cutoffAngle, (uint)lightColor, surfaceScale, kd, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #7
0
ファイル: Definitions.cs プロジェクト: prepare/HTML-Renderer
 public static SKPoint3 Subtract(SKPoint3 pt, SKPoint3 sz) => pt - sz;
コード例 #8
0
 public static SKImageFilter CreateSpotLitSpecular(SKPoint3 location, SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(GetObject <SKImageFilter>(SkiaApi.sk_imagefilter_new_spot_lit_specular(ref location, ref target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #9
0
ファイル: MathTypes.cs プロジェクト: witness123/SkiaSharp
 public static SKPoint3 Subtract(SKPoint3 pt, SKPoint3 sz) => pt - sz;
コード例 #10
0
ファイル: MathTypes.cs プロジェクト: witness123/SkiaSharp
 public static SKPoint3 Add(SKPoint3 pt, SKPoint3 sz) => pt + sz;
コード例 #11
0
ファイル: SKMaskFilter.cs プロジェクト: prepare/HTML-Renderer
		public static SKMaskFilter CreateEmboss(float blurSigma, SKPoint3 direction, float ambient, float specular)
		{
			return CreateEmboss(blurSigma, direction.X, direction.Y, direction.Z, ambient, specular);
		}
コード例 #12
0
ファイル: SKImageFilter.cs プロジェクト: rossmerr/SkiaSharp
 public static SKImageFilter CreateDistantLitDiffuse(SKPoint3 direction, SKColor lightColor, float surfaceScale, float kd, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(new SKImageFilter(SkiaApi.sk_imagefilter_new_distant_lit_diffuse(ref direction, lightColor, surfaceScale, kd, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #13
0
ファイル: SKImageFilter.cs プロジェクト: rossmerr/SkiaSharp
 public static SKImageFilter CreatePointLitSpecular(SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(new SKImageFilter(SkiaApi.sk_imagefilter_new_point_lit_specular(ref location, lightColor, surfaceScale, ks, shininess, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #14
0
ファイル: SkiaApi.cs プロジェクト: prepare/HTML-Renderer
		public extern static sk_imagefilter_t sk_imagefilter_new_spot_lit_specular(ref SKPoint3 location, ref SKPoint3 target, float specularExponent, float cutoffAngle, SKColor lightColor, float surfaceScale, float ks, float shininess, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #15
0
ファイル: SkiaApi.cs プロジェクト: prepare/HTML-Renderer
		public extern static sk_imagefilter_t sk_imagefilter_new_point_lit_specular(ref SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #16
0
		public static SKImageFilter CreatePointLitSpecular(SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
		{
			return GetObject<SKImageFilter>(SkiaApi.sk_imagefilter_new_point_lit_specular(ref location, lightColor, surfaceScale, ks, shininess, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle));
		}
コード例 #17
0
 public static SKMaskFilter CreateShadow(float occluderHeight, SKPoint3 lightPos, float lightRadius, float ambientAlpha, float spotAlpha, SKShadowMaskFilterShadowFlags flags = SKShadowMaskFilterShadowFlags.None)
 {
     return(GetObject <SKMaskFilter>(SkiaApi.sk_maskfilter_new_shadow(occluderHeight, ref lightPos, lightRadius, ambientAlpha, spotAlpha, flags)));
 }
コード例 #18
0
ファイル: SKMaskFilter.cs プロジェクト: vecalion/SkiaSharp
 public static SKMaskFilter CreateEmboss(float blurSigma, SKPoint3 direction, float ambient, float specular)
 {
     return(CreateEmboss(blurSigma, direction.X, direction.Y, direction.Z, ambient, specular));
 }
コード例 #19
0
ファイル: Definitions.cs プロジェクト: prepare/HTML-Renderer
 public static SKPoint3 Add(SKPoint3 pt, SKPoint3 sz) => pt + sz;
コード例 #20
0
ファイル: SkiaApi.cs プロジェクト: rossmerr/SkiaSharp
 public extern static sk_imagefilter_t sk_imagefilter_new_point_lit_diffuse(ref SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #21
0
 public static SKImageFilter CreatePointLitDiffuse(SKPoint3 location, SKColor lightColor, float surfaceScale, float kd, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(GetObject <SKImageFilter>(SkiaApi.sk_imagefilter_new_point_lit_diffuse(&location, (uint)lightColor, surfaceScale, kd, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #22
0
ファイル: SkiaApi.cs プロジェクト: rossmerr/SkiaSharp
 public extern static sk_imagefilter_t sk_imagefilter_new_point_lit_specular(ref SKPoint3 location, SKColor lightColor, float surfaceScale, float ks, float shininess, sk_imagefilter_t input /*NULL*/, sk_imagefilter_croprect_t cropRect /*NULL*/);
コード例 #23
0
 public static SKImageFilter CreateDistantLitSpecular(SKPoint3 direction, SKColor lightColor, float surfaceScale, float ks, float shininess, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null)
 {
     return(GetObject <SKImageFilter>(SkiaApi.sk_imagefilter_new_distant_lit_specular(&direction, (uint)lightColor, surfaceScale, ks, shininess, input == null ? IntPtr.Zero : input.Handle, cropRect == null ? IntPtr.Zero : cropRect.Handle)));
 }
コード例 #24
0
		public static void EmbossMaskFilter(SKCanvas canvas, int width, int height)
		{
			canvas.DrawColor(SKColors.White);

			SKPoint3 direction = new SKPoint3(1.0f, 1.0f, 1.0f);

			using (var paint = new SKPaint())
			using (var filter = SKMaskFilter.CreateEmboss(2.0f, direction, 0.3f, 0.1f))
			{
				paint.IsAntialias = true;
				paint.TextSize = 120;
				paint.TextAlign = SKTextAlign.Center;
				paint.MaskFilter = filter;

				canvas.DrawText("Skia", width / 2f, height / 2f, paint);
			}
		}