Calculates the coordinates of {@link android.graphics.RectF} that
are perfectly within the available window

@param offset Half the width of the pain stroke
@return The rectF
11029
private RectF getArcRect(float offset) {
        RectF workingSurface = new RectF();
        workingSurface.left = getPaddingLeft() + offset;
        workingSurface.top = getPaddingTop() + offset;
        workingSurface.right = getWidth() - getPaddingRight() - offset;
        workingSurface.bottom = getHeight() - getPaddingBottom() - offset;

        float width = workingSurface.right - workingSurface.left;
        float height = workingSurface.bottom - workingSurface.top;

        this.mDiameter = Math.min(width, height);
        float radius = mDiameter / 2;
        float centerX = width / 2;
        float centerY = height / 2;

        //float left, float top, float right, float bottom
        return new RectF(centerX - radius + offset, centerY - radius + offset, centerX + radius + offset, centerY + radius + offset);
    }
179282
public static Point getSize(byte[] byteArray, int offset, int length) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeByteArray(byteArray, offset, length, options);
        int width = options.outWidth;
        int height = options.outHeight;
        return new Point(width, height);
    }
933793
@Pure
	protected Rectangle2d calcBounds() {
		final Rectangle2d bb = new Rectangle2d();
		boolean first = true;
		Rectangle2afp<?, ?, ?, ?, ?, ?> b;

		// Child bounds
		N child;
		for (int i = 0; i < getChildCount(); ++i) {
			child = getChildAt(i);
			if (child != null) {
				b = child.getBounds();
				if (b != null) {
					if (first) {
						first = false;
						bb.setFromCorners(
								b.getMinX(),
								b.getMinY(),
								b.getMaxX(),
								b.getMaxY());
					} else {
						bb.setUnion(b);
					}
				}
			}
		}

		// Data bounds
		P primitive;
		GeoLocation location;
		for (int i = 0; i < getUserDataCount(); ++i) {
			primitive = getUserDataAt(i);
			if (primitive != null) {
				location = primitive.getGeoLocation();
				if (location != null) {
					b = location.toBounds2D();
					if (b != null) {
						if (first) {
							first = false;
							bb.setFromCorners(
									b.getMinX(),
									b.getMinY(),
									b.getMaxX(),
									b.getMaxY());
						} else {
							bb.setUnion(b);
						}
					}
				}
			}
		}

		return first ? null : bb;
	}
825814
public Rectangle getRect2() {
        verifyPropertyPresence(RECT2);
        //noinspection unchecked
        return mapToRect((Map<String, Object>) getCommandResult().get(RECT2));
    }
1924
public void getBounds(Rect bounds) {
        final int outerX = (int) mTargetX;
        final int outerY = (int) mTargetY;
        final int r = (int) mTargetRadius + 1;
        bounds.set(outerX - r, outerY - r, outerX + r, outerY + r);
    }
23065
protected Rectangle getFindButtonBounds() {
        JTextComponent c = getComponent();
        final int      x = c.getHeight() / 2 - 6;
        final int      y = c.getHeight() / 2 - 6;

        return new Rectangle(x, y, 22, 17);
    }
925027
function offset(elem) {
            elem = getRawNode(elem);

            var elemBCR = elem.getBoundingClientRect();
            return {
                width: Math.round(
                    Angular.isNumber(elemBCR.width)
                        ? elemBCR.width
                        : elem.offsetWidth
                ),
                height: Math.round(
                    Angular.isNumber(elemBCR.height)
                        ? elemBCR.height
                        : elem.offsetHeight
                ),
                top: Math.round(
                    elemBCR.top +
                        ($window.pageYOffset ||
                            $document[0].documentElement.scrollTop)
                ),
                left: Math.round(
                    elemBCR.left +
                        ($window.pageXOffset ||
                            $document[0].documentElement.scrollLeft)
                ),
            };
        }
202920
public static void getImagePosition(Matrix matrix, Settings settings, Rect out) {
        tmpRectF.set(0, 0, settings.getImageW(), settings.getImageH());

        matrix.mapRect(tmpRectF);

        final int w = Math.round(tmpRectF.width());
        final int h = Math.round(tmpRectF.height());

        // Calculating image position basing on gravity
        tmpRect1.set(0, 0, settings.getViewportW(), settings.getViewportH());
        Gravity.apply(settings.getGravity(), w, h, tmpRect1, out);
    }
