示例#1
0
        public static SKColorType ToColorType(this GRPixelConfig config)
        {
            switch (config)
            {
            case GRPixelConfig.Unknown:
                return(SKColorType.Unknown);

            case GRPixelConfig.Alpha8:
                return(SKColorType.Alpha8);

            case GRPixelConfig.Gray8:
                return(SKColorType.Gray8);

            case GRPixelConfig.Rgb565:
                return(SKColorType.Rgb565);

            case GRPixelConfig.Rgba4444:
                return(SKColorType.Argb4444);

            case GRPixelConfig.Rgba8888:
                return(SKColorType.Rgba8888);

            case GRPixelConfig.Rgb888:
                return(SKColorType.Rgb888x);

            case GRPixelConfig.Bgra8888:
                return(SKColorType.Bgra8888);

            case GRPixelConfig.Srgba8888:
                return(SKColorType.Rgba8888);

            case GRPixelConfig.Sbgra8888:
                return(SKColorType.Bgra8888);

            case GRPixelConfig.Rgba1010102:
                return(SKColorType.Rgba1010102);

            case GRPixelConfig.RgbaFloat:
                return(SKColorType.Unknown);

            case GRPixelConfig.RgFloat:
                return(SKColorType.Unknown);

            case GRPixelConfig.AlphaHalf:
                return(SKColorType.Unknown);

            case GRPixelConfig.RgbaHalf:
                return(SKColorType.RgbaF16);

            default:
                throw new ArgumentOutOfRangeException(nameof(config));
            }
        }
示例#2
0
        public static uint ToGlSizedFormat(this GRPixelConfig config)
        {
            switch (config)
            {
            case GRPixelConfig.Alpha8:
                return(GRGlSizedFormat.ALPHA8);

            case GRPixelConfig.Gray8:
                return(GRGlSizedFormat.LUMINANCE8);

            case GRPixelConfig.Rgb565:
                return(GRGlSizedFormat.RGB565);

            case GRPixelConfig.Rgba4444:
                return(GRGlSizedFormat.RGBA4);

            case GRPixelConfig.Rgba8888:
                return(GRGlSizedFormat.RGBA8);

            case GRPixelConfig.Rgb888:
                return(GRGlSizedFormat.RGB8);

            case GRPixelConfig.Bgra8888:
                return(GRGlSizedFormat.BGRA8);

            case GRPixelConfig.Srgba8888:
                return(GRGlSizedFormat.SRGB8_ALPHA8);

            case GRPixelConfig.Sbgra8888:
                return(GRGlSizedFormat.SRGB8_ALPHA8);

            case GRPixelConfig.Rgba1010102:
                return(GRGlSizedFormat.RGB10_A2);

            case GRPixelConfig.RgbaFloat:
                return(GRGlSizedFormat.RGBA32F);

            case GRPixelConfig.RgFloat:
                return(GRGlSizedFormat.RG32F);

            case GRPixelConfig.AlphaHalf:
                return(GRGlSizedFormat.R16F);

            case GRPixelConfig.RgbaHalf:
                return(GRGlSizedFormat.RGBA16F);

            case GRPixelConfig.Unknown:
                return(0);

            default:
                throw new ArgumentOutOfRangeException(nameof(config));
            }
        }
示例#3
0
 public int GetRecommendedSampleCount(GRPixelConfig config, float dpi)
 {
     return(GetMaxSurfaceSampleCount(config.ToColorType()));
 }
示例#4
0
 public int GetRecommendedSampleCount(GRPixelConfig config, float dpi)
 {
     return(SkiaApi.gr_context_get_recommended_sample_count(Handle, config, dpi));
 }
示例#5
0
		public int GetRecommendedSampleCount (GRPixelConfig config, float dpi)
		{
			return SkiaApi.gr_context_get_recommended_sample_count (Handle, config, dpi);
		}
示例#6
0
		public extern static int gr_context_get_recommended_sample_count (gr_context_t context, GRPixelConfig config, float dpi);