From 5296a52fec9288f22aaf6c4a5f8141d8a36014fc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 23 Jan 2014 04:26:03 +0100 Subject: glwidget: don't use doubles for no good reason --- ftnoir_posewidget/glwidget.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'ftnoir_posewidget/glwidget.cpp') 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(ow - 1, std::max(0, qx + 1.0)); int qy2 = std::min(oh - 1, std::max(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(0, std::min(255, r)); dest[y * dest_pitch + x * dest_depth + 1] = std::max(0, std::min(255, g)); -- cgit v1.2.3