ImageEffectAbstract
ClassDataClassSource
ImageEffectAbstract()
The abstract image effect.
Most properties are not implemented here.
It is only used for providing the common logics of different effects.
Fields
No field is defined.
Abstract methods
effect
v_1: Image | None = self.effect(image_fg: Image)
Generate the effect image from the given image.
Requires
| Name | Type | Required | |
|---|---|---|---|
image_fg | Image | The image used for genereating this effect. |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | None | The generated effect image. This image should be This image should be center-aligned with the input Will return |
Methods
compose
v_1: Image = self.compose(comp: ImageComposer, image_bg: Image, image_fg: Image)
Compose the background and foreground images.
This method do not need to be overriden unless the subclass needs to change the behavior of image blending.
Requires
| Name | Type | Required | |
|---|---|---|---|
comp | ImageComposer | The composer that is used for merging images. | |
image_bg | Image | The background image where the effect will be rendered. This image should be RGB or RGBA. | |
image_fg | Image | The image used for genereating this effect. |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | The composed image. |
render
v_1: Image = self.render(
comp: ImageComposer, image_bg: Image, image_fg: Image, pos: tuple[int, int]
)
Render this effect.
Requires
| Name | Type | Required | |
|---|---|---|---|
comp | ImageComposer | The composer that is used for merging images. | |
image_bg | Image | The background image where the effect will be rendered. This image should be RGB or RGBA. | |
image_fg | Image | The image used for genereating this effect. | |
pos | tuple[int, int] | The (x, y) position where the image_fg is placed on the image_bg. This position is the top-left corner of image_fg. |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | The image_bg with this effect image rendered on it. |