diff options
Diffstat (limited to 'ftnoir_posewidget')
-rw-r--r-- | ftnoir_posewidget/glwidget.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ftnoir_posewidget/glwidget.cpp b/ftnoir_posewidget/glwidget.cpp index 590edbc6..ab8bede1 100644 --- a/ftnoir_posewidget/glwidget.cpp +++ b/ftnoir_posewidget/glwidget.cpp @@ -186,20 +186,20 @@ void GLWidget::project_quad_texture() { int qx2 = std::min<int>(ow - 1, std::max<int>(0, qx + 1.0)); int qy2 = std::min<int>(oh - 1, std::max<int>(0, qy + 1.0)); - double r = (4 * (double) orig[qy1 * orig_pitch + qx1 * orig_depth + 2] - + 1 * (double) orig[qy2 * orig_pitch + qx2 * orig_depth + 2] - + 2 * (double) orig[qy1 * orig_pitch + qx2 * orig_depth + 2] - + 2 * (double) orig[qy2 * orig_pitch + qx1 * orig_depth + 2]) / 9; + int r = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 2] + + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 2] + + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 2] + + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 2]) / 9; - double g = (4 * (double) orig[qy1 * orig_pitch + qx1 * orig_depth + 1] - + 1 * (double) orig[qy2 * orig_pitch + qx2 * orig_depth + 1] - + 2 * (double) orig[qy1 * orig_pitch + qx2 * orig_depth + 1] - + 2 * (double) orig[qy2 * orig_pitch + qx1 * orig_depth + 1]) / 9; + int g = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 1] + + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 1] + + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 1] + + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 1]) / 9; - double b = (4 * (double) orig[qy1 * orig_pitch + qx1 * orig_depth + 0] - + 1 * (double) orig[qy2 * orig_pitch + qx2 * orig_depth + 0] - + 2 * (double) orig[qy1 * orig_pitch + qx2 * orig_depth + 0] - + 2 * (double) orig[qy2 * orig_pitch + qx1 * orig_depth + 0]) / 9; + int b = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 0] + + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 0] + + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 0] + + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 0]) / 9; dest[y * dest_pitch + x * dest_depth + 0] = std::max<int>(0, std::min<int>(255, r)); dest[y * dest_pitch + x * dest_depth + 1] = std::max<int>(0, std::min<int>(255, g)); |