Layer.operateStretch

Function/Meaning

Enlargement / reduction operation composition

Type
Layerclassmethod of
Syntax
operateStretch(dleft, dtop, dwidth, dheight, src, sleft, stop, swidth, sheight, mode=omAuto, opa=255, type=stNearest, option=1)
Arguments
dleft

Specifies the left edge position of the overlay destination rectangle in pixels (at the image position of the overlay destination layer).

dtop

Specifies the top position of the overlay rectangle in pixels (at the image position of the overlay layer).

dwidth

Specifies the width of the overlay rectangle in pixels (at the image position of the overlay layer).

dheight

Specifies the vertical width of the overlay destination rectangle in pixels (at the image position of the overlay destination layer).

src

Specifies the layer object to overlay.
You can also specify an object of the Bitmap class.

sleft

Specifies the left edge position of the overlay rectangle in pixels (at the image position of the overlay source layer).

stop

Specifies the top position of the overlay rectangle in pixels (at the image position of the overlay source layer).

swidth

Specifies the width of the overlay rectangle in pixels (at the image position of the overlay source layer).

sheight

Specifies the vertical width of the overlay rectangle in pixels (at the image position of the overlay source layer).

mode

Specifies the operation mode.

  • If omAuto is specified, the operation type is automatically determined according to the Layer.type property of the operation source layer.
  • If omPsNormal is specified, Photoshop compatible alpha compositing is done (implemented outside of stNearest and stFastLinear).
  • If omPsAdditive is specified, Photoshop compatible dodging (linear) compositing is done (implemented outside of stNearest and stFastLinear).
  • If omPsSubtractive is specified, Photoshop compatible burn-in (linear) compositing is performed (implemented other than stNearest and stFastLinear).
  • If omPsMultiplicative is specified, Photoshop compatible multiplication composition is performed (implemented other than stNearest and stFastLinear).
  • If omPsScreen is specified, Photoshop compatible screen composition will be performed (implemented other than stNearest and stFastLinear).
  • If omPsOverlay is specified, Photoshop compatible overlay compositing is done (implemented outside of stNearest and stFastLinear).
  • If omPsHardLight is specified, Photoshop compatible hard light composition will be performed (implemented other than stNearest and stFastLinear).
  • If omPsSoftLight is specified, Photoshop compatible soft light composition will be performed (implemented other than stNearest and stFastLinear).
  • If omPsColorDodge is specified, Photoshop compatible dodge color composition is performed (implemented other than stNearest and stFastLinear).
  • If omPsColorDodge5 is specified, dodge color composition compatible with Photoshop version 5.x and below will be performed (implemented outside of stNearest and stFastLinear).
  • If somPsColorBurn is specified, Photoshop compatible burn-in color composition is performed (implemented other than stNearest and stFastLinear).
  • If omPsLighten is specified, Photoshop compatible comparison (bright) compositing is done (implemented outside of stNearest and stFastLinear).
  • If omPsDarken is specified, Photoshop compatible comparison (dark) compositing is done (implemented outside of stNearest and stFastLinear).
  • If omPsDifference is specified, Photoshop compatible absolute difference composition is done (implemented outside of stNearest and stFastLinear).
  • If omPsDifference5 is specified, absolute value composition of the difference compatible with Photoshop version 5.x and below is performed (implemented other than stNearest and stFastLinear).
  • If omPsExclusion is specified, Photoshop compatible exclusion composition is performed (implemented other than stNearest and stFastLinear).
  • If omAdditive is specified, additive synthesis is performed (implemented outside of stNearest and stFastLinear).
  • If omSubtractive is specified, subtractive synthesis will be performed (implemented outside of stNearest and stFastLinear).
  • If omMultiplicative is specified, multiplication composition is performed (implemented other than stNearest and stFastLinear).
  • If omDodge is specified, dodging compositing is done (implemented outside of stNearest and stFastLinear).
  • If omDarken is specified, comparison (dark) compositing is done (implemented outside of stNearest and stFastLinear).
  • If omLighten is specified, comparison (bright) compositing is done (implemented outside of stNearest and stFastLinear).
  • If omScreen is specified, screen multiplication composition is performed (implemented other than stNearest and stFastLinear).
  • If omAlpha is specified, alpha synthesis will occur.
  • If omAddAlpha is specified, additive alpha composition is done. In this case, when the destination Layer.face property is dfOpaque and the Layer.holdAlpha property is false, linear interpolation is possible by specifying stFastLinear in the type argument.
  • If omOpaque is specified, the alpha information in src is ignored and src is always considered completely opaque. In this case, when the destination Layer.face property is dfOpaque and the Layer.holdAlpha property is false, linear interpolation is possible by specifying stFastLinear in the type argument.
