Home
last modified time | relevance | path

Searched refs:MathUtils (Results 1 – 25 of 179) sorted by relevance

12345678

/aosp14/frameworks/base/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/
H A DBrightnessUtils.java19 import android.util.MathUtils;
59 ret = MathUtils.sq(normalizedVal / R); in convertGammaToLinear()
61 ret = MathUtils.exp((normalizedVal - C) / A) + B; in convertGammaToLinear()
66 return Math.round(MathUtils.lerp(min, max, ret / 12)); in convertGammaToLinear()
82 ret = MathUtils.sq(normalizedVal / R); in convertGammaToLinearFloat()
84 ret = MathUtils.exp((normalizedVal - C) / A) + B; in convertGammaToLinearFloat()
89 final float normalizedRet = MathUtils.constrain(ret, 0, 12); in convertGammaToLinearFloat()
93 return MathUtils.lerp(min, max, normalizedRet / 12); in convertGammaToLinearFloat()
132 final float normalizedVal = MathUtils.norm(min, max, val) * 12; in convertLinearToGammaFloat()
135 ret = MathUtils.sqrt(normalizedVal) * R; in convertLinearToGammaFloat()
[all …]
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/util/animation/
H A DTransitionLayoutController.kt21 import android.util.MathUtils
97 var remappedProgress = MathUtils.map(
102 remappedProgress = MathUtils.constrain(remappedProgress, 0.0f, 1.0f)
104 width = MathUtils.lerp(
108 height = MathUtils.lerp(
118 val alphaProgress = MathUtils.map(
120 alpha = MathUtils.constrain(alphaProgress, 0.0f, 1.0f)
199 resultX = MathUtils.lerp(widgetStart.x,
202 resultY = MathUtils.lerp(widgetStart.y,
251 contentTranslation.x = MathUtils.lerp(
[all …]
/aosp14/frameworks/base/services/core/java/com/android/server/display/
H A DBrightnessUtils.java19 import android.util.MathUtils;
52 ret = MathUtils.sq(val / R); in convertGammaToLinear()
54 ret = MathUtils.exp((val - C) / A) + B; in convertGammaToLinear()
59 final float normalizedRet = MathUtils.constrain(ret, 0, 12); in convertGammaToLinear()
77 ret = MathUtils.sqrt(normalizedVal) * R; in convertLinearToGamma()
79 ret = A * MathUtils.log(normalizedVal - B) + C; in convertLinearToGamma()
H A DBrightnessMappingStrategy.java28 import android.util.MathUtils;
493 float maxBrightness = MathUtils.max( in smoothCurve()
496 float newBrightness = MathUtils.constrain( in smoothCurve()
512 float newBrightness = MathUtils.constrain( in smoothCurve()
527 return MathUtils.pow((currLux + LUX_GRAD_SMOOTHING) in permissibleRatio()
547 gamma = MathUtils.log(desiredBrightness) / MathUtils.log(currentBrightness); in inferAutoBrightnessAdjustment()
549 adjustment = -MathUtils.log(gamma) / MathUtils.log(maxGamma); in inferAutoBrightnessAdjustment()
551 adjustment = MathUtils.constrain(adjustment, -1, +1); in inferAutoBrightnessAdjustment()
568 adjustment = MathUtils.constrain(adjustment, -1, 1); in getAdjustedCurve()
569 float gamma = MathUtils.pow(maxGamma, -adjustment); in getAdjustedCurve()
[all …]
/aosp14/frameworks/base/packages/SystemUI/src/com/android/keyguard/
H A DBouncerPanelExpansionCalculator.kt19 import android.util.MathUtils
39 return MathUtils.constrain((fraction - 0.9f) / 0.1f, 0f, 1f)
47 return MathUtils.constrain((fraction - 0.7f) / 0.3f, 0f, 1f)
67 return MathUtils.constrain((fraction - 0.94f) / 0.06f, 0f, 1f)
/aosp14/frameworks/base/libs/hwui/
H A DLayer.cpp60 return MathUtils::isZero(roundf(x) - x); in isIntegerAligned()
69 if (MathUtils::isZero(matrix.getScaleX()) && MathUtils::isZero(matrix.getScaleY())) { in shouldFilterRect()
81 if (!(MathUtils::areEqual(dstW, srcRect.width()) && in shouldFilterRect()
82 MathUtils::areEqual(dstH, srcRect.height()))) { in shouldFilterRect()
/aosp14/frameworks/base/packages/SystemUI/animation/src/com/android/systemui/animation/
H A DShadeInterpolation.kt3 import android.util.MathUtils
14 val mappedFraction = MathUtils.constrainedMap(0f, 1f, 0f, 0.5f, fraction)
25 val mappedFraction = MathUtils.constrainedMap(0f, 1f, 0.3f, 1f, fraction)
H A DLaunchAnimator.kt27 import android.util.MathUtils
53 return MathUtils.constrain(
327 val xCenter = MathUtils.lerp(startCenterX, endCenterX, xProgress)
328 val halfWidth = MathUtils.lerp(startWidth, endWidth, progress) / 2f
330 state.top = MathUtils.lerp(startTop, endTop, progress).roundToInt()
331 state.bottom = MathUtils.lerp(startBottom, endBottom, progress).roundToInt()
336 MathUtils.lerp(startTopCornerRadius, endTopCornerRadius, progress)
338 MathUtils.lerp(startBottomCornerRadius, endBottomCornerRadius, progress)
H A DTextInterpolator.kt26 import android.util.MathUtils
219 run.baseX[i] = MathUtils.lerp(run.baseX[i], run.targetX[i], progress)
220 run.baseY[i] = MathUtils.lerp(run.baseY[i], run.targetY[i], progress)
367 MathUtils.lerp(line.baseX[i], line.targetX[i], progress)
369 MathUtils.lerp(line.baseY[i], line.targetY[i], progress)
386 tmpGlyph.x = MathUtils.lerp(line.baseX[i], line.targetX[i], progress)
387 tmpGlyph.y = MathUtils.lerp(line.baseY[i], line.targetY[i], progress)
485 out.textSize = MathUtils.lerp(from.textSize, to.textSize, progress)
487 out.strokeWidth = MathUtils.lerp(from.strokeWidth, to.strokeWidth, progress)
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
H A DKeyguardClockPositionAlgorithm.java24 import android.util.MathUtils;
272 float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion); in getClockY()
308 mCurrentBurnInOffsetY = MathUtils.lerp(0, fullyDarkBurnInOffset, darkAmount); in getClockY()
309 return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount); in getClockY()
318 float userSwitchY = MathUtils.lerp(userSwitchYBouncer, userSwitchYRegular, shadeExpansion); in getUserSwitcherY()
335 float qsAlphaFactor = MathUtils.saturate(mQsExpansion / 0.3f); in getClockAlpha()
340 return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); in getClockAlpha()
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/shade/transition/
H A DLargeScreenPortraitShadeInterpolator.kt19 import android.util.MathUtils
28 return MathUtils.constrainedMap(0f, 1f, 0f, 0.3f, fraction)
32 return MathUtils.constrainedMap(0f, 1f, 0.3f, 0.75f, fraction)
H A DSplitShadeInterpolator.kt19 import android.util.MathUtils
56 MathUtils.constrainedMap(
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/privacy/television/
H A DPrivacyChipDrawable.java32 import android.util.MathUtils;
129 float radius = MathUtils.lerp( in draw()
159 float left = MathUtils.lerp(start.left, stop.left, amount); in lerpRect()
160 float top = MathUtils.lerp(start.top, stop.top, amount); in lerpRect()
161 float right = MathUtils.lerp(start.right, stop.right, amount); in lerpRect()
162 float bottom = MathUtils.lerp(start.bottom, stop.bottom, amount); in lerpRect()
172 float radius = MathUtils.lerp( in clipToForeground()
/aosp14/frameworks/base/services/tests/displayservicetests/src/com/android/server/display/
H A DBrightnessMappingStrategyTest.java33 import android.util.MathUtils;
164 final float expectedLevel = MathUtils.map(PowerManager.BRIGHTNESS_OFF + 1, in testSimpleStrategyMappingAtControlPoints()
225 final float expectedLevel = MathUtils.map(DISPLAY_RANGE_NITS[0], DISPLAY_RANGE_NITS[1], in testPhysicalStrategyMappingAtControlPoints()
489 minBrightness = (float) MathUtils.pow(minBrightness, MAXIMUM_GAMMA); // Gamma correction. in assertStrategyAdaptsToUserDataPoints()
612 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionLowChangeAtCenter()
644 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionHighChangeAtCenter()
645 assertEquals(MathUtils.pow(y1, minGamma), in testGammaCorrectionHighChangeAtCenter()
647 assertEquals(MathUtils.pow(y2, gamma), in testGammaCorrectionHighChangeAtCenter()
649 assertEquals(MathUtils.pow(y3, minGamma), in testGammaCorrectionHighChangeAtCenter()
695 float gamma = (float) MathUtils.pow(MAXIMUM_GAMMA, -adjustment); in testGammaCorrectionChangeAtEdges()
[all …]
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
H A DLockscreenShadeQsTransitionController.kt21 import android.util.MathUtils
122 qsTransitionFraction = MathUtils.saturate(qsDragDownAmount / qsTransitionDistance)
124 MathUtils.lerp(
127 /* amount= */ MathUtils.saturate(qsDragDownAmount / qsSquishTransitionDistance)
H A DLockscreenShadeScrimTransitionController.kt5 import android.util.MathUtils
60 scrimProgress = MathUtils.saturate(dragDownAmount / scrimTransitionDistance)
63 MathUtils.saturate(notificationsScrimDragAmount / notificationsScrimTransitionDistance)
H A DLockscreenShadeKeyguardTransitionController.kt5 import android.util.MathUtils
69 alphaProgress = MathUtils.saturate(dragDownAmount / alphaTransitionDistance)
88 translationYProgress = MathUtils.saturate(dragDownAmount / keyguardTransitionDistance)
/aosp14/frameworks/base/services/core/java/com/android/server/display/brightness/
H A DBrightnessUtils.java20 import android.util.MathUtils;
40 return MathUtils.constrain(value, PowerManager.BRIGHTNESS_MIN, in clampAbsoluteBrightness()
48 return MathUtils.constrain(value, -1.0f, 1.0f); in clampBrightnessAdjustment()
/aosp14/frameworks/base/libs/hwui/pipeline/skia/
H A DLayerDrawable.cpp47 return MathUtils::isZero(roundf(x) - x); in isIntegerAligned()
56 if (MathUtils::isZero(matrix.getScaleX()) && MathUtils::isZero(matrix.getScaleY())) { in shouldFilterRect()
68 if (!(MathUtils::areEqual(dstW, srcRect.width()) && in shouldFilterRect()
69 MathUtils::areEqual(dstH, srcRect.height()))) { in shouldFilterRect()
/aosp14/frameworks/base/core/java/android/hardware/display/
H A DBrightnessCorrection.java25 import android.util.MathUtils;
219 mScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in ScaleAndTranslateLog()
220 mTranslate = MathUtils.constrain(translate, MIN_TRANSLATE, MAX_TRANSLATE); in ScaleAndTranslateLog()
225 return MathUtils.exp(mScale * MathUtils.log(brightness) + mTranslate); in apply()
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/common/ui/view/
H A DMotionEventExt.kt19 import android.util.MathUtils
35 return MathUtils.dist(this.rawX, this.rawY, xOnDisplay, yOnDisplay)
/aosp14/frameworks/base/core/java/android/content/res/
H A DFontScaleConverterFactory.java21 import android.util.MathUtils;
148 float interpolationPoint = MathUtils.constrainedMap( in forScale()
175 dpInterpolated[i] = MathUtils.lerp(startDp, endDp, interpolationPoint); in createInterpolatedTableBetween()
/aosp14/frameworks/base/services/accessibility/java/com/android/server/accessibility/gestures/
H A DGestureUtils.java4 import android.util.MathUtils;
39 return MathUtils.dist(first.getX(), first.getY(), second.getX(), second.getY()); in distance()
54 final float moveDelta = MathUtils.dist(pointerDown.x, pointerDown.y, moveEvent.getX(i), in distanceClosestPointerToPoint()
/aosp14/frameworks/base/services/core/java/com/android/server/vibrator/
H A DRampToStepAdapter.java24 import android.util.MathUtils;
86 MathUtils.lerp(ramp.getStartAmplitude(), ramp.getEndAmplitude(), pos), in apply()
87 MathUtils.lerp(startFrequencyHz, endFrequencyHz, pos), in apply()
/aosp14/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/util/
H A DBurnInHelper.kt19 import android.util.MathUtils
69 return MathUtils.lerp(0f, amplitude, interpolationAmount)

12345678