test band fold/unfold factors

This commit is contained in:
John Cupitt 2015-06-11 12:49:11 +01:00
parent d7d8e03a86
commit e107dd11c0
2 changed files with 9 additions and 2 deletions

2
TODO
View File

@ -1,5 +1,3 @@
- tests for band fold/unfold with factor
- how about something like vips_grid() which turns a tall thin one-band
image into a much smaller many-band image?

View File

@ -237,6 +237,15 @@ class TestConversion(unittest.TestCase):
self.assertEqual(y.bands, 1)
self.assertEqual(x.avg(), y.avg())
x = self.mono.bandfold(factor = 2)
self.assertEqual(x.width, self.mono.width / 2)
self.assertEqual(x.bands, 2)
y = x.bandunfold(factor = 2)
self.assertEqual(y.width, self.mono.width)
self.assertEqual(y.bands, 1)
self.assertEqual(x.avg(), y.avg())
def test_byteswap(self):
x = self.mono.cast("ushort")
y = x.byteswap().byteswap()