merge from open-source master
This commit is contained in:
@@ -110,22 +110,31 @@ public class ColorMatrix {
|
|||||||
a[18] = aScale;
|
a[18] = aScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the rotation on a color axis by the specified values.
|
||||||
|
* axis=0 correspond to a rotation around the RED color
|
||||||
|
* axis=1 correspond to a rotation around the GREEN color
|
||||||
|
* axis=2 correspond to a rotation around the BLUE color
|
||||||
|
*/
|
||||||
public void setRotate(int axis, float degrees) {
|
public void setRotate(int axis, float degrees) {
|
||||||
reset();
|
reset();
|
||||||
float radians = degrees * (float)Math.PI / 180;
|
float radians = degrees * (float)Math.PI / 180;
|
||||||
float cosine = FloatMath.cos(radians);
|
float cosine = FloatMath.cos(radians);
|
||||||
float sine = FloatMath.sin(radians);
|
float sine = FloatMath.sin(radians);
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
|
// Rotation around the red color
|
||||||
case 0:
|
case 0:
|
||||||
mArray[6] = mArray[12] = cosine;
|
mArray[6] = mArray[12] = cosine;
|
||||||
mArray[7] = sine;
|
mArray[7] = sine;
|
||||||
mArray[11] = -sine;
|
mArray[11] = -sine;
|
||||||
break;
|
break;
|
||||||
|
// Rotation around the green color
|
||||||
case 1:
|
case 1:
|
||||||
mArray[0] = mArray[17] = cosine;
|
mArray[0] = mArray[12] = cosine;
|
||||||
mArray[2] = sine;
|
mArray[2] = -sine;
|
||||||
mArray[15] = -sine;
|
mArray[10] = sine;
|
||||||
break;
|
break;
|
||||||
|
// Rotation around the blue color
|
||||||
case 2:
|
case 2:
|
||||||
mArray[0] = mArray[6] = cosine;
|
mArray[0] = mArray[6] = cosine;
|
||||||
mArray[1] = sine;
|
mArray[1] = sine;
|
||||||
|
|||||||
@@ -1315,7 +1315,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return null if the provider does not exits
|
* @return null if the provider does not exits
|
||||||
* @throw SecurityException if the provider is not allowed to be
|
* @throws SecurityException if the provider is not allowed to be
|
||||||
* accessed by the caller
|
* accessed by the caller
|
||||||
*/
|
*/
|
||||||
public Bundle getProviderInfo(String provider) {
|
public Bundle getProviderInfo(String provider) {
|
||||||
|
|||||||
Reference in New Issue
Block a user