Code example for Rect

Methods: heightwidth

0
      case PixelFormat.YCbCr_420_SP:
      // This format has never been seen in the wild, but is compatible as we only care 
      // about the Y channel, so allow it. 
      case PixelFormat.YCbCr_422_SP:
        return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top,
            rect.width(), rect.height());
      default: 
        // The Samsung Moment incorrectly uses this variant instead of the 'sp' version. 
        // Fortunately, it too has all the Y data up front, so we can read it. 
        if ("yuv420p".equals(previewFormatString)) {
          return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top,
            rect.width(), rect.height());
        } 
    } 
    throw new IllegalArgumentException("Unsupported picture format: " +
        previewFormat + '/' + previewFormatString);
  } 
 
	public Context getContext() {
		return context;
	}