Home
last modified time | relevance | path

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

1234

/frameworks/base/packages/SettingsLib/src/com/android/settingslib/display/
DBrightnessUtils.java19 import android.util.MathUtils;
54 final float normalizedVal = MathUtils.norm(0, GAMMA_SPACE_MAX, val); in convertGammaToLinear()
57 ret = MathUtils.sq(normalizedVal / R); in convertGammaToLinear()
59 ret = MathUtils.exp((normalizedVal - C) / A) + B; in convertGammaToLinear()
64 return Math.round(MathUtils.lerp(min, max, ret / 12)); in convertGammaToLinear()
91 final float normalizedVal = MathUtils.norm(min, max, val) * 12; in convertLinearToGamma()
94 ret = MathUtils.sqrt(normalizedVal) * R; in convertLinearToGamma()
96 ret = A * MathUtils.log(normalizedVal - B) + C; in convertLinearToGamma()
99 return Math.round(MathUtils.lerp(0, GAMMA_SPACE_MAX, ret)); in convertLinearToGamma()
DDisplayDensityUtils.java26 import android.util.MathUtils;
110 final int numLarger = (int) MathUtils.constrain((maxScale - 1) / MIN_SCALE_INTERVAL, in DisplayDensityUtils()
112 final int numSmaller = (int) MathUtils.constrain((1 - minScale) / MIN_SCALE_INTERVAL, in DisplayDensityUtils()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DKeyguardClockPositionAlgorithm.java23 import android.util.MathUtils;
202 clockYDark = MathUtils.max(0, clockYDark); in getClockY()
209 float clockY = MathUtils.lerp(clockYBouncer, clockYRegular, shadeExpansion); in getClockY()
210 clockYDark = MathUtils.lerp(clockYBouncer, clockYDark, shadeExpansion); in getClockY()
212 return (int) (MathUtils.lerp(clockY, clockYDark, mDarkAmount) + mEmptyDragAmount); in getClockY()
226 return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount); in getClockAlpha()
DNavigationBarEdgePanel.java29 import android.util.MathUtils;
515 float extent = MathUtils.lerp(1.0f, 0.75f, mDisappearAmount); in calculatePath()
601 float touchTranslation = MathUtils.abs(x - mStartX); in handleMoveEvent()
629 float progress = MathUtils.saturate(diff / (mScreenSize - mBaseTranslation)); in handleMoveEvent()
635 float progress = MathUtils.saturate(diff / mBaseTranslation); in handleMoveEvent()
652 float velocity = MathUtils.mag(xVelocity, yVelocity); in handleMoveEvent()
677 float progress = MathUtils.constrain( in handleMoveEvent()
DLightBarTransitionsController.java24 import android.util.MathUtils;
199 mApplier.applyDarkIntensity(MathUtils.lerp(mDarkIntensity, 0f, mDozeAmount)); in dispatchDark()
/frameworks/base/services/core/java/com/android/server/display/
DBrightnessMappingStrategy.java26 import android.util.MathUtils;
280 brightness = MathUtils.constrain(brightness, in normalizeAbsoluteBrightness()
338 float newBrightness = MathUtils.constrain( in smoothCurve()
354 float newBrightness = MathUtils.constrain( in smoothCurve()
369 return MathUtils.exp(MAX_GRAD in permissibleRatio()
370 * (MathUtils.log(currLux + LUX_GRAD_SMOOTHING) in permissibleRatio()
371 - MathUtils.log(prevLux + LUX_GRAD_SMOOTHING))); in permissibleRatio()
390 gamma = MathUtils.log(desiredBrightness) / MathUtils.log(currentBrightness); in inferAutoBrightnessAdjustment()
392 adjustment = -MathUtils.log(gamma) / MathUtils.log(maxGamma); in inferAutoBrightnessAdjustment()
394 adjustment = MathUtils.constrain(adjustment, -1, +1); in inferAutoBrightnessAdjustment()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DBrightnessMappingStrategyTest.java33 import android.util.MathUtils;
366 minBrightness = (float) MathUtils.pow(minBrightness, MAXIMUM_GAMMA); // Gamma correction. in assertStrategyAdaptsToUserDataPoints()
475 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionLowChangeAtCenter()
476 assertEquals(MathUtils.pow(y1, gamma), strategy.getBrightness(x1), 0.01f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
477 assertEquals(MathUtils.pow(y2, gamma), strategy.getBrightness(x2), 0.01f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
478 assertEquals(MathUtils.pow(y3, gamma), strategy.getBrightness(x3), 0.01f /* tolerance */); in testGammaCorrectionLowChangeAtCenter()
504 strategy.addUserDataPoint(x2, (float) MathUtils.pow(y2, gamma)); in testGammaCorrectionHighChangeAtCenter()
505 assertEquals(MathUtils.pow(y1, minGamma), strategy.getBrightness(x1), in testGammaCorrectionHighChangeAtCenter()
507 assertEquals(MathUtils.pow(y2, gamma), strategy.getBrightness(x2), in testGammaCorrectionHighChangeAtCenter()
509 assertEquals(MathUtils.pow(y3, minGamma), strategy.getBrightness(x3), in testGammaCorrectionHighChangeAtCenter()
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
DActivityLaunchAnimator.java26 import android.util.MathUtils;
197 int newWidth = (int) MathUtils.lerp(notificationWidth, in onAnimationStart()
201 mParams.top = (int) MathUtils.lerp(mParams.startPosition[1], in onAnimationStart()
203 mParams.bottom = (int) MathUtils.lerp(mParams.startPosition[1] in onAnimationStart()
207 mCornerRadius = MathUtils.lerp(mNotificationCornerRadius, in onAnimationStart()
321 clipTopAmountCompensation = (int) MathUtils.lerp(0, startClipTopAmount, in getTopChange()
332 return MathUtils.constrain((linearProgress * ANIMATION_DURATION - delay) in getProgress()
/frameworks/base/libs/hwui/pipeline/skia/
DLayerDrawable.cpp40 return MathUtils::isOne(matrix.getScaleX()) && MathUtils::isOne(matrix.getScaleY()); in isBasicallyTranslate()
47 bool noScale = MathUtils::isOne(matrix.getScaleX()) && MathUtils::isOne(matrix.getScaleY()); in shouldFilter()
/frameworks/base/core/java/android/hardware/display/
DBrightnessCorrection.java25 import android.util.MathUtils;
225 mScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in ScaleAndTranslateLog()
226 mTranslate = MathUtils.constrain(translate, MIN_TRANSLATE, MAX_TRANSLATE); in ScaleAndTranslateLog()
231 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;
73 return (int) MathUtils.lerp(lockY, aodY, mDarkAmount); in getPreferredY()
/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/util/
DBurnInHelper.kt19 import android.util.MathUtils
50 return MathUtils.lerp(0f, amplitude, interpolationAmount) in zigzag()
/frameworks/base/core/java/android/os/
DParcelableParcel.java20 import android.util.MathUtils;
45 src.setDataPosition(MathUtils.addOrThrow(pos, size)); in ParcelableParcel()
/frameworks/base/services/accessibility/java/com/android/server/accessibility/
DGestureUtils.java3 import android.util.MathUtils;
35 return MathUtils.dist(first.getX(), first.getY(), second.getX(), second.getY()); in distance()
/frameworks/base/libs/hwui/
DOutline.h53 if (MathUtils::isPositive(radius)) { in setRoundRect()
98 return willClip() && MathUtils::isPositive(mRadius); in willRoundRectClip()
DRenderProperties.cpp130 if (mPrimitiveFields.mAlpha < 1 && !MathUtils::isZero(mPrimitiveFields.mAlpha)) { in debugOutputProperties()
191 if (MathUtils::isZero(getRotationX()) && MathUtils::isZero(getRotationY())) { in updateMatrix()
/frameworks/base/libs/hwui/tests/common/
DTestUtils.h39 EXPECT_TRUE(MathUtils::areEqual((a).left, (b).left) && \
40 MathUtils::areEqual((a).top, (b).top) && \
41 MathUtils::areEqual((a).right, (b).right) && \
42 MathUtils::areEqual((a).bottom, (b).bottom));
137 if (!MathUtils::areEqual(a[i], b[i])) { in matricesAreApproxEqual()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DMediaArtworkProcessor.kt28 import android.util.MathUtils
53 MathUtils.fitRect(rect, Math.max(mTmpSize.x / DOWNSAMPLE, mTmpSize.y / DOWNSAMPLE)) in processArtwork()
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/
DTouchAnimator.java18 import android.util.MathUtils;
56 float t = MathUtils.constrain((fraction - mStartDelay) / mSpan, 0, 1); in setPosition()
212 int i = MathUtils.constrain((int) Math.ceil(fraction / mFrameWidth), 1, mSize - 1); in setValue()
/frameworks/layoutlib/bridge/src/com/android/internal/view/animation/
DNativeInterpolatorFactoryHelper_Delegate.java23 import android.util.MathUtils;
132 return MathUtils.lerp(mValues[i1], mValues[i2], weight); in getInterpolation()
/frameworks/base/core/java/com/android/internal/util/
DProgressReporter.java25 import android.util.MathUtils;
147 + MathUtils.constrain((n * mSegmentRange[1]) / m, 0, mSegmentRange[1]); in setProgress()
/frameworks/base/graphics/java/android/graphics/drawable/
DRippleForeground.java29 import android.util.MathUtils;
316 return MathUtils.lerp(mClampedStartingX - mBounds.exactCenterX(), mTargetX, mTweenX); in getCurrentX()
320 return MathUtils.lerp(mClampedStartingY - mBounds.exactCenterY(), mTargetY, mTweenY); in getCurrentY()
324 return MathUtils.lerp(mStartRadius, mTargetRadius, mTweenRadius); in getCurrentRadius()
/frameworks/base/core/java/android/widget/
DTextInputTimePickerView.java26 import android.util.MathUtils;
236 MathUtils.constrain(hour, minHour, maxHour))); in parseAndSetHourInternal()
252 mListener.onValueChanged(MINUTES, MathUtils.constrain(minutes, 0, 59)); in parseAndSetMinuteInternal()
/frameworks/base/libs/hwui/utils/
DMathUtils.h28 class MathUtils {

1234