setRectToRect method

bool setRectToRect(
  1. Rect src,
  2. Rect dst,
  3. ScaleToFit scaleToFit
)

Sets Matrix to scale and translate src Rect to dst Rect. stf selects whether mapping completely fills dst or preserves the aspect ratio, and how to align src within dst. Returns false if src is empty, and sets Matrix to identity. Returns true if dst is empty, and sets Matrix to:

| 0 0 0 |
| 0 0 0 |
| 0 0 1 |

@param src Rect to map from @param dst Rect to map to @param stf one of: kFill_ScaleToFit, kStart_ScaleToFit, kCenter_ScaleToFit, kEnd_ScaleToFit @return true if Matrix can represent Rect mapping

Implementation

bool setRectToRect(Rect src, Rect dst, ScaleToFit scaleToFit) =>
    c.mnn_cv_matrix_set_rect_to_rect(ptr, src.ref, dst.ref, scaleToFit.value);