mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Removed the x(), y(), z() Point/Pointf/Point3/Pointf3 accessors.
This commit is contained in:
parent
1ba64da3fe
commit
65011f9382
60 changed files with 1083 additions and 1111 deletions
|
@ -608,17 +608,17 @@ int generate_layer_height_texture(
|
|||
coordf_t intensity = cos(M_PI * 0.7 * (mid - z) / h);
|
||||
// Color mapping from layer height to RGB.
|
||||
Pointf3 color(
|
||||
intensity * lerp(coordf_t(color1.x()), coordf_t(color2.x()), t),
|
||||
intensity * lerp(coordf_t(color1.y()), coordf_t(color2.y()), t),
|
||||
intensity * lerp(coordf_t(color1.z()), coordf_t(color2.z()), t));
|
||||
intensity * lerp(coordf_t(color1(0)), coordf_t(color2(0)), t),
|
||||
intensity * lerp(coordf_t(color1(1)), coordf_t(color2(1)), t),
|
||||
intensity * lerp(coordf_t(color1(2)), coordf_t(color2(2)), t));
|
||||
int row = cell / (cols - 1);
|
||||
int col = cell - row * (cols - 1);
|
||||
assert(row >= 0 && row < rows);
|
||||
assert(col >= 0 && col < cols);
|
||||
unsigned char *ptr = (unsigned char*)data + (row * cols + col) * 4;
|
||||
ptr[0] = (unsigned char)clamp<int>(0, 255, int(floor(color.x() + 0.5)));
|
||||
ptr[1] = (unsigned char)clamp<int>(0, 255, int(floor(color.y() + 0.5)));
|
||||
ptr[2] = (unsigned char)clamp<int>(0, 255, int(floor(color.z() + 0.5)));
|
||||
ptr[0] = (unsigned char)clamp<int>(0, 255, int(floor(color(0) + 0.5)));
|
||||
ptr[1] = (unsigned char)clamp<int>(0, 255, int(floor(color(1) + 0.5)));
|
||||
ptr[2] = (unsigned char)clamp<int>(0, 255, int(floor(color(2) + 0.5)));
|
||||
ptr[3] = 255;
|
||||
if (col == 0 && row > 0) {
|
||||
// Duplicate the first value in a row as a last value of the preceding row.
|
||||
|
@ -640,17 +640,17 @@ int generate_layer_height_texture(
|
|||
const Point3 &color2 = palette_raw[idx2];
|
||||
// Color mapping from layer height to RGB.
|
||||
Pointf3 color(
|
||||
lerp(coordf_t(color1.x()), coordf_t(color2.x()), t),
|
||||
lerp(coordf_t(color1.y()), coordf_t(color2.y()), t),
|
||||
lerp(coordf_t(color1.z()), coordf_t(color2.z()), t));
|
||||
lerp(coordf_t(color1(0)), coordf_t(color2(0)), t),
|
||||
lerp(coordf_t(color1(1)), coordf_t(color2(1)), t),
|
||||
lerp(coordf_t(color1(2)), coordf_t(color2(2)), t));
|
||||
int row = cell / (cols1 - 1);
|
||||
int col = cell - row * (cols1 - 1);
|
||||
assert(row >= 0 && row < rows/2);
|
||||
assert(col >= 0 && col < cols/2);
|
||||
unsigned char *ptr = data1 + (row * cols1 + col) * 4;
|
||||
ptr[0] = (unsigned char)clamp<int>(0, 255, int(floor(color.x() + 0.5)));
|
||||
ptr[1] = (unsigned char)clamp<int>(0, 255, int(floor(color.y() + 0.5)));
|
||||
ptr[2] = (unsigned char)clamp<int>(0, 255, int(floor(color.z() + 0.5)));
|
||||
ptr[0] = (unsigned char)clamp<int>(0, 255, int(floor(color(0) + 0.5)));
|
||||
ptr[1] = (unsigned char)clamp<int>(0, 255, int(floor(color(1) + 0.5)));
|
||||
ptr[2] = (unsigned char)clamp<int>(0, 255, int(floor(color(2) + 0.5)));
|
||||
ptr[3] = 255;
|
||||
if (col == 0 && row > 0) {
|
||||
// Duplicate the first value in a row as a last value of the preceding row.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue