Home
last modified time | relevance | path

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

123456789

/frameworks/base/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/
DBrightnessUtils.java19 import android.util.MathUtils;
56 final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); in convertGammaToLinear()
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()
79 final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); in convertGammaToLinearFloat()
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()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/animation/
DTransitionLayoutController.kt21 import android.util.MathUtils
108 var remappedProgress = MathUtils.map( in getGoneState()
113 remappedProgress = MathUtils.constrain(remappedProgress, 0.0f, 1.0f) in getGoneState()
115 width = MathUtils.lerp( in getGoneState()
119 height = MathUtils.lerp( in getGoneState()
129 val alphaProgress = MathUtils.map( in getGoneState()
131 alpha = MathUtils.constrain(alphaProgress, 0.0f, 1.0f) in getGoneState()
175 alphaProgress = MathUtils.map( in getInterpolatedState()
192 alphaProgress = MathUtils.map( in getInterpolatedState()
203 newScale = MathUtils.lerp(GONE_SCALE_AMOUNT * endScale, endScale, progress) in getInterpolatedState()
[all …]
/frameworks/base/core/java/com/android/internal/display/
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()
/frameworks/base/packages/SystemUI/src/com/android/keyguard/
DBouncerPanelExpansionCalculator.kt19 import android.util.MathUtils
39 return MathUtils.constrain((fraction - 0.9f) / 0.1f, 0f, 1f) in aboutToShowBouncerProgress()
47 return MathUtils.constrain((fraction - 0.7f) / 0.3f, 0f, 1f) in getKeyguardClockScaledExpansion()
67 return MathUtils.constrain((fraction - 0.94f) / 0.06f, 0f, 1f) in getDreamAlphaScaledExpansion()
/frameworks/base/packages/SystemUI/animation/src/com/android/systemui/animation/
DShadeInterpolation.kt3 import android.util.MathUtils
14 val mappedFraction = MathUtils.constrainedMap(0f, 1f, 0f, 0.5f, fraction) in getNotificationScrimAlpha()
25 val mappedFraction = MathUtils.constrainedMap(0f, 1f, 0.3f, 1f, fraction) in getContentAlpha()
DTransitionAnimator.kt27 import android.util.MathUtils in <lambda>()
61 return MathUtils.constrain( in <lambda>()
381 val xCenter = MathUtils.lerp(startCenterX, endCenterX, xProgress) in <lambda>()
382 val halfWidth = MathUtils.lerp(startWidth, endWidth, progress) / 2f in <lambda>()
384 state.top = MathUtils.lerp(startTop, endTop, progress).roundToInt() in <lambda>()
385 state.bottom = MathUtils.lerp(startBottom, endBottom, progress).roundToInt() in <lambda>()
390 MathUtils.lerp(startTopCornerRadius, endTopCornerRadius, progress) in <lambda>()
392 MathUtils.lerp(startBottomCornerRadius, endBottomCornerRadius, progress) in <lambda>()
DTextInterpolator.kt26 import android.util.MathUtils in <lambda>()
219 run.baseX[i] = MathUtils.lerp(run.baseX[i], run.targetX[i], progress) in <lambda>()
220 run.baseY[i] = MathUtils.lerp(run.baseY[i], run.targetY[i], progress) in <lambda>()
367 MathUtils.lerp(line.baseX[i], line.targetX[i], progress) in <lambda>()
369 MathUtils.lerp(line.baseY[i], line.targetY[i], progress) in <lambda>()
386 tmpGlyph.x = MathUtils.lerp(line.baseX[i], line.targetX[i], progress) in <lambda>()
387 tmpGlyph.y = MathUtils.lerp(line.baseY[i], line.targetY[i], progress) in <lambda>()
485 out.textSize = MathUtils.lerp(from.textSize, to.textSize, progress) in <lambda>()
487 out.strokeWidth = MathUtils.lerp(from.strokeWidth, to.strokeWidth, progress) in <lambda>()
/frameworks/base/packages/SystemUI/src/com/android/systemui/shade/transition/
DLargeScreenPortraitShadeInterpolator.kt19 import android.util.MathUtils
28 return MathUtils.constrainedMap(0f, 1f, 0f, 0.3f, fraction) in getBehindScrimAlpha()
32 return MathUtils.constrainedMap(0f, 1f, 0.3f, 0.75f, fraction) in getNotificationScrimAlpha()
DSplitShadeInterpolator.kt19 import android.util.MathUtils
56 MathUtils.constrainedMap(
/frameworks/base/libs/hwui/
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()
/frameworks/base/services/core/java/com/android/server/display/brightness/
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()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DLockscreenShadeQsTransitionController.kt21 import android.util.MathUtils
130 qsTransitionFraction = MathUtils.saturate(qsDragDownAmount / qsTransitionDistance) in onDragDownAmountChanged()
132 MathUtils.lerp( in onDragDownAmountChanged()
135 /* amount= */ MathUtils.saturate(qsDragDownAmount / qsSquishTransitionDistance) in onDragDownAmountChanged()
DLockscreenShadeScrimTransitionController.kt5 import android.util.MathUtils
63 scrimProgress = MathUtils.saturate(dragDownAmount / scrimTransitionDistance) in onDragDownAmountChanged()
66 MathUtils.saturate(notificationsScrimDragAmount / notificationsScrimTransitionDistance) in onDragDownAmountChanged()
/frameworks/base/libs/hwui/pipeline/skia/
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()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DKeyguardClockPositionAlgorithm.java26 import android.util.MathUtils;
289 float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion); in getClockY()
323 mCurrentBurnInOffsetY = MathUtils.lerp(0, fullyDarkBurnInOffset, darkAmount); in getClockY()
342 return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount); in getClockY()
351 float userSwitchY = MathUtils.lerp(userSwitchYBouncer, userSwitchYRegular, shadeExpansion); in getUserSwitcherY()
368 float qsAlphaFactor = MathUtils.saturate(mQsExpansion / 0.3f); in getClockAlpha()
373 return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); in getClockAlpha()
/frameworks/base/packages/SystemUI/src/com/android/systemui/common/ui/view/
DMotionEventExt.kt19 import android.util.MathUtils
35 return MathUtils.dist(this.rawX, this.rawY, xOnDisplay, yOnDisplay) in rawDistanceFrom()
/frameworks/base/services/tests/displayservicetests/src/com/android/server/display/
DBrightnessMappingStrategyTest.java38 import android.util.MathUtils;
236 final float expectedLevel = MathUtils.map(DISPLAY_RANGE_NITS[0], DISPLAY_RANGE_NITS[1], in testPhysicalStrategyMappingAtControlPoints()
509 minBrightness = (float) MathUtils.pow(minBrightness, MAXIMUM_GAMMA); // Gamma correction. in assertStrategyAdaptsToUserDataPoints()
589 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionLowChangeAtCenter()
590 assertEquals(MathUtils.pow(y1, gamma), strategy.getBrightness(x1), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
591 assertEquals(MathUtils.pow(y2, gamma), strategy.getBrightness(x2), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
592 assertEquals(MathUtils.pow(y3, gamma), strategy.getBrightness(x3), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
620 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionHighChangeAtCenter()
621 assertEquals(MathUtils.pow(y1, minGamma), in testGammaCorrectionHighChangeAtCenter()
623 assertEquals(MathUtils.pow(y2, gamma), in testGammaCorrectionHighChangeAtCenter()
[all …]
/frameworks/base/core/java/android/hardware/display/
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()
/frameworks/libs/systemui/toruslib/torus-utils/src/main/java/com/google/android/torus/utils/animation/
DEasingUtils.kt19 import com.google.android.torus.math.MathUtils
64 return MathUtils.lerp(currentValue, targetValue, lerpBy) in calculateEasing()
/frameworks/libs/systemui/toruslib/torus-utils/src/main/java/com/google/android/torus/utils/interaction/
DGyro2dController.kt26 import com.google.android.torus.math.MathUtils
168 MathUtils.lerp(rotation.x, angles[0], easingMul * deltaSeconds), in update()
169 MathUtils.lerp(rotation.y, angles[1], easingMul * deltaSeconds) in update()
289 recenterMul = 1f - MathUtils.clamp(config.recenterSpeed, 0f, 1f) in onNewConfig()
291 easingMul = MathUtils.clamp(config.easingSpeed, 0f, 1f) * BASE_FPS in onNewConfig()
/frameworks/base/services/accessibility/java/com/android/server/accessibility/gestures/
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()
/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/util/
DBurnInHelper.kt19 import android.util.MathUtils
69 return MathUtils.lerp(0f, amplitude, interpolationAmount) in zigzag()
/frameworks/base/services/core/java/com/android/server/vibrator/
DSplitSegmentsAdapter.java23 import android.util.MathUtils;
91 MathUtils.lerp(startFrequencyHz, endFrequencyHz, durationRatio); in splitRampSegment()
93 MathUtils.lerp(ramp.getStartAmplitude(), ramp.getEndAmplitude(), durationRatio); in splitRampSegment()
DRampToStepAdapter.java24 import android.util.MathUtils;
88 MathUtils.lerp(ramp.getStartAmplitude(), ramp.getEndAmplitude(), pos), in convertRampToSteps()
89 MathUtils.lerp(startFrequencyHz, endFrequencyHz, pos), in convertRampToSteps()
/frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/
DAlternateBouncerToGoneTransitionViewModel.kt19 import android.util.MathUtils
63 onStep = { MathUtils.lerp(startAlpha, 0f, it) }, in lockscreenAlpha()
83 MathUtils.lerp(startAlpha, 0f, it) in notificationAlpha()

123456789