Searched refs:ratio (Results 1 - 25 of 33) 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/DeskClock/src/com/android/alarmclock/
H A DWidgetUtils.java60 float ratio = (density * minWidth) / res.getDimension(R.dimen.min_digital_widget_width);
65 ratio = Math.min(ratio, getHeightScaleRatio(context, options, id));
67 return (ratio > 1) ? 1 : ratio;
92 // Ensure divisor for ratio is positive number
94 float ratio = ((density * minHeight) - lblBox)
96 return (ratio > 1) ? 1 : ratio;
H A DDigitalAppWidgetProvider.java96 float ratio = WidgetUtils.getScaleRatio(context, null, appWidgetId);
98 WidgetUtils.setClockSize(context, widget, ratio);
140 float ratio = WidgetUtils.getScaleRatio(context, null, appWidgetId);
141 updateClock(context, appWidgetManager, appWidgetId, ratio);
151 float ratio = WidgetUtils.getScaleRatio(context, newOptions, appWidgetId);
153 updateClock(context, widgetManager, appWidgetId, ratio);
157 Context context, AppWidgetManager appWidgetManager, int appWidgetId, float ratio) {
172 WidgetUtils.setClockSize(context, widget, ratio);
156 updateClock( Context context, AppWidgetManager appWidgetManager, int appWidgetId, float ratio) argument
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/
H A DKeyDrawParams.java117 final int dimens, final float ratio, final int defaultDimens) {
121 if (ResourceUtils.isValidFraction(ratio)) {
122 return (int)(keyHeight * ratio);
127 private static final int selectTextSize(final int keyHeight, final float ratio, argument
129 if (ResourceUtils.isValidFraction(ratio)) {
130 return (int)(keyHeight * ratio);
116 selectTextSizeFromDimensionOrRatio(final int keyHeight, final int dimens, final float ratio, final int defaultDimens) argument
/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();
70 if (mAspectRatio != ratio) {
71 mAspectRatio = ratio;
94 // 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/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/Camera2/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/ContactsCommon/src/com/android/contacts/common/widget/
H A DProportionalLayout.java143 public void setRatio(float ratio) { argument
144 mRatio = ratio;
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/
H A DGLCanvas.java109 // from * (1 - ratio) + to * ratio
112 float ratio, int x, int y, int w, int h);
115 // rectangle. The actual color used is from * (1 - ratio) + to * ratio.
119 float ratio, RectF src, RectF target);
111 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int w, int h) argument
118 drawMixed(BasicTexture from, int toColor, float ratio, RectF src, RectF target) argument
H A DGLES11Canvas.java451 int toColor, float ratio, int x, int y, int w, int h) {
452 drawMixed(from, toColor, ratio, x, y, w, h, mAlpha);
471 private void setMixedColor(int toColor, float ratio, float alpha) { argument
474 // alpha * ((1 - ratio) * from + ratio * to)
479 // So, we have combo = alpha * (1 - ratio)
480 // and scale = alpha * ratio / (1 - combo)
482 float combo = alpha * (1 - ratio);
483 float scale = alpha * ratio / (1 - combo);
513 public void drawMixed(BasicTexture from, int toColor, float ratio, argument
450 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int w, int h) argument
547 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int width, int height, float alpha) argument
[all...]
H A DTiledTexture.java275 // a rectangle. The used color is: from * (1 - ratio) + to * ratio.
276 public void drawMixed(GLCanvas canvas, int color, float ratio, argument
289 canvas.drawMixed(t, color, ratio, mSrcRect, mDestRect);
/packages/apps/Launcher3/WallpaperPicker/src/com/android/gallery3d/glrenderer/
H A DGLCanvas.java107 // from * (1 - ratio) + to * ratio
110 float ratio, int x, int y, int w, int h);
113 // rectangle. The actual color used is from * (1 - ratio) + to * ratio.
117 float ratio, RectF src, RectF target);
109 drawMixed(BasicTexture from, int toColor, float ratio, int x, int y, int w, int h) argument
116 drawMixed(BasicTexture from, int toColor, float ratio, RectF src, RectF target) argument
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
H A DPhotoSource.java180 float ratio = (outsideRatio / insideRatio < mMaxCropRatio ?
183 while (ratio < 0.5) {
185 ratio *= 2;
203 ratio = Math.max((float) longSide / (float) rawLongSide,
206 if (Math.abs(ratio - 1.0f) > 0.001) {
207 log(TAG, "still too big, scaling down by " + ratio);
208 options.outWidth = (int) (ratio * options.outWidth);
209 options.outHeight = (int) (ratio * options.outHeight);
/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/InCallUI/src/com/android/incallui/
H A DContactsAsyncHelper.java251 float ratio = ((float) longerEdge) / iconSize;
252 int newWidth = (int) (orgWidth / ratio);
253 int newHeight = (int) (orgHeight / ratio);
261 // It is sure ratio >= 1.0f in any case and thus the newly created Bitmap
/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/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/services/Telephony/src/com/android/phone/
H A DContactsAsyncHelper.java282 float ratio = ((float) longerEdge) / iconSize;
283 int newWidth = (int) (orgWidth / ratio);
284 int newHeight = (int) (orgHeight / ratio);
292 // It is sure ratio >= 1.0f in any case and thus the newly created Bitmap
/packages/apps/UnifiedEmail/src/com/android/mail/ui/
H A DAttachmentTile.java177 // ratio of the image
178 final float ratio = Math.min((float) width / height, (float) height / width);
184 ratio < skinnyThresholdRatio &&
/packages/apps/Launcher3/src/com/android/launcher3/
H A DUtilities.java155 final float ratio = (float) sourceWidth / sourceHeight;
157 height = (int) (width / ratio);
159 width = (int) (height * 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);
/packages/apps/Camera2/src/com/android/camera/util/
H A DCameraUtil.java508 // Try to find an size match aspect ratio and size
511 double ratio = (double) size.x / size.y;
512 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
518 // Cannot find the one match the aspect ratio. This should not happen.
521 Log.w(TAG, "No preview size match the aspect ratio");
534 // Returns the largest picture size which matches the given aspect ratio.
543 // Try to find a size matches aspect ratio and has the largest width
545 double ratio = (double) size.width / size.height;
546 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
552 // Cannot find one that matches the aspect ratio
[all...]

Completed in 911 milliseconds

12