opa

Specifies the intensity of the operation (0 to 255).

type

Specifies the scale type.

  • stNearest : Nearest point method is used
  • stFastLinear : Low precision linear interpolation is used (partially implemented)
  • stSemiFastLinear : Fixed decimal linear interpolation is used (1.3+)
  • stLinear : Linear interpolation is used (implementation changed after 1.3)
  • stFastCubic : Fixed decimal 3D interpolation is used (1.3 or later)
  • stCubic : 3D interpolation is used (implementation changed after 1.3)
  • stFastLanczos2 : Fixed decimal Lanczos interpolation range 4x4 is used (1.3+)
  • stLanczos2 : Lanczos interpolation range 4x4 is used (1.3 and above)
  • stFastLanczos3 : Fixed decimal Lanczos interpolation range 6x6 is used (1.3 and above)
  • stLanczos3 : Lanczos interpolation range 6x6 is used (1.3 and above)
  • stFastSpline16 : Fixed decimal spline interpolation 4x4 is used (1.3+)
  • stSpline16 : Spline interpolation 4x4 is used (1.3+)
  • stFastSpline36 : Fixed decimal spline interpolation 6x6 is used (1.3+)
  • stSpline36 : Spline interpolation 6x6 is used (1.3+)
  • stFastAreaAvg : Fixed decimal area mean reduction is used. Cannot be expanded (1.3 or later)
  • stAreaAvg : Area average reduction is used. Cannot be expanded (1.3 or later)
  • stFastGaussian : Fixed decimal Gaussian interpolation 4x4 is used (1.3+)
  • stGaussian : Gaussian interpolation 4x4 is used (1.3 or later)
  • stFastBlackmanSinc : Fixed decimal Blackman-Sinc interpolation 8x8 is used (1.3+)
  • stBlackmanSinc : Blackman-Sinc interpolation 8x8 is used (1.3+)

The speed is faster in the order of stNearest> stFastLinear> stLinear> stCubic, but the faster the speed, the lower the image quality.
The interpolation method after stCubic has sufficiently high image quality and can be said to be a difference in taste.
However, the image quality will be blurry for Gaussian interpolation. The difference between stFastLinear and other linear interpolations (stSemiFastLinear and stLinear) is large when shrinking.
While stFastLinear always refers to the surrounding 4 pixels, stSemiFastLinear and stLinear refer to and interpolate a range in which the influence range at 1x magnification is 4 pixels at the time of reduction, that is, a wider range of pixels. Higher image quality (algorithm is the original linear interpolation).
For stFastLinear, 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.
If this is not specified, the out-of-range color will not refer to the closest pixel in the range, even if there is room around the source bitmap. It is considered a color).

option

Sharpness during 3D interpolation.
It currently has no meaning with other interpolation methods.
Increasing the sharpness value in the positive direction will make it blurry, and increasing it in the negative direction will make it sharper.

Return value
None (void)
Explanation

Computes the rectangle of the specified overlay source layer to the rectangle of the overlay destination (layer that executes the method).
If the size of the overlay source rectangle and the overlay destination rectangle are different, enlargement or reduction is performed.
If omAuto is specified for mode, the operation type is automatically determined according to the Layer.type property of the operation source layer.