preScale method

void preScale(
  1. double sx,
  2. double sy, {
  3. double px = 0,
  4. double py = 0,
})

Sets Matrix to Matrix multiplied by Matrix constructed from scaling by (sx, sy) about pivot point (px, py). This can be thought of as scaling about a pivot point before applying Matrix.

Given:

         | A B C |                       | sx  0 dx |
Matrix = | D E F |,  S(sx, sy, px, py) = |  0 sy dy |
         | G H I |                       |  0  0  1 |

where

dx = px - sx * px
dy = py - sy * py

sets Matrix to:

                             | A B C | | sx  0 dx |   | A*sx B*sy A*dx+B*dy+C |
Matrix * S(sx, sy, px, py) = | D E F | |  0 sy dy | = | D*sx E*sy D*dx+E*dy+F |
                             | G H I | |  0  0  1 |   | G*sx H*sy G*dx+H*dy+I |

@param sx horizontal scale factor @param sy vertical scale factor @param px pivot x @param py pivot y

Implementation

void preScale(double sx, double sy, {double px = 0, double py = 0}) =>
    c.mnn_cv_matrix_pre_scale(ptr, sx, sy, px, py);