SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) {
    SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect());
    SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect());
    if (pe0 && pe1) {
        return SkComposePathEffect::Create(pe0, pe1);
    } else {
        return nullptr;
    }
}
Example #2
0
void PathPlanner::drawPath(std::vector<Eigen::Vector3f> & path, cv::Mat3b & image)
{
    if(path.size() != 0)
    {
        for(size_t i = 1; i < path.size(); i++)
        {
            cv::Point2i p0, p1;
            Eigen::Vector2i pe0 = worldToImg(path.at(i - 1));
            Eigen::Vector2i pe1 = worldToImg(path.at(i));

            p0.x = pe0(0);
            p0.y = pe0(1);

            p1.x = pe1(0);
            p1.y = pe1(1);

            cv::line(image, p0, p1, CV_RGB(0, 255, 0), 2);
        }

        for(size_t i = 1; i < path.size(); i++)
        {
            cv::Point2i p0, p1;
            Eigen::Vector2i pe0 = worldToImg(path.at(i - 1));
            Eigen::Vector2i pe1 = worldToImg(path.at(i));

            p0.x = pe0(0);
            p0.y = pe0(1);

            p1.x = pe1(0);
            p1.y = pe1(1);

            cv::circle(image, p0, 4, CV_RGB(0, 0, 255), 2);

            cv::circle(image, p1, 4, CV_RGB(0, 0, 255), 2);
        }
    }
}