Gets the mouse scaling factor that is used for mouse events. The actual texture may be a different size, but this is
        typically the size of the underlying UI in pixels.
495463
def getOverlayMouseScale(self, ulOverlayHandle):
        

        fn = self.function_table.getOverlayMouseScale
        pvecMouseScale = HmdVector2_t()
        result = fn(ulOverlayHandle, byref(pvecMouseScale))
        return result, pvecMouseScale
1226689
public static int getScreenWidth(final GraphicsDevice graphicsDevice)
	{
		final GraphicsConfiguration[] graphicsConfigurations = graphicsDevice.getConfigurations();
		final GraphicsConfiguration graphicsConfiguration = ArrayExtensions
			.getFirst(graphicsConfigurations);
		if (graphicsConfiguration != null)
		{
			final Rectangle bounds = graphicsConfiguration.getBounds();
			final double width = bounds.getWidth();
			return (int)width;
		}
		return getScreenWidth();
	}
309084
public static int pixelYToTileYWithScaleFactor(double pixelY, double scaleFactor, int tileSize) {
        return (int) Math.min(Math.max(pixelY / tileSize, 0), scaleFactor - 1);
    }
486193
function() {
        var matrix;
        if (!this.matrixIds || this.matrixIds.length === 0) {
            matrix = {identifier: this.getIdentifier()};
        } else {
            // get appropriate matrix given the map scale if possible
            if ("scaleDenominator" in this.matrixIds[0]) {
                // scale denominator calculation based on WMTS spec
                var denom = 
                    OpenLayers.METERS_PER_INCH * 
                    OpenLayers.INCHES_PER_UNIT[this.units] * 
                    this.getServerResolution() / 0.28E-3;
                var diff = Number.POSITIVE_INFINITY;
                var delta;
                for (var i=0, ii=this.matrixIds.length; i<ii; ++i) {
                    delta = Math.abs(1 - (this.matrixIds[i].scaleDenominator / denom));
                    if (delta < diff) {
                        diff = delta;
                        matrix = this.matrixIds[i];
                    }
                }
            } else {
                // fall back on zoom as index
                matrix = this.matrixIds[this.getIdentifier()];
            }
        }
        return matrix;
    }
186729
@Override
    public int getIconWidth(SynthContext context) {
        if (context == null) {
            return width;
        }

        JComponent c = context.getComponent();

        if (c instanceof JToolBar && ((JToolBar) c).getOrientation() == JToolBar.VERTICAL) {

            // we only do the -1 hack for UIResource borders, assuming
            // that the border is probably going to be our border
            if (c.getBorder() instanceof UIResource) {
                return c.getWidth() - 1;
            } else {
                return c.getWidth();
            }
        } else {
            return scale(context, width);
        }
    }
455965
def _get_scaled_image(self, resource):
        
        image = self._get_image()
        original_width, original_height = resource.size

        k = image.size[0] / float(image.size[1])

        if image.size[0] >= image.size[1]:
            target_width = int(original_width * self.size)
            target_height = int(target_width / k)
        else:
            target_height = int(original_height * self.size)
            target_width = int(target_height * k)

        image = image.resize((target_width, target_height), Image.ANTIALIAS)

        return image
469783
def scale_view(self, x, y):
        
        d = self.declaration
        factor = self.widget.transform().scale(x, y).mapRect(
            QRectF(0, 0, 1, 1)).width()
        if (d.min_zoom > factor > d.max_zoom):
            return
        self.widget.scale(x, y)
        return factor
910032
@Override
    public int getIconHeight(SynthContext context) {
        if (context == null) {
            return height;
        }

        JComponent c = context.getComponent();

        if (c instanceof JToolBar) {
            JToolBar toolbar = (JToolBar) c;

            if (toolbar.getOrientation() == JToolBar.HORIZONTAL) {

                // we only do the -1 hack for UIResource borders, assuming
                // that the border is probably going to be our border
                if (toolbar.getBorder() instanceof UIResource) {
                    return c.getHeight() - 1;
                } else {
                    return c.getHeight();
                }
            } else {
                return scale(context, width);
            }
        } else {
            return scale(context, height);
        }
    }
455401
private float displayDensityAdjusted() {
		open.mLock.lock();
		try {
			if (open.mCameraSize == null)
				return displayMetrics.density;

			int rotation = getWindowManager().getDefaultDisplay().getRotation();
			int screenWidth = (rotation == 0 || rotation == 2) ? displayMetrics.widthPixels : displayMetrics.heightPixels;
			int cameraWidth = open.mSensorOrientation == 0 || open.mSensorOrientation == 180 ?
					open.mCameraSize.getWidth() : open.mCameraSize.getHeight();

			return displayMetrics.density * cameraWidth / screenWidth;
		} finally {
			open.mLock.unlock();
		}
	}
1149319
public static int scale(Double factor, int pixel) {
        return rgb(
                (int) Math.round(factor * red(pixel)),
                (int) Math.round(factor * green(pixel)),
                (int) Math.round(factor * blue(pixel))
        );
    }
1056389
public static double getPixelYSize(BoundingBox webMercatorBoundingBox,
			long matrixHeight, int tileHeight) {
		double pixelYSize = (webMercatorBoundingBox.getMaxLatitude() - webMercatorBoundingBox
				.getMinLatitude()) / matrixHeight / tileHeight;
		return pixelYSize;
	}
742757
def get_device_scale(self):
        
        size = ffi.new('double[2]')
        cairo.cairo_surface_get_device_scale(self._pointer, size + 0, size + 1)
        return tuple(size)
1173908
def get_dpi():
    """"""

    def pxmm_2_dpi((pixels, length_mm)):
        return pixels * 25.6 / length_mm

    return map(pxmm_2_dpi, zip(wx.GetDisplaySize(), wx.GetDisplaySizeMM()))
919861
function(context){
		var chart = this;
		this.canvas = context.canvas;

		this.ctx = context;

		//Variables global to the chart
		var computeDimension = function(element,dimension)
		{
			if (element['offset'+dimension])
			{
				return element['offset'+dimension];
			}
			else
			{
				return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);
			}
		};

		var width = this.width = computeDimension(context.canvas,'Width') || context.canvas.width;
		var height = this.height = computeDimension(context.canvas,'Height') || context.canvas.height;

		this.aspectRatio = this.width / this.height;
		//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
		helpers.retinaScale(this);

		return this;
	}
1272679
protected int getResolutionIndex(double resolution) {
		if (layer instanceof TileBasedLayer) {
			return ((TileBasedLayer) layer).getTileConfiguration().getResolutionIndex(resolution);
		}
		return viewPort.getResolutionIndex(resolution);
	}
412736
static DisplayMetrics getDisplayMetrics(final Context context) {
    final WindowManager
        windowManager =
        (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    final DisplayMetrics metrics = new DisplayMetrics();
    windowManager.getDefaultDisplay().getMetrics(metrics);
    return metrics;
  }
1133073
public static int getPixelFromDp(Context context, int dp) {
		// Get the screen's density scale		
		float scale = context.getResources().getDisplayMetrics().density;

		// Convert the dps to pixels, based on density scale
		// because dp*scale is cast as an integer value, this will cause the result to be truncated.
		// Therefore, Adding ROUND_FACTOR helps the result to have properly rounded integer value.
		return (int)(dp * scale + ROUND_FACTOR);
	}