initial commit

This commit is contained in:
Tzu-Mao Li
2020-09-03 22:30:30 -04:00
commit 413a3e5cee
148 changed files with 138536 additions and 0 deletions

25
color.cpp Normal file
View File

@@ -0,0 +1,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];
}
}