/******* Rotate *******/ func (img *Image) RotateTo(dest *Image, angle float64) { dest.InitializeAs(img) center := C.CvPoint2D32f{C.float(img.Size().Width / 2), C.float(img.Size().Height / 2)} var rot *C.CvMat = C.cvCreateMat(2, 3, C.CV_32F) defer C.cvReleaseMat(&rot) C.cv2DRotationMatrix(center, C.double(angle), C.double(1.0), rot) C.cvWarpAffine(img.ptr, dest.ptr, rot, C.CV_INTER_LINEAR+C.CV_WARP_FILL_OUTLIERS, C.cvScalarAll(C.double(0.0))) }
func ScalarAll(val0 float64) Scalar { rv := C.cvScalarAll(C.double(val0)) return (Scalar)(rv) }