Introduce mAffineCalibration for location calibration
The variable mAffineCalibration describes the affine transformation
that should be applied to the raw X/Y location in order to get it
into a calibrated state.
Change-Id: I68aa43420ffe7fcaa1ada4acd7390d37e6966a1f
diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h
index 36b206a..5c72c71 100644
--- a/services/inputflinger/InputReader.h
+++ b/services/inputflinger/InputReader.h
@@ -252,6 +252,23 @@
};
+struct TouchAffineTransformation {
+ float x_scale;
+ float x_ymix;
+ float x_offset;
+ float y_xmix;
+ float y_scale;
+ float y_offset;
+
+ TouchAffineTransformation() :
+ x_scale(1.0f), x_ymix(0.0f), x_offset(0.0f),
+ y_xmix(0.0f), y_scale(1.0f), y_offset(0.0f) {
+ }
+
+ void applyTo(float& x, float& y) const;
+};
+
+
/*
* Input reader policy interface.
*
@@ -1295,6 +1312,9 @@
}
} mCalibration;
+ // Affine location transformation/calibration
+ struct TouchAffineTransformation mAffineTransform;
+
// Raw pointer axis information from the driver.
RawPointerAxes mRawPointerAxes;
@@ -1344,6 +1364,7 @@
virtual void parseCalibration();
virtual void resolveCalibration();
virtual void dumpCalibration(String8& dump);
+ virtual void dumpAffineTransformation(String8& dump);
virtual bool hasStylus() const = 0;
virtual void syncTouch(nsecs_t when, bool* outHavePointerIds) = 0;