Move new_block to module

This commit is contained in:
Aleksandr Karpinskii 2024-09-05 01:04:35 +04:00
parent 934ae12ed5
commit d29fa73ea6
2 changed files with 2 additions and 4 deletions

View File

@ -178,7 +178,7 @@ class PhotoImage:
if image.isblock() and im.mode == self.__mode: if image.isblock() and im.mode == self.__mode:
block = image block = image
else: else:
block = image.new_block(self.__mode, im.size) block = Image.core.new_block(self.__mode, im.size)
image.convert2(block, image) # convert directly between buffers image.convert2(block, image) # convert directly between buffers
_pyimagingtkcall("PyImagingPhoto", self.__photo, block.ptr) _pyimagingtkcall("PyImagingPhoto", self.__photo, block.ptr)

View File

@ -3674,15 +3674,12 @@ static struct PyMethodDef methods[] = {
/* Unsharpmask extension */ /* Unsharpmask extension */
{"gaussian_blur", (PyCFunction)_gaussian_blur, METH_VARARGS}, {"gaussian_blur", (PyCFunction)_gaussian_blur, METH_VARARGS},
{"unsharp_mask", (PyCFunction)_unsharp_mask, METH_VARARGS}, {"unsharp_mask", (PyCFunction)_unsharp_mask, METH_VARARGS},
{"box_blur", (PyCFunction)_box_blur, METH_VARARGS}, {"box_blur", (PyCFunction)_box_blur, METH_VARARGS},
/* Special effects */ /* Special effects */
{"effect_spread", (PyCFunction)_effect_spread, METH_VARARGS}, {"effect_spread", (PyCFunction)_effect_spread, METH_VARARGS},
/* Misc. */ /* Misc. */
{"new_block", (PyCFunction)_new_block, METH_VARARGS},
{"save_ppm", (PyCFunction)_save_ppm, METH_VARARGS}, {"save_ppm", (PyCFunction)_save_ppm, METH_VARARGS},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
@ -4212,6 +4209,7 @@ static PyMethodDef functions[] = {
{"blend", (PyCFunction)_blend, METH_VARARGS}, {"blend", (PyCFunction)_blend, METH_VARARGS},
{"fill", (PyCFunction)_fill, METH_VARARGS}, {"fill", (PyCFunction)_fill, METH_VARARGS},
{"new", (PyCFunction)_new, METH_VARARGS}, {"new", (PyCFunction)_new, METH_VARARGS},
{"new_block", (PyCFunction)_new_block, METH_VARARGS},
{"merge", (PyCFunction)_merge, METH_VARARGS}, {"merge", (PyCFunction)_merge, METH_VARARGS},
/* Functions */ /* Functions */