Searched refs:ratio (Results 1 - 25 of 29) sorted by relevance

12

/packages/apps/LegacyCamera/src/com/android/camera/
H A DPreviewFrameLayout.java28 * A layout which handles the preview aspect ratio.
43 public void setAspectRatio(double ratio) { argument
44 if (ratio <= 0.0) throw new IllegalArgumentException();
48 ratio = 1 / ratio;
51 if (mAspectRatio != ratio) {
52 mAspectRatio = ratio;
71 // Resize the preview frame with correct aspect ratio.
H A DUtil.java397 // Try to find an size match aspect ratio and size
399 double ratio = (double) size.width / size.height;
400 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
407 // Cannot find the one match the aspect ratio. This should not happen.
410 Log.w(TAG, "No preview size match the aspect ratio");
422 // Returns the largest picture size which matches the given aspect ratio.
431 // Try to find a size matches aspect ratio and has the largest width
433 double ratio = (double) size.width / size.height;
434 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
440 // Cannot find one that matches the aspect ratio
[all...]
/packages/apps/Camera/src/com/android/camera/
H A DPreviewFrameLayout.java31 * A layout which handles the preview aspect ratio.
67 public void setAspectRatio(double ratio) { argument
68 if (ratio <= 0.0) throw new IllegalArgumentException();
72 ratio = 1 / ratio;
75 if (mAspectRatio != ratio) {
76 mAspectRatio = ratio;
98 // Resize the preview frame with correct aspect ratio.
H A DUtil.java453 // Try to find an size match aspect ratio and size
455 double ratio = (double) size.width / size.height;
456 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
462 // Cannot find the one match the aspect ratio. This should not happen.
465 Log.w(TAG, "No preview size match the aspect ratio");
477 // Returns the largest picture size which matches the given aspect ratio.
486 // Try to find a size matches aspect ratio and has the largest width
488 double ratio = (double) size.width / size.height;
489 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
495 // Cannot find one that matches the aspect ratio
[all...]
/packages/apps/DeskClock/src/com/android/alarmclock/
H A DWidgetUtils.java53 float ratio = minWidth / res.getDimension(R.dimen.def_digital_widget_width);
54 return (ratio > 1) ? 1 : ratio;
72 float ratio = minHeight / res.getDimension(R.dimen.def_digital_widget_height);
73 return (ratio > 1) ? 1 : ratio;
H A DDigitalAppWidgetProvider.java52 float ratio = WidgetUtils.getScaleRatio(ctxt, null, appWidgetId);
53 updateClock(ctxt, appWidgetManager, appWidgetId, ratio);
63 float ratio = WidgetUtils.getScaleRatio(context, newOptions, appWidgetId);
65 updateClock(context, widgetManager, appWidgetId, ratio);
73 Context c, AppWidgetManager appWidgetManager, int appWidgetId, float ratio) {
78 WidgetUtils.setClockSize(c, widget, ratio);
72 updateClock( Context c, AppWidgetManager appWidgetManager, int appWidgetId, float ratio) argument
H A DDigitalWidgetViewsFactory.java273 float ratio = WidgetUtils.getScaleRatio(context, null, mId);
274 WidgetUtils.setClockSize(context, widget, ratio);
/packages/apps/Gallery2/tests/src/com/android/gallery3d/ui/
H A DGLCanvasMock.java64 float ratio, int x, int y, int w, int h) {
66 mDrawMixedRatio = ratio;
63 drawMixed(BasicTexture from, BasicTexture to, float ratio, int x, int y, int w, int h) argument
H A DGLCanvasStub.java64 float ratio, int x, int y, int w, int h) {}
66 float ratio, int x, int y, int w, int h) {}
68 float ratio, int x, int y, int width, int height, float alpha) {}
87 float ratio, RectF src, RectF target) {}
63 drawMixed(BasicTexture from, BasicTexture to, float ratio, int x, int y, int w, int h) argument
65 drawMixed(BasicTexture from, int to, float ratio, int x, int y, int w, int h) argument
67 drawMixed(BasicTexture from, BasicTexture to, float ratio, int x, int y, int width, int height, float alpha) argument
86 drawMixed(BasicTexture from, int toColor, float ratio, RectF src, RectF target) argument
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/
H A DKeyDrawParams.java116 final int dimens, final float ratio, final int defaultDimens) {
120 if (ResourceUtils.isValidFraction(ratio)) {
121 return (int)(keyHeight * ratio);
126 private static final int selectTextSize(final int keyHeight, final float ratio, argument
128 if (ResourceUtils.isValidFraction(ratio)) {
129 return (int)(keyHeight * ratio);
115 selectTextSizeFromDimensionOrRatio(final int keyHeight, final int dimens, final float ratio, final int defaultDimens) argument
/packages/apps/Gallery2/src/com/android/gallery3d/ui/
H A DGLCanvas.java97 // from * (1 - ratio) + to * ratio
100 float ratio, int x, int y, int w, int h);
103 // rectangle. The actual color used is from * (1 - ratio) + to * ratio.
107 float ratio, RectF src, RectF target);
99 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int w, int h) argument
106 drawMixed(BasicTexture from, int toColor, float ratio, RectF src, RectF target) argument
H A DGLCanvasImpl.java448 int toColor, float ratio, int x, int y, int w, int h) {
449 drawMixed(from, toColor, ratio, x, y, w, h, mAlpha);
468 private void setMixedColor(int toColor, float ratio, float alpha) { argument
471 // alpha * ((1 - ratio) * from + ratio * to)
476 // So, we have combo = alpha * (1 - ratio)
477 // and scale = alpha * ratio / (1 - combo)
479 float combo = alpha * (1 - ratio);
480 float scale = alpha * ratio / (1 - combo);
510 public void drawMixed(BasicTexture from, int toColor, float ratio, argument
447 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int w, int h) argument
544 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int width, int height, float alpha) argument
[all...]
H A DTiledTexture.java267 // a rectangle. The used color is: from * (1 - ratio) + to * ratio.
268 public void drawMixed(GLCanvas canvas, int color, float ratio, argument
281 canvas.drawMixed(t, color, ratio, mSrcRect, mDestRect);
H A DPositionController.java308 // The ratio of the old size and the new size.
310 // If the aspect ratio changes, we don't know if it is because one side
312 // angle of the longer side doesn't change (so the aspect ratio change
315 float ratio = (width > height)
323 // we change the scale directly. Otherwise adjust the scales by a ratio,
329 b.mCurrentScale *= ratio;
330 b.mFromScale *= ratio;
331 b.mToScale *= ratio;
335 mFocusX /= ratio;
336 mFocusY /= ratio;
[all...]
H A DPhotoView.java1766 // When ratio = 0, the result is from.
1767 // When ratio = 1, the result is to.
1768 private static float interpolate(float ratio, float from, float to) { argument
1769 return from + (to - from) * ratio * ratio;
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
H A DPhotoSource.java164 float ratio = (outsideRatio / insideRatio < mMaxCropRatio ?
167 while (ratio < 0.5) {
169 ratio *= 2;
179 ratio = Math.max((float) longSide / (float) rawLongSide,
182 if (Math.abs(ratio - 1.0f) > 0.001) {
183 log(TAG, "still too big, scaling down by " + ratio);
184 options.outWidth = (int) (ratio * options.outWidth);
185 options.outHeight = (int) (ratio * options.outHeight);
/packages/apps/Camera/src/com/android/camera/ui/
H A DRotateImageView.java130 float ratio = Math.min((float) width / w, (float) height / h);
131 canvas.scale(ratio, ratio, width / 2.0f, height / 2.0f);
/packages/apps/LegacyCamera/src/com/android/camera/ui/
H A DRotateImageView.java128 float ratio = Math.min((float) width / w, (float) height / h);
129 canvas.scale(ratio, ratio, width / 2.0f, height / 2.0f);
/packages/apps/Contacts/src/com/android/contacts/widget/
H A DProportionalLayout.java143 public void setRatio(float ratio) { argument
144 mRatio = ratio;
/packages/wallpapers/HoloSpiral/src/com/android/wallpaper/holospiral/
H A DHoloSpiralView.java130 float ratio = realPosition / (mWallpaperWidth * 4);
131 mWallpaperRS.setOffset(ratio, 0, 0, 0);
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/imageshow/
H A DImageZoom.java75 float ratio = (float) getWidth() / (float) getHeight();
77 float mw = ratio * mh;
/packages/apps/Launcher2/src/com/android/launcher2/
H A DUtilities.java121 final float ratio = (float) sourceWidth / sourceHeight;
123 height = (int) (width / ratio);
125 width = (int) (height * ratio);
/packages/apps/Phone/src/com/android/phone/
H A DContactsAsyncHelper.java266 float ratio = ((float) longerEdge) / iconSize;
267 int newWidth = (int) (orgWidth / ratio);
268 int newHeight = (int) (orgHeight / ratio);
276 // It is sure ratio >= 1.0f in any case and thus the newly created Bitmap
/packages/apps/Mms/src/com/android/mms/ui/
H A DSlideshowPresenter.java77 // The ratio indicates how to reduce the source to match the View,
79 float ratio = mWidthTransformRatio > mHeightTransformRatio ?
81 mWidthTransformRatio = ratio;
82 mHeightTransformRatio = ratio;
/packages/apps/Settings/src/com/android/settings/
H A DActivityPicker.java379 final float ratio = (float) iconWidth / iconHeight;
382 height = (int) (width / ratio);
384 width = (int) (height * ratio);

Completed in 2003 milliseconds

12