mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
more tests and fixed bug for interpolate4
This commit is contained in:
parent
5227c30561
commit
838a5cffe7
|
@ -146,6 +146,27 @@ class TestColorLut3DCoreAPI(PillowTestCase):
|
|||
im.im.color_lut_3d('RGB', Image.LINEAR,
|
||||
*self.generate_unit_table(3, (2, 2, 65)))))
|
||||
|
||||
def test_units_4channels(self):
|
||||
g = Image.linear_gradient('L')
|
||||
im = Image.merge('RGB', [g, g.transpose(Image.ROTATE_90),
|
||||
g.transpose(Image.ROTATE_180)])
|
||||
|
||||
# Red channel copied to alpha
|
||||
self.assert_image_equal(
|
||||
Image.merge('RGBA', (im.split()*2)[:4]),
|
||||
im._new(im.im.color_lut_3d('RGBA', Image.LINEAR,
|
||||
*self.generate_unit_table(4, 17))))
|
||||
|
||||
def test_copy_alpha_channel(self):
|
||||
g = Image.linear_gradient('L')
|
||||
im = Image.merge('RGBA', [g, g.transpose(Image.ROTATE_90),
|
||||
g.transpose(Image.ROTATE_180),
|
||||
g.transpose(Image.ROTATE_270)])
|
||||
|
||||
self.assert_image_equal(im, im._new(
|
||||
im.im.color_lut_3d('RGBA', Image.LINEAR,
|
||||
*self.generate_unit_table(3, 17))))
|
||||
|
||||
def test_channels_order(self):
|
||||
g = Image.linear_gradient('L')
|
||||
im = Image.merge('RGB', [g, g.transpose(Image.ROTATE_90),
|
||||
|
|
|
@ -111,7 +111,7 @@ ImagingColorLUT3D_linear(Imaging imOut, Imaging imIn, int table_channels,
|
|||
INT16 shift1D = (SCALE_MASK & index1D) >> (SCALE_BITS - SHIFT_BITS);
|
||||
INT16 shift2D = (SCALE_MASK & index2D) >> (SCALE_BITS - SHIFT_BITS);
|
||||
INT16 shift3D = (SCALE_MASK & index3D) >> (SCALE_BITS - SHIFT_BITS);
|
||||
int idx = 3 * table_index3D(
|
||||
int idx = table_channels * table_index3D(
|
||||
index1D >> SCALE_BITS, index2D >> SCALE_BITS,
|
||||
index3D >> SCALE_BITS, size1D, size1D_2D);
|
||||
INT16 result[4], left[4], right[4];
|
||||
|
|
Loading…
Reference in New Issue
Block a user