Team Ai
Apppublic

CVPR/LIVE

sourceHugging Facegpl-3.0updated 4y agoView on Hugging Face
34likes
shape.cpp23 linesDownload Raw Back to root
1#include "shape.h"2 3void Path::copy_to(ptr<float> points, ptr<float> thickness) const {4    float *p = points.get();5    for (int i = 0; i < 2 * num_points; i++) {6        p[i] = this->points[i];7    }8    if (this->thickness != nullptr) {9        float *t = thickness.get();10        for (int i = 0; i < num_points; i++) {11            t[i] = this->thickness[i];12        }13    }14}15 16void ShapeGroup::copy_to(ptr<float> shape_to_canvas) const {17    for (int i = 0; i < 3; i++) {18        for (int j = 0; j < 3; j++) {19            shape_to_canvas.get()[i * 3 + j] = this->shape_to_canvas(i, j);20        }21    }22}23