mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-03 11:35:52 +03:00
change function names to snake_case
This commit is contained in:
parent
7d5ab9f1d4
commit
2e02500fa6
|
@ -38,8 +38,8 @@ def test_sanity():
|
||||||
ImageChops.blend(im, im, 0.5)
|
ImageChops.blend(im, im, 0.5)
|
||||||
ImageChops.composite(im, im, im)
|
ImageChops.composite(im, im, im)
|
||||||
|
|
||||||
ImageChops.softlight(im, im)
|
ImageChops.soft_light(im, im)
|
||||||
ImageChops.hardlight(im, im)
|
ImageChops.hard_light(im, im)
|
||||||
ImageChops.overlay(im, im)
|
ImageChops.overlay(im, im)
|
||||||
|
|
||||||
ImageChops.offset(im, 10)
|
ImageChops.offset(im, 10)
|
||||||
|
@ -366,26 +366,26 @@ def test_subtract_modulo_no_clip():
|
||||||
self.assertEqual(new.getpixel((50, 50)), (241, 167, 127))
|
self.assertEqual(new.getpixel((50, 50)), (241, 167, 127))
|
||||||
|
|
||||||
|
|
||||||
def test_softlight(self):
|
def test_soft_light(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
im1 = Image.open("Tests/images/hopper.png")
|
im1 = Image.open("Tests/images/hopper.png")
|
||||||
im2 = Image.open("Tests/images/hopper-XYZ.png")
|
im2 = Image.open("Tests/images/hopper-XYZ.png")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
new = ImageChops.softlight(im1, im2)
|
new = ImageChops.soft_light(im1, im2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(new.getpixel((64, 64)), (163, 54, 32))
|
self.assertEqual(new.getpixel((64, 64)), (163, 54, 32))
|
||||||
self.assertEqual(new.getpixel((15, 100)), (1, 1, 3))
|
self.assertEqual(new.getpixel((15, 100)), (1, 1, 3))
|
||||||
|
|
||||||
|
|
||||||
def test_hardlight(self):
|
def test_hard_light(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
im1 = Image.open("Tests/images/hopper.png")
|
im1 = Image.open("Tests/images/hopper.png")
|
||||||
im2 = Image.open("Tests/images/hopper-XYZ.png")
|
im2 = Image.open("Tests/images/hopper-XYZ.png")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
new = ImageChops.hardlight(im1, im2)
|
new = ImageChops.hard_light(im1, im2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(new.getpixel((64, 64)), (144, 50, 27))
|
self.assertEqual(new.getpixel((64, 64)), (144, 50, 27))
|
||||||
|
|
|
@ -36,8 +36,8 @@ operations in this module).
|
||||||
.. autofunction:: PIL.ImageChops.logical_or
|
.. autofunction:: PIL.ImageChops.logical_or
|
||||||
.. autofunction:: PIL.ImageChops.logical_xor
|
.. autofunction:: PIL.ImageChops.logical_xor
|
||||||
.. autofunction:: PIL.ImageChops.multiply
|
.. autofunction:: PIL.ImageChops.multiply
|
||||||
.. autofunction:: PIL.ImageChops.softlight
|
.. autofunction:: PIL.ImageChops.soft_light
|
||||||
.. autofunction:: PIL.ImageChops.hardlight
|
.. autofunction:: PIL.ImageChops.hard_light
|
||||||
.. autofunction:: PIL.ImageChops.overlay
|
.. autofunction:: PIL.ImageChops.overlay
|
||||||
.. py:method:: PIL.ImageChops.offset(image, xoffset, yoffset=None)
|
.. py:method:: PIL.ImageChops.offset(image, xoffset, yoffset=None)
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ def screen(image1, image2):
|
||||||
return image1._new(image1.im.chop_screen(image2.im))
|
return image1._new(image1.im.chop_screen(image2.im))
|
||||||
|
|
||||||
|
|
||||||
def softlight(image1, image2):
|
def soft_light(image1, image2):
|
||||||
"""
|
"""
|
||||||
Superimposes two images on top of each other using the Soft Light algorithm
|
Superimposes two images on top of each other using the Soft Light algorithm
|
||||||
|
|
||||||
|
@ -148,10 +148,10 @@ def softlight(image1, image2):
|
||||||
|
|
||||||
image1.load()
|
image1.load()
|
||||||
image2.load()
|
image2.load()
|
||||||
return image1._new(image1.im.chop_softlight(image2.im))
|
return image1._new(image1.im.chop_soft_light(image2.im))
|
||||||
|
|
||||||
|
|
||||||
def hardlight(image1, image2):
|
def hard_light(image1, image2):
|
||||||
"""
|
"""
|
||||||
Superimposes two images on top of each other using the Hard Light algorithm
|
Superimposes two images on top of each other using the Hard Light algorithm
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ def hardlight(image1, image2):
|
||||||
|
|
||||||
image1.load()
|
image1.load()
|
||||||
image2.load()
|
image2.load()
|
||||||
return image1._new(image1.im.chop_hardlight(image2.im))
|
return image1._new(image1.im.chop_hard_light(image2.im))
|
||||||
|
|
||||||
|
|
||||||
def overlay(image1, image2):
|
def overlay(image1, image2):
|
||||||
|
|
|
@ -2407,7 +2407,7 @@ _chop_subtract_modulo(ImagingObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
_chop_softlight(ImagingObject* self, PyObject* args)
|
_chop_soft_light(ImagingObject* self, PyObject* args)
|
||||||
{
|
{
|
||||||
ImagingObject* imagep;
|
ImagingObject* imagep;
|
||||||
|
|
||||||
|
@ -2418,7 +2418,7 @@ _chop_softlight(ImagingObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
_chop_hardlight(ImagingObject* self, PyObject* args)
|
_chop_hard_light(ImagingObject* self, PyObject* args)
|
||||||
{
|
{
|
||||||
ImagingObject* imagep;
|
ImagingObject* imagep;
|
||||||
|
|
||||||
|
@ -3357,8 +3357,8 @@ static struct PyMethodDef methods[] = {
|
||||||
{"chop_and", (PyCFunction)_chop_and, 1},
|
{"chop_and", (PyCFunction)_chop_and, 1},
|
||||||
{"chop_or", (PyCFunction)_chop_or, 1},
|
{"chop_or", (PyCFunction)_chop_or, 1},
|
||||||
{"chop_xor", (PyCFunction)_chop_xor, 1},
|
{"chop_xor", (PyCFunction)_chop_xor, 1},
|
||||||
{"chop_softlight", (PyCFunction)_chop_softlight, 1},
|
{"chop_soft_light", (PyCFunction)_chop_soft_light, 1},
|
||||||
{"chop_hardlight", (PyCFunction)_chop_hardlight, 1},
|
{"chop_hard_light", (PyCFunction)_chop_hard_light, 1},
|
||||||
{"chop_overlay", (PyCFunction)_chop_overlay, 1},
|
{"chop_overlay", (PyCFunction)_chop_overlay, 1},
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user