| 65 | } |
| 66 | |
| 67 | cv::Mat merge(const cv::Mat& rgb, const cv::Mat& alpha) |
| 68 | { |
| 69 | assert(rgb.depth() == alpha.depth()); |
| 70 | assert(rgb.channels() == 3 && alpha.channels() == 1); |
| 71 | |
| 72 | #if 1 |
| 73 | cv::Mat r_g_b_a[3]; |
| 74 | cv::split(rgb, r_g_b_a); |
| 75 | r_g_b_a[3] = alpha; |
| 76 | |
| 77 | cv::Mat result; |
| 78 | cv::merge(r_g_b_a, 4, result); |
| 79 | #else |
| 80 | // TODO maybe we can direct merge RGB and A??? |
| 81 | cv::Mat result(rgb.size(), CV_MAKETYPE(rgb.depth(), 4)); |
| 82 | for() |
| 83 | rgb.elemSize(); |
| 84 | #endif |
| 85 | |
| 86 | return result; |
| 87 | } |
| 88 | |
| 89 | void line(Mat& image, const Point2f& pt0, const Point2f& pt1, const Scalar& color, |
| 90 | int thickness/* = 1*/, int lineType/* = cv::LINE_8*/, int shift/* = 0*/) |
nothing calls this directly
no outgoing calls
no test coverage detected