Home
last modified time | relevance | path

Searched full:clamp (Results 1 – 25 of 4539) sorted by relevance

12345678910>>...182

/external/sdv/vsomeip/third_party/boost/algorithm/test/
Dclamp_test.cpp10 #include <boost/algorithm/clamp.hpp>
43 BOOST_CHECK_EQUAL ( 3, ba::clamp ( 3, 1, 10 )); in test_ints()
44 BOOST_CHECK_EQUAL ( 1, ba::clamp ( 1, 1, 10 )); in test_ints()
45 BOOST_CHECK_EQUAL ( 1, ba::clamp ( 0, 1, 10 )); in test_ints()
46 BOOST_CHECK_EQUAL ( 10, ba::clamp ( 10, 1, 10 )); in test_ints()
47 BOOST_CHECK_EQUAL ( 10, ba::clamp ( 11, 1, 10 )); in test_ints()
49 ba::clamp ( 3, 1, 10 ) == 3 in test_ints()
53 BOOST_CHECK_EQUAL ( 3, ba::clamp ( 3, 10, 1, intGreater )); in test_ints()
54 BOOST_CHECK_EQUAL ( 1, ba::clamp ( 1, 10, 1, intGreater )); in test_ints()
55 BOOST_CHECK_EQUAL ( 1, ba::clamp ( 0, 10, 1, intGreater )); in test_ints()
[all …]
/external/skia/src/effects/colorfilters/
DSkMatrixColorFilter.cpp35 SkMatrixColorFilter::SkMatrixColorFilter(const float array[20], Domain domain, Clamp clamp) in SkMatrixColorFilter() argument
36 : fAlphaIsUnchanged(is_alpha_unchanged(array)), fDomain(domain), fClamp(clamp) { in SkMatrixColorFilter()
46 buffer.writeBool(fClamp == Clamp::kYes); in flatten()
56 Clamp clamp = buffer.isVersionLT(SkPicturePriv::kUnclampedMatrixColorFilter) in CreateProc() local
57 ? Clamp::kYes in CreateProc()
58 : (buffer.readBool() ? Clamp::kYes : Clamp::kNo); in CreateProc()
59 // clamp option is ignored for HSL-domain filters in CreateProc()
60 return is_rgba ? SkColorFilters::Matrix(matrix, clamp) : SkColorFilters::HSLAMatrix(matrix); in CreateProc()
73 clamp = fClamp == Clamp::kYes; in appendStages() local
88 if (clamp) { in appendStages()
[all …]
/external/skia/resources/sksl/intrinsics/
DClampInt.sksl14 return (clamp(intValues.x, -100, 100) == expectedA.x &&
15 clamp(intValues.xy, -100, 100) == expectedA.xy &&
16 clamp(intValues.xyz, -100, 100) == expectedA.xyz &&
17 clamp(intValues.xyzw, -100, 100) == expectedA.xyzw &&
18 clamp(constVal.x, -100, 100) == expectedA.x &&
19 clamp(constVal.xy, -100, 100) == expectedA.xy &&
20 clamp(constVal.xyz, -100, 100) == expectedA.xyz &&
21 clamp(constVal.xyzw, -100, 100) == expectedA.xyzw &&
22 clamp(intValues.x, clampLow.x, clampHigh.x ) == expectedB.x &&
23 clamp(intValues.xy, clampLow.xy, clampHigh.xy ) == expectedB.xy &&
[all …]
DClampFloat.sksl12 return (clamp(testInputs.x, -1, 1) == expectedA.x &&
13 clamp(testInputs.xy, -1, 1) == expectedA.xy &&
14 clamp(testInputs.xyz, -1, 1) == expectedA.xyz &&
15 clamp(testInputs.xyzw, -1, 1) == expectedA.xyzw &&
16 clamp(testInputs.x, clampLow.x, clampHigh.x ) == expectedB.x &&
17 clamp(testInputs.xy, clampLow.xy, clampHigh.xy ) == expectedB.xy &&
18 clamp(testInputs.xyz, clampLow.xyz, clampHigh.xyz ) == expectedB.xyz &&
19 clamp(testInputs.xyzw, clampLow.xyzw, clampHigh.xyzw) == expectedB.xyzw &&
20 clamp(constVal.x, -1, 1) == expectedA.x &&
21 clamp(constVal.xy, -1, 1) == expectedA.xy &&
[all …]
DClampUInt.sksl14 return (clamp(uintValues.x, 100, 300) == expectedA.x &&
15 clamp(uintValues.xy, 100, 300) == expectedA.xy &&
16 clamp(uintValues.xyz, 100, 300) == expectedA.xyz &&
17 clamp(uintValues.xyzw, 100, 300) == expectedA.xyzw &&
18 clamp(constVal.x, 100, 300) == expectedA.x &&
19 clamp(constVal.xy, 100, 300) == expectedA.xy &&
20 clamp(constVal.xyz, 100, 300) == expectedA.xyz &&
21 clamp(constVal.xyzw, 100, 300) == expectedA.xyzw &&
22 clamp(uintValues.x, clampLow.x, clampHigh.x ) == expectedB.x &&
23 clamp(uintValues.xy, clampLow.xy, clampHigh.xy ) == expectedB.xy &&
[all …]
/external/cronet/tot/base/android/junit/src/org/chromium/base/
DMathUtilsTest.java20 private static final String CLAMP_FAILURE = "Failure to correctly clamp value to range.";
37 Assert.assertEquals(CLAMP_FAILURE, 4, MathUtils.clamp(4, min, max)); in testClampInt()
38 Assert.assertEquals(CLAMP_FAILURE, 4, MathUtils.clamp(4, max, min)); in testClampInt()
40 Assert.assertEquals(CLAMP_FAILURE, 1, MathUtils.clamp(-1, min, max)); in testClampInt()
41 Assert.assertEquals(CLAMP_FAILURE, 1, MathUtils.clamp(0, max, min)); in testClampInt()
43 Assert.assertEquals(CLAMP_FAILURE, 9, MathUtils.clamp(10, min, max)); in testClampInt()
44 Assert.assertEquals(CLAMP_FAILURE, 9, MathUtils.clamp(30, max, min)); in testClampInt()
51 Assert.assertEquals(CLAMP_FAILURE, 4, (float) MathUtils.clamp(4, min, max), EPSILON); in testClampLong()
52 Assert.assertEquals(CLAMP_FAILURE, 4, (float) MathUtils.clamp(4, max, min), EPSILON); in testClampLong()
54 Assert.assertEquals(CLAMP_FAILURE, 1, (float) MathUtils.clamp(-1, min, max), EPSILON); in testClampLong()
[all …]
/external/cronet/stable/base/android/junit/src/org/chromium/base/
DMathUtilsTest.java20 private static final String CLAMP_FAILURE = "Failure to correctly clamp value to range.";
37 Assert.assertEquals(CLAMP_FAILURE, 4, MathUtils.clamp(4, min, max)); in testClampInt()
38 Assert.assertEquals(CLAMP_FAILURE, 4, MathUtils.clamp(4, max, min)); in testClampInt()
40 Assert.assertEquals(CLAMP_FAILURE, 1, MathUtils.clamp(-1, min, max)); in testClampInt()
41 Assert.assertEquals(CLAMP_FAILURE, 1, MathUtils.clamp(0, max, min)); in testClampInt()
43 Assert.assertEquals(CLAMP_FAILURE, 9, MathUtils.clamp(10, min, max)); in testClampInt()
44 Assert.assertEquals(CLAMP_FAILURE, 9, MathUtils.clamp(30, max, min)); in testClampInt()
51 Assert.assertEquals(CLAMP_FAILURE, 4, (float) MathUtils.clamp(4, min, max), EPSILON); in testClampLong()
52 Assert.assertEquals(CLAMP_FAILURE, 4, (float) MathUtils.clamp(4, max, min), EPSILON); in testClampLong()
54 Assert.assertEquals(CLAMP_FAILURE, 1, (float) MathUtils.clamp(-1, min, max), EPSILON); in testClampLong()
[all …]
/external/angle/src/tests/gl_tests/
DPolygonOffsetClampTest.cpp35 GLfloat clamp = -1.0f; in TEST_P() local
36 glGetFloatv(GL_POLYGON_OFFSET_CLAMP_EXT, &clamp); in TEST_P()
38 EXPECT_EQ(clamp, -1.0f); in TEST_P()
71 GLfloat clamp = -1.0f; in TEST_P() local
72 glGetFloatv(GL_POLYGON_OFFSET_CLAMP_EXT, &clamp); in TEST_P()
73 EXPECT_EQ(clamp, 0.0f); in TEST_P()
90 GLfloat clamp = -1.0f; in TEST_P() local
91 glGetFloatv(GL_POLYGON_OFFSET_CLAMP_EXT, &clamp); in TEST_P()
92 EXPECT_EQ(clamp, 3.0f); in TEST_P()
97 // Core function resets the clamp value to zero in TEST_P()
[all …]
/external/llvm/test/CodeGen/AMDGPU/
Dllvm.AMDGPU.clamp.ll6 declare float @llvm.AMDGPU.clamp.f32(float, float, float) nounwind readnone
10 ; SI: v_add_f32_e64 [[RESULT:v[0-9]+]], 0, [[ARG]] clamp{{$}}
16 %clamp = call float @llvm.AMDGPU.clamp.f32(float %src, float 0.0, float 1.0) nounwind readnone
17 store float %clamp, float addrspace(1)* %out, align 4
23 ; SI: v_add_f32_e64 [[RESULT:v[0-9]+]], 0, |[[ARG]]| clamp{{$}}
28 …%clamp = call float @llvm.AMDGPU.clamp.f32(float %src.fabs, float 0.0, float 1.0) nounwind readnone
29 store float %clamp, float addrspace(1)* %out, align 4
35 ; SI: v_add_f32_e64 [[RESULT:v[0-9]+]], 0, -[[ARG]] clamp{{$}}
40 …%clamp = call float @llvm.AMDGPU.clamp.f32(float %src.fneg, float 0.0, float 1.0) nounwind readnone
41 store float %clamp, float addrspace(1)* %out, align 4
[all …]
/external/mesa3d/src/panfrost/compiler/test/
Dtest-optimizer.cpp113 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
117 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
124 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
128 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
135 I->clamp = BI_CLAMP_CLAMP_0_INF; in TEST_F()
139 I->clamp = BI_CLAMP_CLAMP_0_INF; in TEST_F()
149 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
153 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
160 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
164 I->clamp = BI_CLAMP_CLAMP_0_1; in TEST_F()
[all …]
/external/sdv/vsomeip/third_party/boost/algorithm/example/
Dclamp_example.cpp13 #include <boost/algorithm/clamp.hpp>
23 // Clamp takes a value and two "fenceposts", and brings the value "between" the fenceposts. in main()
26 std::cout << "Clamping 5 to between [1, 10] -> " << ba::clamp ( 5, 1, 10 ) << std::endl; in main()
29 std::cout << "Clamping 15 to between [1, 10] -> " << ba::clamp ( 15, 1, 10 ) << std::endl; in main()
30 std::cout << "Clamping -15 to between [1, 10] -> " << ba::clamp ( -15, 1, 10 ) << std::endl; in main()
33 std::cout << "Clamping 5.1 to between [1, 10] -> " << ba::clamp ( 5.1, 1.0, 10.0 ) << std::endl; in main()
38 ba::clamp ( test1, one, two ) << "'" << std::endl; in main()
40 ba::clamp ( test2, one, two ) << "'" << std::endl; in main()
43 ba::clamp ( test1, one, two, compare_string_lengths ) << "'" << std::endl; in main()
45 ba::clamp ( test2, one, two, compare_string_lengths ) << "'" << std::endl; in main()
[all …]
/external/sdv/vsomeip/third_party/boost/algorithm/doc/
Dclamp-hpp.qbk2 [section:clamp clamp]
15 The header file clamp.hpp contains two functions for "clamping" a value between a pair of boundary …
17 [heading clamp]
19 The function `clamp (v, lo, hi)` returns:
25 Note: using `clamp` with floating point numbers may give unexpected results if one of the values is…
31 const T& clamp ( const T& val, const T& lo, const T& hi );
34 const T& clamp ( const T& val, const T& lo, const T& hi, Pred p );
39 foo = clamp ( foo, 1, 10 );
44 …`clamp` will make either one or two calls to the comparison predicate before returning one of the …
47clamp, that apply clamping to a series of values. You could write them yourself with std::transfor…
/external/cronet/tot/third_party/libc++/src/test/std/algorithms/alg.sorting/alg.clamp/
Dclamp.pass.cpp14 // clamp(const T& v, const T& lo, const T& hi);
38 assert(&std::clamp(a, lo, hi) == &x); in test()
70 assert(eq(std::clamp(x, y, z), x)); in main()
71 assert(eq(std::clamp(y, x, z), y)); in main()
79 assert(eq(std::clamp(x, y, z), x)); in main()
80 assert(eq(std::clamp(y, x, z), y)); in main()
88 assert(eq(std::clamp(x, y, z), x)); in main()
89 assert(eq(std::clamp(z, y, x), z)); in main()
97 assert(eq(std::clamp(x, y, z), x)); in main()
98 assert(eq(std::clamp(y, x, z), x)); in main()
[all …]
Dclamp.comp.pass.cpp14 // clamp(const T& v, const T& lo, const T& hi, Compare comp);
40 assert(&std::clamp(v, lo, hi, c) == &x); in test()
72 assert(eq(std::clamp(x, y, z, comp), x)); in main()
73 assert(eq(std::clamp(y, x, z, comp), y)); in main()
81 assert(eq(std::clamp(x, y, z, comp), x)); in main()
82 assert(eq(std::clamp(y, x, z, comp), y)); in main()
90 assert(eq(std::clamp(x, y, z, comp), x)); in main()
91 assert(eq(std::clamp(z, y, x, comp), z)); in main()
99 assert(eq(std::clamp(x, y, z, comp), x)); in main()
100 assert(eq(std::clamp(y, x, z, comp), x)); in main()
[all …]
/external/libcxx/test/std/algorithms/alg.sorting/alg.clamp/
Dclamp.pass.cpp15 // clamp(const T& v, const T& lo, const T& hi);
37 assert(&std::clamp(a, lo, hi) == &x); in test()
69 assert(eq(std::clamp(x, y, z), x)); in main()
70 assert(eq(std::clamp(y, x, z), y)); in main()
78 assert(eq(std::clamp(x, y, z), x)); in main()
79 assert(eq(std::clamp(y, x, z), y)); in main()
87 assert(eq(std::clamp(x, y, z), x)); in main()
88 assert(eq(std::clamp(z, y, x), z)); in main()
96 assert(eq(std::clamp(x, y, z), x)); in main()
97 assert(eq(std::clamp(y, x, z), x)); in main()
[all …]
Dclamp.comp.pass.cpp15 // clamp(const T& v, const T& lo, const T& hi, Compare comp);
39 assert(&std::clamp(v, lo, hi, c) == &x); in test()
71 assert(eq(std::clamp(x, y, z, comp), x)); in main()
72 assert(eq(std::clamp(y, x, z, comp), y)); in main()
80 assert(eq(std::clamp(x, y, z, comp), x)); in main()
81 assert(eq(std::clamp(y, x, z, comp), y)); in main()
89 assert(eq(std::clamp(x, y, z, comp), x)); in main()
90 assert(eq(std::clamp(z, y, x, comp), z)); in main()
98 assert(eq(std::clamp(x, y, z, comp), x)); in main()
99 assert(eq(std::clamp(y, x, z, comp), x)); in main()
[all …]
/external/cronet/stable/third_party/libc++/src/test/std/algorithms/alg.sorting/alg.clamp/
Dclamp.pass.cpp14 // clamp(const T& v, const T& lo, const T& hi);
38 assert(&std::clamp(a, lo, hi) == &x); in test()
70 assert(eq(std::clamp(x, y, z), x)); in main()
71 assert(eq(std::clamp(y, x, z), y)); in main()
79 assert(eq(std::clamp(x, y, z), x)); in main()
80 assert(eq(std::clamp(y, x, z), y)); in main()
88 assert(eq(std::clamp(x, y, z), x)); in main()
89 assert(eq(std::clamp(z, y, x), z)); in main()
97 assert(eq(std::clamp(x, y, z), x)); in main()
98 assert(eq(std::clamp(y, x, z), x)); in main()
[all …]
Dclamp.comp.pass.cpp14 // clamp(const T& v, const T& lo, const T& hi, Compare comp);
40 assert(&std::clamp(v, lo, hi, c) == &x); in test()
72 assert(eq(std::clamp(x, y, z, comp), x)); in main()
73 assert(eq(std::clamp(y, x, z, comp), y)); in main()
81 assert(eq(std::clamp(x, y, z, comp), x)); in main()
82 assert(eq(std::clamp(y, x, z, comp), y)); in main()
90 assert(eq(std::clamp(x, y, z, comp), x)); in main()
91 assert(eq(std::clamp(z, y, x, comp), z)); in main()
99 assert(eq(std::clamp(x, y, z, comp), x)); in main()
100 assert(eq(std::clamp(y, x, z, comp), x)); in main()
[all …]
/external/skia/src/gpu/ganesh/effects/
DGrBicubicEffect.cpp101 // Bicubic can send colors out of range, so clamp to get them back in (source) gamut. in emitCode()
102 // The kind of clamp we have to do depends on the alpha type. in emitCode()
104 case Clamp::kUnpremul: in emitCode()
107 case Clamp::kPremul: in emitCode()
132 auto clamp = kPremul_SkAlphaType == alphaType ? Clamp::kPremul : Clamp::kUnpremul; in Make() local
134 new GrBicubicEffect(std::move(fp), kernel, direction, clamp))); in Make()
148 auto clamp = kPremul_SkAlphaType == alphaType ? Clamp::kPremul : Clamp::kUnpremul; in Make() local
150 new GrBicubicEffect(std::move(fp), kernel, direction, clamp))); in Make()
167 auto clamp = kPremul_SkAlphaType == alphaType ? Clamp::kPremul : Clamp::kUnpremul; in MakeSubset() local
169 new GrBicubicEffect(std::move(fp), kernel, direction, clamp))); in MakeSubset()
[all …]
/external/robolectric/integration_tests/nativegraphics/src/test/java/org/robolectric/shadows/
DShadowNativeRadialGradientTest.java29 new RadialGradient(0.5f, 0.5f, 1, Color.RED, Color.BLUE, TileMode.CLAMP); in testZeroScaleMatrix()
54 RadialGradient gradient = new RadialGradient(50, 50, 25, red, blue, TileMode.CLAMP); in testColorLong()
147 () -> new RadialGradient(0.5f, 0.5f, 1, colors, null, TileMode.CLAMP)); in testNullColorInts()
156 () -> new RadialGradient(0.5f, 0.5f, 1, colors, null, TileMode.CLAMP)); in testNullColorLongs()
163 () -> new RadialGradient(0.5f, 0.5f, 1, new int[0], null, TileMode.CLAMP)); in testNoColorInts()
171 () -> new RadialGradient(0.5f, 0.5f, 1, new long[0], null, TileMode.CLAMP)); in testNoColorLongs()
178 () -> new RadialGradient(0.5f, 0.5f, 1, new int[1], null, TileMode.CLAMP)); in testOneColorInts()
186 () -> new RadialGradient(0.5f, 0.5f, 1, new long[1], null, TileMode.CLAMP)); in testOneColorLongs()
197 () -> new RadialGradient(0.5f, 0.5f, 1, colors, null, TileMode.CLAMP)); in testMismatchColorLongs()
207 () -> new RadialGradient(0.5f, 0.5f, 1, color0, color1, TileMode.CLAMP)); in testMismatchColorLongs2()
[all …]
/external/libvpx/test/
Dadd_noise_test.cc53 const int clamp = vpx_setup_noise(GET_PARAM(0), noise, kNoiseSize); in TEST_P() local
60 GET_PARAM(1)(s, noise, clamp, clamp, width, height, width)); in TEST_P()
79 GET_PARAM(1)(s, noise, clamp, clamp, width, height, width)); in TEST_P()
83 EXPECT_GT(static_cast<int>(s[i]), clamp) << "i = " << i; in TEST_P()
90 GET_PARAM(1)(s, noise, clamp, clamp, width, height, width)); in TEST_P()
94 EXPECT_LT(static_cast<int>(s[i]), 255 - clamp) << "i = " << i; in TEST_P()
105 const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize); in TEST_P() local
117 GET_PARAM(1)(s, noise, clamp, clamp, width, height, width)); in TEST_P()
120 vpx_plane_add_noise_c(d, noise, clamp, clamp, width, height, width)); in TEST_P()
/external/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack/src/
Dclamp.c38 "failed to create Clamp operator with %zu channels: number of channels must be non-zero", in pytorch_qnnp_create_clamp_nc_u8()
45 "failed to create Clamp operator with [%" PRIu8 ", %" PRIu8 in pytorch_qnnp_create_clamp_nc_u8()
78 pytorch_qnnp_operator_t clamp, in pytorch_qnnp_setup_clamp_nc_u8() argument
91 clamp->batch_size = 0; in pytorch_qnnp_setup_clamp_nc_u8()
95 clamp->batch_size = batch_size; in pytorch_qnnp_setup_clamp_nc_u8()
96 clamp->input = input; in pytorch_qnnp_setup_clamp_nc_u8()
97 clamp->input_pixel_stride = input_stride; in pytorch_qnnp_setup_clamp_nc_u8()
98 clamp->output = output; in pytorch_qnnp_setup_clamp_nc_u8()
99 clamp->output_pixel_stride = output_stride; in pytorch_qnnp_setup_clamp_nc_u8()
/external/executorch/backends/xnnpack/test/ops/
Dclamp.py14 class Clamp(torch.nn.Module): class in TestClamp
21 z = torch.clamp(x, min=self.min_val, max=self.max_val)
28 .check_count({"torch.ops.aten.clamp.default": 1})
39 module = self.Clamp(-0.5, 0.5)
44 module = self.Clamp(-0.5, 0.5)
49 module = self.Clamp(min_val=-0.5)
54 module = self.Clamp(max_val=0.5)
60 Tester(self.Clamp(min_val=-1, max_val=1), inputs)
63 .check_count({"torch.ops.aten.clamp.default": 1})
/external/skia/tests/sksl/shared/
DOverflow.glsl22clamp(hugeH, 0.0, 1.0)) * clamp(hugeF, 0.0, 1.0)) * clamp(float(hugeI), 0.0, 1.0)) * clamp(float(h…
/external/skia/tests/sksl/intrinsics/
DClampInt.glsl12clamp(intValues.x, -100, 100) == expectedA.x && clamp(intValues.xy, -100, 100) == expectedA.xy) &&…

12345678910>>...182