Lines Matching defs:width

259      * Common code for checking that width and height are > 0
261 * @param width width to ensure is > 0
264 private static void checkWidthHeight(int width, int height) {
265 if (width <= 0) {
266 throw new IllegalArgumentException("width must be > 0");
438 * specified width and height are the same as the current width and height of
443 * @param dstWidth The new bitmap's desired width.
461 final int width = src.getWidth();
463 final float sx = dstWidth / (float)width;
466 Bitmap b = Bitmap.createBitmap(src, 0, 0, width, height, m, filter);
496 * @param width The number of pixels in each row
500 public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height) {
501 return createBitmap(source, x, y, width, height, null, false);
517 * @param width The number of pixels in each row
524 * @throws IllegalArgumentException if the x, y, width, height values are
527 public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height,
531 checkWidthHeight(width, height);
532 if (x + width > source.getWidth()) {
533 throw new IllegalArgumentException("x + width must be <= bitmap.width()");
540 if (!source.isMutable() && x == 0 && y == 0 && width == source.getWidth() &&
545 int neww = width;
551 Rect srcR = new Rect(x, y, x + width, y + height);
552 RectF dstR = new RectF(0, 0, width, height);
583 neww = Math.round(deviceR.width());
611 * Returns a mutable bitmap with the specified width and height. Its
614 * @param width The width of the bitmap
617 * @throws IllegalArgumentException if the width or height are <= 0
619 public static Bitmap createBitmap(int width, int height, Config config) {
620 return createBitmap(width, height, config, true);
624 * Returns a mutable bitmap with the specified width and height. Its
627 * @param width The width of the bitmap
634 * @throws IllegalArgumentException if the width or height are <= 0
636 private static Bitmap createBitmap(int width, int height, Config config, boolean hasAlpha) {
637 if (width <= 0 || height <= 0) {
638 throw new IllegalArgumentException("width and height must be > 0");
640 Bitmap bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true);
654 * Returns a immutable bitmap with the specified width and height, with each
662 * width or <= -width).
663 * @param width The width of the bitmap
668 * @throws IllegalArgumentException if the width or height are <= 0, or if
672 int width, int height, Config config) {
674 checkWidthHeight(width, height);
675 if (Math.abs(stride) < width) {
676 throw new IllegalArgumentException("abs(stride) must be >= width");
680 if (offset < 0 || (offset + width > length) || lastScanline < 0 ||
681 (lastScanline + width > length)) {
684 if (width <= 0 || height <= 0) {
685 throw new IllegalArgumentException("width and height must be > 0");
687 return nativeCreate(colors, offset, stride, width, height,
692 * Returns a immutable bitmap with the specified width and height, with each
697 * This array must be at least as large as width * height.
698 * @param width The width of the bitmap
703 * @throws IllegalArgumentException if the width or height are <= 0, or if
706 public static Bitmap createBitmap(int colors[], int width, int height, Config config) {
707 return createBitmap(colors, 0, width, width, height, config);
783 /** Returns the bitmap's width */
826 * Convenience method that returns the width of this bitmap divided
830 * @return The scaled width of this bitmap, according to the density scale factor.
928 * if x or y are out of bounds (negative or >= to the width or height
931 * @param x The x coordinate (0...width-1) of the pixel to return
946 * rows. For normal packed results, just pass width for the stride value.
951 * rows (must be >= bitmap's width). Can be negative.
956 * @param width The number of pixels to read from each row
958 * @throws IllegalArgumentException if x, y, width, height exceed the
959 * bounds of the bitmap, or if abs(stride) < width.
964 int x, int y, int width, int height) {
966 if (width == 0 || height == 0) {
969 checkPixelsAccess(x, y, width, height, offset, stride, pixels);
971 x, y, width, height);
983 throw new IllegalArgumentException("x must be < bitmap.width()");
996 * @param width width of the area of pixels to access
1002 private void checkPixelsAccess(int x, int y, int width, int height,
1005 if (width < 0) {
1006 throw new IllegalArgumentException("width must be >= 0");
1011 if (x + width > getWidth()) {
1013 "x + width must be <= bitmap.width()");
1019 if (Math.abs(stride) < width) {
1020 throw new IllegalArgumentException("abs(stride) must be >= width");
1024 if (offset < 0 || (offset + width > length)
1026 || (lastScanline + width > length)) {
1035 * @param x The x coordinate of the pixel to replace (0...width-1)
1058 * Normally this value will be the same as the width of
1064 * @param width The number of colors to copy from pixels[] per row
1067 * @throws IllegalArgumentException if x, y, width, height are outside of
1073 int x, int y, int width, int height) {
1078 if (width == 0 || height == 0) {
1081 checkPixelsAccess(x, y, width, height, offset, stride, pixels);
1083 x, y, width, height);
1218 int stride, int width, int height,
1238 int y, int width, int height);
1244 int y, int width, int height);