/frameworks/base/graphics/java/android/graphics/ |
AvoidXfermode.java | 42 * There are two modes, and each mode interprets a tolerance value. 46 * Tolerance near 0: avoid any colors even remotely similar to the op-color 47 * Tolerance near 255: avoid only colors nearly identical to the op-color 51 * Tolerance near 0: draw only on colors that are nearly identical to the op-color 52 * Tolerance near 255: draw on any colors even remotely similar to the op-color 54 public AvoidXfermode(int opColor, int tolerance, Mode mode) { 55 if (tolerance < 0 || tolerance > 255) { 56 throw new IllegalArgumentException("tolerance must be 0..255");
|
/cts/common/device-side/util/src/com/android/compatibility/common/util/ |
ColorUtils.java | 29 public static void verifyColor(int expected, int observed, int tolerance) { 32 + ", tolerated channel error " + tolerance; 33 assertEquals(s, Color.red(expected), Color.red(observed), tolerance); 34 assertEquals(s, Color.green(expected), Color.green(observed), tolerance); 35 assertEquals(s, Color.blue(expected), Color.blue(observed), tolerance); 36 assertEquals(s, Color.alpha(expected), Color.alpha(observed), tolerance);
|
/external/chromium-trace/catapult/telemetry/telemetry/util/ |
rgba_color.py | 15 def IsEqual(self, expected_color, tolerance=0): 16 """Verifies that the color is within a given tolerance of 22 return (r_diff <= tolerance and g_diff <= tolerance 23 and b_diff <= tolerance and a_diff <= tolerance) 25 def AssertIsRGB(self, r, g, b, tolerance=0): 26 assert self.IsEqual(RgbaColor(r, g, b), tolerance) 28 def AssertIsRGBA(self, r, g, b, a, tolerance=0): 29 assert self.IsEqual(RgbaColor(r, g, b, a), tolerance) [all...] |
image_util.py | 84 def AreEqual(image1, image2, tolerance=0, likely_equal=True): 85 """Determines whether two images are identical within a given tolerance. 89 return impl.AreEqual(image1, image2, tolerance, likely_equal) 96 def GetBoundingBox(image, color, tolerance=0): 103 tolerance: int, per-channel tolerance for the bounding box color. 107 return impl.GetBoundingBox(image, color, tolerance) 113 def GetColorHistogram(image, ignore_color=None, tolerance=0): 117 tolerance: A tolerance for the ignore_color [all...] |
/external/chromium-trace/catapult/telemetry/telemetry/internal/image_processing/ |
image_util_bitmap_impl.py | 37 def AreEqual(bitmap1, bitmap2, tolerance, _): 38 return bitmap1.IsEqual(bitmap2, tolerance) 43 def GetBoundingBox(bitmap, color, tolerance): 44 return bitmap.GetBoundingBox(color, tolerance) 49 def GetColorHistogram(bitmap, ignore_color, tolerance): 50 return bitmap.ColorHistogram(ignore_color, tolerance)
|
cv_util.py | 13 def AreLinesOrthogonal(line1, line2, tolerance): 14 """Returns true if lines are within tolerance radians of being orthogonal.""" 23 # If the difference between the angles is more than pi/2 - tolerance, the 25 return not abs(angle2 - (np.pi / 2.0)) > tolerance 69 def IsPointApproxOnLine(point, line, tolerance=1): 71 the determinant and checks whether it's within the tolerance. Tolerance is 76 tolerance = float(tolerance) * (abs(xd) + abs(yd)) 77 return abs(det) * 2.0 <= tolerance [all...] |
bitmaptools.cc | 153 int tolerance) { 155 return (abs(pixel1[0] - pixel2[0]) <= tolerance) && 156 (abs(pixel1[1] - pixel2[1]) <= tolerance) && 157 (abs(pixel1[2] - pixel2[2]) <= tolerance); 162 bool PixelsEqual(const unsigned char* pixel, int color, int tolerance) { 164 return PixelsEqual(pixel, pixel2, tolerance); 171 int tolerance; local 172 if (!(ReadInt(&ignore_color) && ReadInt(&tolerance))) { 184 if (ignore_color >= 0 && PixelsEqual(pixel, ignore_color, tolerance)) 200 int tolerance; local [all...] |
image_util_numpy_impl.py | 83 def AreEqual(image1, image2, tolerance, likely_equal): 88 if tolerance: 90 return np.amax(_SimpleDiff(image1, image2)) <= tolerance 93 if np.amax(_SimpleDiff(image1[row], image2[row])) > tolerance: 119 def GetBoundingBox(image, color, tolerance): 122 img = cv2.inRange(image, np.subtract(color[0:3], tolerance), 123 np.add(color[0:3], tolerance)) 131 if tolerance: 133 colorm = color - tolerance 134 colorp = color + tolerance [all...] |
/frameworks/native/libs/vr/libdvrcommon/include/private/dvr/test/ |
test_macros.h | 16 const A& expected, const B& actual, const T& tolerance) { 18 if (!IsEqual(expected[i], actual[i], tolerance)) { 21 << "\" differ at element " << i << " by at least " << tolerance 34 const A& expected, const B& actual, const T& tolerance) { 37 if (!IsEqual(expected(r, c), actual(r, c), tolerance)) { 41 << " by at least " << tolerance << " : " 54 const A& expected, const B& actual, const T& tolerance) { 56 if (!IsEqual(expected[i], actual[i], tolerance)) { 64 << "\" by at least " << tolerance << "."; local 72 const A& expected, const B& actual, const T& tolerance) { 84 << "\\" by at least " << tolerance << "."; local [all...] |
/cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapverifiers/ |
RectVerifier.java | 32 public RectVerifier(int outerColor, int innerColor, Rect innerRect, int tolerance) { 33 super(tolerance);
|
/external/skia/src/gpu/ |
GrTessellator.h | 45 int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds, 48 int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBounds,
|
/frameworks/base/legacy-test/src/android/test/ |
FlakyTest.java | 27 * the test fails. The total number of executions is specified by the tolerance and 41 * as a failed test. If the tolerance factor is less than 1, the test runs 46 int tolerance() default 1;
|
/frameworks/base/media/java/android/media/ |
SyncParams.java | 52 * <p> <strong>tolerance:</strong> specifies the amount of allowed playback rate 73 * surface that directly renders to a display, and tolerance is non zero (e.g. not 99 * When using this mode, the tolerance should be set to greater than 0 (e.g. at least 104 * better playback experience on most devices. In this case the tolerance should be 230 * Sets the tolerance. The default tolerance is platform specific, but is never more than 1/24. 231 * @param tolerance A non-negative number representing 235 * @throws InvalidArgumentException if the tolerance is negative, or not less than one 237 public SyncParams setTolerance(float tolerance) { 238 if (tolerance < 0.f || tolerance >= 1.f) [all...] |
/external/guava/guava-gwt/src-super/com/google/common/math/super/com/google/common/math/ |
DoubleMath.java | 112 * Returns {@code true} if {@code a} and {@code b} are within {@code tolerance} of each other. 115 * {@code Math.abs(a - b) <= tolerance || Double.valueOf(a).equals(Double.valueOf(b))}. 122 * <li>If {@code tolerance} is zero, and neither {@code a} nor {@code b} is NaN, then 124 * <li>With {@link Double#POSITIVE_INFINITY} tolerance, all non-NaN values are fuzzily equal. 125 * <li>With finite tolerance, {@code Double.POSITIVE_INFINITY} and {@code 133 * @throws IllegalArgumentException if {@code tolerance} is {@code < 0} or NaN 136 public static boolean fuzzyEquals(double a, double b, double tolerance) { 137 MathPreconditions.checkNonNegative("tolerance", tolerance); 139 Math.copySign(a - b, 1.0) <= tolerance [all...] |
/external/eigen/Eigen/src/SparseCore/ |
SparseSparseProductWithPruning.h | 20 static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res, const typename ResultType::RealScalar& tolerance) 73 for (typename AmbiVector<Scalar,StorageIndex>::Iterator it(tempVector,tolerance); it; ++it) 91 static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) 94 internal::sparse_sparse_product_with_pruning_impl<Lhs,Rhs,ResultType>(lhs, rhs, _res, tolerance); 103 static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) 108 internal::sparse_sparse_product_with_pruning_impl<Lhs,Rhs,SparseTemporaryType>(lhs, rhs, _res, tolerance); 117 static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) 121 internal::sparse_sparse_product_with_pruning_impl<Rhs,Lhs,ResultType>(rhs, lhs, _res, tolerance); 130 static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) 136 internal::sparse_sparse_product_with_pruning_impl<ColMajorMatrixLhs,ColMajorMatrixRhs,ResultType>(colLhs, colRhs, res, tolerance); [all...] |
/art/test/406-fields/src/ |
TestCase.java | 141 float tolerance) { 142 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 144 " tolerance " + tolerance); 162 double tolerance) { 163 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 165 " tolerance " + tolerance); [all...] |
/art/test/407-arrays/src/ |
TestCase.java | 141 float tolerance) { 142 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 144 " tolerance " + tolerance); 162 double tolerance) { 163 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 165 " tolerance " + tolerance); [all...] |
/art/test/412-new-array/src/ |
TestCase.java | 141 float tolerance) { 142 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 144 " tolerance " + tolerance); 162 double tolerance) { 163 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 165 " tolerance " + tolerance); [all...] |
/art/test/414-static-fields/src/ |
TestCase.java | 141 float tolerance) { 142 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 144 " tolerance " + tolerance); 162 double tolerance) { 163 if ((actual < expected - tolerance) || (expected + tolerance < actual)) { 165 " tolerance " + tolerance); [all...] |
/cts/tests/tests/renderscript/src/android/renderscript/cts/ |
float16_gen.c | 121 // Compute ULP for 'value' and store value +/- tolerance * ULP in bounds sarray 122 void getErrorBar(unsigned short value, int tolerance, unsigned short bounds[2]) { 123 // Validate 'tolerance' parameter 124 if (tolerance != 1 && tolerance != 3) { 126 tolerance); 159 // Compute error bar based on error tolerance 160 half lb = hValue - tolerance * ulp; 161 half ub = hValue + tolerance * ulp; 226 int tolerance) { [all...] |
/cts/tests/tests/media/src/android/media/cts/ |
FaceDetector_FaceTest.java | 57 float tolerance = 5f; local 61 assertEquals(eyesDistance, face.eyesDistance(), tolerance); 64 assertEquals(eyesMidpointX, eyesMP.x, tolerance); 65 assertEquals(eyesMidpointY, eyesMP.y, tolerance);
|
/frameworks/native/libs/vr/libdvrcommon/tests/ |
pose_test.cpp | 29 const auto tolerance = FT(0.0001); local 39 EXPECT_MAT4_NEAR(result_pose, mat4_t::Identity(), tolerance); 48 const auto tolerance = FT(0.0001); local 62 EXPECT_VEC3_NEAR(expected_transformed, actual_transformed, tolerance); 72 const auto tolerance = FT(0.0001); local 86 EXPECT_VEC3_NEAR(expected_rotated, actual_rotated, tolerance); 96 const auto tolerance = FT(0.0001); local 117 EXPECT_VEC3_NEAR(expected_transformed, actual_transformed, tolerance); 127 const auto tolerance = FT(0.0001); local 141 EXPECT_VEC3_NEAR(start_position, inverted, tolerance); 150 tolerance); local 152 tolerance); local [all...] |
/hardware/interfaces/automotive/vehicle/2.0/default/tests/ |
RecurrentTimer_test.cpp | 28 #define ASSERT_EQ_WITH_TOLERANCE(val1, val2, tolerance) \ 29 ASSERT_LE(val1 - tolerance, val2); \ 30 ASSERT_GE(val1 + tolerance, val2); \
|
/external/skia/tests/ |
ColorMatrixTest.cpp | 19 SkColor expected, SkColor actual, int tolerance) { 20 REPORTER_ASSERT(reporter, abs((int)(SkColorGetA(expected) - SkColorGetA(actual))) <= tolerance); 21 REPORTER_ASSERT(reporter, abs((int)(SkColorGetR(expected) - SkColorGetR(actual))) <= tolerance); 22 REPORTER_ASSERT(reporter, abs((int)(SkColorGetG(expected) - SkColorGetG(actual))) <= tolerance); 23 REPORTER_ASSERT(reporter, abs((int)(SkColorGetB(expected) - SkColorGetB(actual))) <= tolerance); 27 const int TOLERANCE = 1; 28 assert_color(reporter, expected, actual, TOLERANCE);
|
/external/droiddriver/src/io/appium/droiddriver/helpers/ |
BaseDroidDriverTest.java | 232 int tolerance = 1; local 234 tolerance = method.getAnnotation(FlakyTest.class).tolerance(); 237 for (int runCount = 0; runCount < tolerance; runCount++) { 239 Logs.logfmt(Log.INFO, "Running %s round %d of %d attempts", fName, runCount + 1, tolerance); 251 if (shouldSkipRemainingTests(exception) || runCount >= tolerance - 1) {
|