This PR implements a new feature called "generic operations". This allows third party apps to register operations that only interact with other operations and not the image directly, which means the operation could be called using any image class that supports those operations it depends on.
The first generic operation is get_pixel_count which calls get_size and get_frame_count and multiplies the results together. This operation gets automatically added on to the Pillow, Wand and OpenCV image classes as they all support the get_size and get_frame_count operations.
This will be really nice once we have the Affine Transformations API as this would allow us to implement the higher-level operations (eg, rotate, scale, etc) for all backends that support that API generically.
This PR implements a new feature called "generic operations". This allows third party apps to register operations that only interact with other operations and not the image directly, which means the operation could be called using any image class that supports those operations it depends on.
The first generic operation is
get_pixel_count
which callsget_size
andget_frame_count
and multiplies the results together. This operation gets automatically added on to the Pillow, Wand and OpenCV image classes as they all support theget_size
andget_frame_count
operations.This will be really nice once we have the Affine Transformations API as this would allow us to implement the higher-level operations (eg, rotate, scale, etc) for all backends that support that API generically.