forked from BachiLi/diffvg
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcolor.cpp
More file actions
25 lines (23 loc) · 743 Bytes
/
color.cpp
File metadata and controls
25 lines (23 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "color.h"
void LinearGradient::copy_to(ptr<float> stop_offsets,
ptr<float> stop_colors) const {
float *o = stop_offsets.get();
float *c = stop_colors.get();
for (int i = 0; i < num_stops; i++) {
o[i] = this->stop_offsets[i];
}
for (int i = 0; i < 4 * num_stops; i++) {
c[i] = this->stop_colors[i];
}
}
void RadialGradient::copy_to(ptr<float> stop_offsets,
ptr<float> stop_colors) const {
float *o = stop_offsets.get();
float *c = stop_colors.get();
for (int i = 0; i < num_stops; i++) {
o[i] = this->stop_offsets[i];
}
for (int i = 0; i < 4 * num_stops; i++) {
c[i] = this->stop_colors[i];
}
}