public void CanEncodeBitmap(string source, int compX, int compY, string expected) { using var img = SKBitmap.Decode(Path.Combine("images", source)); var result = SKBlurHash.Serialize(img, compX, compY); Assert.Equal(expected, result); }
public void CanEncodeAndDecode() { using var img = SKBitmap.Decode(Path.Combine("images", "img1.jpg")); var encoded = SKBlurHash.Serialize(img, 4, 3); Assert.NotNull(encoded); Assert.True(encoded.Length > 6); var decoded = SKBlurHash.DeserializeBitmap(encoded, 12, 10); Assert.NotNull(decoded); }
public void NullEncodeThrows() { Assert.Throws <ArgumentNullException>(() => SKBlurHash.Serialize((SKBitmap)null, 4, 3)); }