289996
public static Rectangle getSelectedBounds(BufferedImage p) {
		int width = p.getWidth();
        int height = p.getHeight();
		int maxX = 0, maxY = 0, minX = width, minY = height;
		boolean anySelected = false;
		int y1;
		int [] pixels = null;
		
		for (y1 = height-1; y1 >= 0; y1--) {
			pixels = getRGB( p, 0, y1, width, 1, pixels );
			for (int x = 0; x < minX; x++) {
				if ((pixels[x] & 0xff000000) != 0) {
					minX = x;
					maxY = y1;
					anySelected = true;
					break;
				}
			}
			for (int x = width-1; x >= maxX; x--) {
				if ((pixels[x] & 0xff000000) != 0) {
					maxX = x;
					maxY = y1;
					anySelected = true;
					break;
				}
			}
			if ( anySelected )
				break;
		}
		pixels = null;
		for (int y = 0; y < y1; y++) {
			pixels = getRGB( p, 0, y, width, 1, pixels );
			for (int x = 0; x < minX; x++) {
				if ((pixels[x] & 0xff000000) != 0) {
					minX = x;
					if ( y < minY )
						minY = y;
					anySelected = true;
					break;
				}
			}
			for (int x = width-1; x >= maxX; x--) {
				if ((pixels[x] & 0xff000000) != 0) {
					maxX = x;
					if ( y < minY )
						minY = y;
					anySelected = true;
					break;
				}
			}
		}
		if ( anySelected )
			return new Rectangle( minX, minY, maxX-minX+1, maxY-minY+1 );
		return null;
	}
722295
@Override
	@Pure
	protected Rectangle2d calcBounds() {
		double x = this.getX();
		double y = this.getY();

		final double w = this.radius * 2;
		final double h = w;

		x -= w / 2.;
		y -= h / 2.;

		return new Rectangle2d(x, y, w, h);
	}
1303317
public Icon offset(int offsetX, int offsetY)
	{
		initSprite(sheetWidth, sheetHeight, getOriginX() + offsetX, getOriginY() + offsetY, isRotated());
		return this;
	}
1211077
@Override
    public C setOffset(final double x, final double y)
    {
        getAttributes().setOffset(x, y);

        return cast();
    }
976826
public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info)
    {
        // p(" --bitmap to latlon : " + coord + " " + zoom);
        double wx = pixelCoordinate.getX();
        double wy = pixelCoordinate.getY();
        // this reverses getBitmapCoordinates
        double flon = (wx - info.getMapCenterInPixelsAtZoom(zoom).getX()) / info.getLongitudeDegreeWidthInPixels(zoom);
        double e1 = (wy - info.getMapCenterInPixelsAtZoom(zoom).getY())
                / (-1 * info.getLongitudeRadianWidthInPixels(zoom));
        double e2 = (2 * Math.atan(Math.exp(e1)) - Math.PI / 2) / (Math.PI / 180.0);
        double flat = e2;
        GeoPosition wc = new GeoPosition(flat, flon);
        return wc;
    }
1082206
protected double extractOffsetPosition(Element target) {
        double offsetTop = $(target).offset().top;
        double containerHeight = $(containerElement).height();
        switch (getOffsetPosition()) {
            case MIDDLE:
                offsetTop = offsetTop - (containerHeight / 2) + ($(target).height() / 2);
                break;
            case BOTTOM:
                offsetTop = (offsetTop - containerHeight) + $(target).height();
                break;
        }

        return offsetTop;
    }
856185
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
	@Override
	int calculateEndLeftBound(float xAxisDelta) {
		return (int) (getView().getX() + xAxisDelta);
	}
783639
@Override
    public T setOffset(final double x, final double y)
    {
        getAttributes().setOffset(x, y);

        return cast();
    }
409349
public long getOffset() throws IOException {
        if (offset == null) {
            read();
            SectionTable table = data.getSectionTable();
            SectionLoader loader = new SectionLoader(data);
            offset = 0L;
            List<SectionHeader> headers = table.getSectionHeaders();
            // TODO low alingment check instead?
//            if (headers.size() == 0) { // offset for sectionless PE's
//                offset = file.length();
//            }
            for (SectionHeader section : headers) {
                long alignedPointerToRaw = section.getAlignedPointerToRaw();
                long readSize = loader.getReadSize(section);
                // ignore invalid sections
                // corkami: "if a section starts at [unaligned] offset 0, it's invalid."
                if (readSize == 0 || section.get(SectionHeaderKey.POINTER_TO_RAW_DATA) == 0) {
                    continue;
                }
                long endPoint = readSize + alignedPointerToRaw;
                if (offset < endPoint) { // determine largest endPoint
                    offset = endPoint;
                }
            }
        }
        if (offset > file.length() || offset == 0) {
            offset = file.length();
        }
        return offset;
    }