Home
last modified time | relevance | path

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

123456

/frameworks/base/packages/SettingsLib/src/com/android/settingslib/display/
DBrightnessUtils.java19 import android.util.MathUtils;
55 final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); in convertGammaToLinear()
58 ret = MathUtils.sq(normalizedVal / R); in convertGammaToLinear()
60 ret = MathUtils.exp((normalizedVal - C) / A) + B; in convertGammaToLinear()
65 return Math.round(MathUtils.lerp(min, max, ret / 12)); in convertGammaToLinear()
78 final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); in convertGammaToLinearFloat()
81 ret = MathUtils.sq(normalizedVal / R); in convertGammaToLinearFloat()
83 ret = MathUtils.exp((normalizedVal - C) / A) + B; in convertGammaToLinearFloat()
88 final float normalizedRet = MathUtils.constrain(ret, 0, 12); in convertGammaToLinearFloat()
92 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
97 var remappedProgress = MathUtils.map( in getGoneState()
102 remappedProgress = MathUtils.constrain(remappedProgress, 0.0f, 1.0f) in getGoneState()
104 width = MathUtils.lerp( in getGoneState()
108 height = MathUtils.lerp( in getGoneState()
118 val alphaProgress = MathUtils.map( in getGoneState()
120 alpha = MathUtils.constrain(alphaProgress, 0.0f, 1.0f) in getGoneState()
157 alphaProgress = MathUtils.map(GONE_FADE_FRACTION, 1.0f, 0.0f, 1.0f, progress) in getInterpolatedState()
162 newScale = MathUtils.lerp(GONE_SCALE_AMOUNT * endScale, endScale, progress) in getInterpolatedState()
173 resultX = MathUtils.lerp(widgetStart.x - resultMeasureWidth / 2.0f, in getInterpolatedState()
[all …]
/frameworks/base/packages/SystemUI/animation/src/com/android/systemui/animation/
DInterpolators.java19 import android.util.MathUtils;
91 float b = MathUtils.log((overshootAmount + 1) / (overshootAmount)) / overshootStart; in getOvershootInterpolation()
92 return MathUtils.max(0.0f, in getOvershootInterpolation()
103 return MathUtils.max(0.0f, (float) (1.0f - Math.exp(-4 * progress))); in getOvershootInterpolation()
113 fraction = MathUtils.constrainedMap(0f, 1f, 0.3f, 1f, fraction); in getNotificationScrimAlpha()
115 fraction = MathUtils.constrainedMap(0f, 1f, 0f, 0.5f, fraction); in getNotificationScrimAlpha()
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DBrightnessMappingStrategyTest.java33 import android.util.MathUtils;
128 final float expectedLevel = MathUtils.map(PowerManager.BRIGHTNESS_OFF + 1, in testSimpleStrategyMappingAtControlPoints()
187 final float expectedLevel = MathUtils.map(DISPLAY_RANGE_NITS[0], DISPLAY_RANGE_NITS[1], in testPhysicalStrategyMappingAtControlPoints()
410 minBrightness = (float) MathUtils.pow(minBrightness, MAXIMUM_GAMMA); // Gamma correction. in assertStrategyAdaptsToUserDataPoints()
516 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionLowChangeAtCenter()
517 assertEquals(MathUtils.pow(y1, gamma), strategy.getBrightness(x1), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
518 assertEquals(MathUtils.pow(y2, gamma), strategy.getBrightness(x2), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
519 assertEquals(MathUtils.pow(y3, gamma), strategy.getBrightness(x3), 0.0001f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
545 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionHighChangeAtCenter()
546 assertEquals(MathUtils.pow(y1, minGamma), in testGammaCorrectionHighChangeAtCenter()
[all …]
/frameworks/base/libs/hwui/
DLayer.cpp57 return MathUtils::isZero(roundf(x) - x); in isIntegerAligned()
66 if (MathUtils::isZero(matrix.getScaleX()) && MathUtils::isZero(matrix.getScaleY())) { in shouldFilterRect()
78 if (!(MathUtils::areEqual(dstW, srcRect.width()) && in shouldFilterRect()
79 MathUtils::areEqual(dstH, srcRect.height()))) { in shouldFilterRect()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DKeyguardClockPositionAlgorithm.java24 import android.util.MathUtils;
243 float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion); in getClockY()
252 return (int) (MathUtils.lerp(clockY, clockYDark, darkAmount) + mOverStretchAmount); in getClockY()
261 float userSwitchY = MathUtils.lerp(userSwitchYBouncer, userSwitchYRegular, shadeExpansion); in getUserSwitcherY()
276 float qsAlphaFactor = MathUtils.saturate(mQsExpansion / 0.3f); in getClockAlpha()
280 return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); in getClockAlpha()
/frameworks/base/services/core/java/com/android/server/display/
DBrightnessMappingStrategy.java26 import android.util.MathUtils;
402 float maxBrightness = MathUtils.max( in smoothCurve()
405 float newBrightness = MathUtils.constrain( in smoothCurve()
421 float newBrightness = MathUtils.constrain( in smoothCurve()
436 return MathUtils.pow((currLux + LUX_GRAD_SMOOTHING) in permissibleRatio()
456 gamma = MathUtils.log(desiredBrightness) / MathUtils.log(currentBrightness); in inferAutoBrightnessAdjustment()
458 adjustment = -MathUtils.log(gamma) / MathUtils.log(maxGamma); in inferAutoBrightnessAdjustment()
460 adjustment = MathUtils.constrain(adjustment, -1, +1); in inferAutoBrightnessAdjustment()
463 MathUtils.pow(maxGamma, -adjustment) + " == " + gamma); in inferAutoBrightnessAdjustment()
465 MathUtils.pow(currentBrightness, gamma) + " == " + desiredBrightness); in inferAutoBrightnessAdjustment()
[all …]
/frameworks/base/libs/hwui/pipeline/skia/
DLayerDrawable.cpp37 return MathUtils::isZero(roundf(x) - x); in isIntegerAligned()
46 if (MathUtils::isZero(matrix.getScaleX()) && MathUtils::isZero(matrix.getScaleY())) { in shouldFilterRect()
58 if (!(MathUtils::areEqual(dstW, srcRect.width()) && in shouldFilterRect()
59 MathUtils::areEqual(dstH, srcRect.height()))) { in shouldFilterRect()
/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/base/packages/SystemUI/src/com/android/keyguard/clock/
DClockLayout.java23 import android.util.MathUtils;
93 final float offsetX = MathUtils.lerp(0f, in positionChildren()
96 final float offsetY = MathUtils.lerp(0f, in positionChildren()
DSmallClockPosition.java20 import android.util.MathUtils;
75 return (int) MathUtils.lerp(lockY, aodY, mDarkAmount); in getPreferredY()
DClockPalette.kt20 import android.util.MathUtils
49 hsv[i] = MathUtils.lerp(darkHSV[i], lightHSV[i], darkAmount) in getSecondaryColor()
/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/packages/SystemUI/src/com/android/systemui/biometrics/
DUdfpsKeyguardView.java30 import android.util.MathUtils;
116 mBurnInOffsetX = MathUtils.lerp(0f, in updateBurnInOffsets()
119 mBurnInOffsetY = MathUtils.lerp(0f, in updateBurnInOffsets()
122 mBurnInProgress = MathUtils.lerp(0f, getBurnInProgressOffset(), mInterpolatedDarkAmount); in updateBurnInOffsets()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DBlurUtils.kt25 import android.util.MathUtils
61 return MathUtils.lerp(minBlurRadius.toFloat(), maxBlurRadius.toFloat(), ratio).toInt() in blurRadiusOfRatio()
71 return MathUtils.map(minBlurRadius.toFloat(), maxBlurRadius.toFloat(), in ratioOfBlurRadius()
/frameworks/base/packages/SystemUI/src/com/android/keyguard/
DTextInterpolator.kt25 import android.util.MathUtils in <lambda>()
216 run.baseX[i] = MathUtils.lerp(run.baseX[i], run.targetX[i], progress) in <lambda>()
217 run.baseY[i] = MathUtils.lerp(run.baseY[i], run.targetY[i], progress) in <lambda>()
338 MathUtils.lerp(line.baseX[i], line.targetX[i], progress) in <lambda>()
340 MathUtils.lerp(line.baseY[i], line.targetY[i], progress) in <lambda>()
415 out.textSize = MathUtils.lerp(from.textSize, to.textSize, progress) in <lambda>()
DFontInterpolator.kt21 import android.util.MathUtils in <lambda>()
122 MathUtils.lerp( in <lambda>()
127 MathUtils.lerp( in <lambda>()
135 MathUtils.lerp(startValue, endValue, progress) in <lambda>()
/frameworks/base/core/java/com/android/internal/graphics/cam/
DFrame.java20 import android.util.MathUtils;
140 float c = (f >= 0.9) ? MathUtils.lerp(0.59f, 0.69f, ((f - 0.9f) * 10.0f)) : MathUtils.lerp( in make()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
DExpandAnimationParameters.kt3 import android.util.MathUtils
51 clipTopAmountCompensation = MathUtils.lerp(0f, startClipTopAmount.toFloat(),
/frameworks/base/core/java/android/os/
DParcelableHolder.java22 import android.util.MathUtils;
204 parcel.setDataPosition(MathUtils.addOrThrow(dataStartPos, dataSize)); in readFromParcel()
230 parcel.setDataPosition(MathUtils.addOrThrow(parcel.dataPosition(), dataSize)); in writeToParcel()
DParcelableParcel.java20 import android.util.MathUtils;
45 src.setDataPosition(MathUtils.addOrThrow(pos, size)); in ParcelableParcel()
/frameworks/base/core/java/android/service/autofill/
DInlineSuggestionRoot.java24 import android.util.MathUtils;
66 final float distance = MathUtils.dist(mDownX, mDownY, in dispatchTouchEvent()
/frameworks/base/packages/SystemUI/src/com/android/systemui/wallet/ui/
DDotIndicatorDecoration.java23 import android.util.MathUtils;
120 float radius = MathUtils.lerp(mSelectedRadius, mUnselectedRadius, progress / 2); in drawSelectedDot()
131 float radius = MathUtils.lerp(mUnselectedRadius, mSelectedColor, progress / 2); in drawFadingUnselectedDot()
/frameworks/base/services/core/java/com/android/server/vibrator/
DClippingAmplitudeAndFrequencyAdapter.java23 import android.util.MathUtils;
78 return MathUtils.min(amplitude, info.getMaxAmplitude(frequency)); in clampAmplitude()

123456