diff options
author | Jason Gerecke <killertofu@gmail.com> | 2012-05-10 14:22:47 -0700 |
---|---|---|
committer | Michael Wright <michaelwr@google.com> | 2014-03-10 14:23:57 -0700 |
commit | af126fb538c39d5488d62695b1bfb2990a3ef7db (patch) | |
tree | 39abce5667eb70c5527f6d946efc58a9e5f994fc /services/inputflinger/InputReader.h | |
parent | 544b09523b791935ffe9aa64d1f20335f7e2dc78 (diff) | |
download | frameworks_native-af126fb538c39d5488d62695b1bfb2990a3ef7db.zip frameworks_native-af126fb538c39d5488d62695b1bfb2990a3ef7db.tar.gz frameworks_native-af126fb538c39d5488d62695b1bfb2990a3ef7db.tar.bz2 |
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
Diffstat (limited to 'services/inputflinger/InputReader.h')
-rw-r--r-- | services/inputflinger/InputReader.h | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ private: }; +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 @@ protected: } } mCalibration; + // Affine location transformation/calibration + struct TouchAffineTransformation mAffineTransform; + // Raw pointer axis information from the driver. RawPointerAxes mRawPointerAxes; @@ -1344,6 +1364,7 @@ protected: 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; |