Lines Matching refs:opts

380      * @param opts null-ok; Options that control downsampling and whether the
383 * decoded, or, if opts is non-null, if opts requested only the
384 * size be returned (in opts.outWidth and opts.outHeight)
386 public static Bitmap decodeFile(String pathName, Options opts) {
391 bm = decodeStream(stream, null, opts);
425 InputStream is, Rect pad, Options opts) {
427 if (opts == null) {
428 opts = new Options();
431 if (opts.inDensity == 0 && value != null) {
434 opts.inDensity = DisplayMetrics.DENSITY_DEFAULT;
436 opts.inDensity = density;
440 if (opts.inTargetDensity == 0 && res != null) {
441 opts.inTargetDensity = res.getDisplayMetrics().densityDpi;
444 return decodeStream(is, pad, opts);
453 * @param opts null-ok; Options that control downsampling and whether the
456 * decoded, or, if opts is non-null, if opts requested only the
457 * size be returned (in opts.outWidth and opts.outHeight)
459 public static Bitmap decodeResource(Resources res, int id, Options opts) {
467 bm = decodeResourceStream(res, value, is, null, opts);
481 if (bm == null && opts != null && opts.inBitmap != null) {
507 * @param opts null-ok; Options that control downsampling and whether the
510 * decoded, or, if opts is non-null, if opts requested only the
511 * size be returned (in opts.outWidth and opts.outHeight)
513 public static Bitmap decodeByteArray(byte[] data, int offset, int length, Options opts) {
522 bm = nativeDecodeByteArray(data, offset, length, opts);
524 if (bm == null && opts != null && opts.inBitmap != null) {
527 setDensityFromOptions(bm, opts);
551 private static void setDensityFromOptions(Bitmap outputBitmap, Options opts) {
552 if (outputBitmap == null || opts == null) return;
554 final int density = opts.inDensity;
557 final int targetDensity = opts.inTargetDensity;
558 if (targetDensity == 0 || density == targetDensity || density == opts.inScreenDensity) {
564 if (opts.inScaled || isNinePatch) {
567 } else if (opts.inBitmap != null) {
585 * @param opts null-ok; Options that control downsampling and whether the
588 * decoded, or, if opts is non-null, if opts requested only the
589 * size be returned (in opts.outWidth and opts.outHeight)
596 public static Bitmap decodeStream(InputStream is, Rect outPadding, Options opts) {
609 bm = nativeDecodeAsset(asset, outPadding, opts);
611 bm = decodeStreamInternal(is, outPadding, opts);
614 if (bm == null && opts != null && opts.inBitmap != null) {
618 setDensityFromOptions(bm, opts);
630 private static Bitmap decodeStreamInternal(InputStream is, Rect outPadding, Options opts) {
633 if (opts != null) tempStorage = opts.inTempStorage;
635 return nativeDecodeStream(is, tempStorage, outPadding, opts);
662 * @param opts null-ok; Options that control downsampling and whether the
666 public static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, Options opts) {
672 bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
676 bm = decodeStreamInternal(fis, outPadding, opts);
684 if (bm == null && opts != null && opts.inBitmap != null) {
688 setDensityFromOptions(bm, opts);
708 Rect padding, Options opts);
710 Rect padding, Options opts);
711 private static native Bitmap nativeDecodeAsset(long nativeAsset, Rect padding, Options opts);
713 int length, Options opts);