Affine transformation copy
src | Specifies the layer object to copy from. |
sleft | Specifies the left edge position of the rectangle to copy, in pixels (at the image position of the source layer). |
stop | Specifies the top position of the rectangle to copy, in pixels (at the image position of the source layer). |
swidth | Specifies the width of the rectangle to copy, in pixels (at the image position of the source layer). |
sheight | Specifies the height of the rectangle to copy, in pixels (at the image position of the source layer). |
affine | Specifies how to handle the following 6 arguments (A to F parameters).
By affine transformation, the copy source image position (x, y) (however, the upper left corner of the copy source rectangle is (0, 0)) is the copy destination image position (x', y') by the following formula. Will be converted to.
If false is specified, the copy destination position (x3, y3) corresponding to the lower right corner of the copy source is automatically calculated by the following formula. |
A | A parameter. |
B | B parameter. |
C | C parameter. |
D | D parameter. |
E | E parameter. |
F | F parameter. |
type | Specifies the type of affine transformation.
For stFastLinear, stLinear, and stCubic, stRefNoClip can be additionally specified by bitwise OR, in which case it is allowed to refer to the outside of the area of the bitmap to be copied and synthesize the color. |
clear | Specifies whether to clear the periphery of the affine-transformed image of the transfer destination layer with the color and transparency indicated by the Layer.neutralColor property. |
Copies the rectangle of the specified source layer while converting it to the copy destination (layer that executes the method).
The affine argument allows you to choose whether to specify a two-dimensional affine transformation matrix as the transformation parameter or to specify the transformed point directly.
In the current version, linear interpolation is effective when stFastLinear is specified when the Layer.face property of the layer to be overlaid (which executes the method) is dfAlpha (or dfBoth) or dfAddAlpha.
Linear interpolation is also possible when the Layer.face property is dfOpaque and the Layer.holdAlpha property is false.
If the Layer.face property of the layer to which you want to overlay (execute the method) is dfAlpha (or dfBoth) or dfAddAlpha, both the main image and the mask image are copied.
If the Layer.face property of the layer to be overlaid (executes the method) is dfOpaque (or dfMain), only the main image is copied when the Layer.holdAlpha property is true, and the main image and mask are false. Both images are copied.
The transformation by the two-dimensional affine transformation matrix is defined as follows, with the origin (0, 0) at the upper left of the copy source rectangle.
Two-dimensional affine transformations allow you to scale, rotate, shear, translate, flip, or transform any combination of these.
In the method that performs 2D affine transformation, the transformation can be specified by directly specifying each vertex after transformation instead of the 2D affine matrix, but even in this case, transformation that cannot be defined by 2D affine transformation should be performed. You can not.
For affine transformations, pixels are considered to have a size of 1.0 x 1.0.
That is, the pixel at position (0, 0) is considered to be in the range (-0.5, -0.5)-(0.5, 0.5).