PlanarYUVLuminanceSource.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import LuminanceSource from './LuminanceSource';
  2. /**
  3. * This object extends LuminanceSource around an array of YUV data returned from the camera driver,
  4. * with the option to crop to a rectangle within the full data. This can be used to exclude
  5. * superfluous pixels around the perimeter and speed up decoding.
  6. *
  7. * It works for any pixel format where the Y channel is planar and appears first, including
  8. * YCbCr_420_SP and YCbCr_422_SP.
  9. *
  10. * @author dswitkin@google.com (Daniel Switkin)
  11. */
  12. export default class PlanarYUVLuminanceSource extends LuminanceSource {
  13. private yuvData;
  14. private dataWidth;
  15. private dataHeight;
  16. private left;
  17. private top;
  18. private static THUMBNAIL_SCALE_FACTOR;
  19. constructor(yuvData: Uint8ClampedArray, dataWidth: number, dataHeight: number, left: number, top: number, width: number, height: number, reverseHorizontal: boolean);
  20. getRow(y: number, row?: Uint8ClampedArray): Uint8ClampedArray;
  21. getMatrix(): Uint8ClampedArray;
  22. isCropSupported(): boolean;
  23. crop(left: number, top: number, width: number, height: number): LuminanceSource;
  24. renderThumbnail(): Int32Array;
  25. /**
  26. * @return width of image from {@link #renderThumbnail()}
  27. */
  28. getThumbnailWidth(): number;
  29. /**
  30. * @return height of image from {@link #renderThumbnail()}
  31. */
  32. getThumbnailHeight(): number;
  33. private reverseHorizontal;
  34. invert(): LuminanceSource;
  35. }