示例#1
0
        public static SKImage DeserializeImage(ReadOnlySpan <char> blurHash, int width, int height, float punch = 1f)
        {
            if (width <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(width));
            }
            if (height <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(height));
            }

            return(SKBlurHashDeserializer.DeserializeImage(blurHash, width, height, punch));
        }
示例#2
0
        // Deserialize

        public static SKBitmap DeserializeBitmap(string blurHash, int width, int height, float punch = 1f)
        {
            if (blurHash == null)
            {
                throw new ArgumentNullException(nameof(blurHash));
            }
            if (width <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(width));
            }
            if (height <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(height));
            }

            return(SKBlurHashDeserializer.DeserializeBitmap(blurHash.AsSpan(), width, height, punch));
        }