summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2012-07-10 15:38:09 -0700
committerStephen Hines <srhines@google.com>2012-07-10 15:38:09 -0700
commit411f5996bccf88d5d2f8d1f003d39a8d76365244 (patch)
tree839678a2021c7aa9da8ee9df0fab8ec8408abc8c
parentcd919a177f2b25af1b304dd4d79f0a768fed342f (diff)
downloadrs-411f5996bccf88d5d2f8d1f003d39a8d76365244.tar.gz
Switch row/col to x/y in order to improve clarity.
RS matrices use column major ordering. The previous parameter names made this very confusing to users of the API. Change-Id: I1f3a53c4a7563416933acef4260b33d87468308e
-rw-r--r--rsMatrix2x2.h20
-rw-r--r--rsMatrix3x3.h20
-rw-r--r--rsMatrix4x4.h19
3 files changed, 18 insertions, 41 deletions
diff --git a/rsMatrix2x2.h b/rsMatrix2x2.h
index 4dcb84a0..4fbd1c2a 100644
--- a/rsMatrix2x2.h
+++ b/rsMatrix2x2.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@ namespace android {
namespace renderscript {
struct Matrix2x2 : public rs_matrix2x2 {
- inline float get(uint32_t row, uint32_t col) const {
- return m[row*2 + col];
+ inline float get(uint32_t x, uint32_t y) const {
+ return m[x*2 + y];
}
- inline void set(uint32_t row, uint32_t col, float v) {
- m[row*2 + col] = v;
+ inline void set(uint32_t x, uint32_t y, float v) {
+ m[x*2 + y] = v;
}
void loadIdentity();
@@ -51,12 +51,4 @@ struct Matrix2x2 : public rs_matrix2x2 {
}
}
-
-
-
-#endif
-
-
-
-
-
+#endif // ANDROID_RS_MATRIX_2x2_H
diff --git a/rsMatrix3x3.h b/rsMatrix3x3.h
index f96d2703..05249b15 100644
--- a/rsMatrix3x3.h
+++ b/rsMatrix3x3.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2011-2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@ namespace android {
namespace renderscript {
struct Matrix3x3 : public rs_matrix3x3 {
- inline float get(uint32_t row, uint32_t col) const {
- return m[row*3 + col];
+ inline float get(uint32_t x, uint32_t y) const {
+ return m[x*3 + y];
}
- inline void set(uint32_t row, uint32_t col, float v) {
- m[row*3 + col] = v;
+ inline void set(uint32_t x, uint32_t y, float v) {
+ m[x*3 + y] = v;
}
void loadIdentity();
@@ -51,12 +51,4 @@ struct Matrix3x3 : public rs_matrix3x3 {
}
}
-
-
-
-#endif
-
-
-
-
-
+#endif // ANDROID_RS_MATRIX_3x3_H
diff --git a/rsMatrix4x4.h b/rsMatrix4x4.h
index d30184f6..44c33d1d 100644
--- a/rsMatrix4x4.h
+++ b/rsMatrix4x4.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 The Android Open Source Project
+ * Copyright (C) 2009-2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@ namespace android {
namespace renderscript {
struct Matrix4x4 : public rs_matrix4x4 {
- float get(uint32_t row, uint32_t col) const {
- return m[row*4 + col];
+ float get(uint32_t x, uint32_t y) const {
+ return m[x*4 + y];
}
- void set(uint32_t row, uint32_t col, float v) {
- m[row*4 + col] = v;
+ void set(uint32_t x, uint32_t y, float v) {
+ m[x*4 + y] = v;
}
void loadIdentity();
@@ -82,11 +82,4 @@ struct Matrix4x4 : public rs_matrix4x4 {
}
}
-
-
-
-#endif
-
-
-
-
+#endif // ANDROID_RS_MATRIX_4x4_H