You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ZXPlanarYUVLuminanceSource.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2012 ZXing authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "ZXLuminanceSource.h"
  17. /**
  18. * This object extends LuminanceSource around an array of YUV data returned from the camera driver,
  19. * with the option to crop to a rectangle within the full data. This can be used to exclude
  20. * superfluous pixels around the perimeter and speed up decoding.
  21. *
  22. * It works for any pixel format where the Y channel is planar and appears first, including
  23. * YCbCr_420_SP and YCbCr_422_SP.
  24. */
  25. @interface ZXPlanarYUVLuminanceSource : ZXLuminanceSource
  26. /**
  27. * @return width of image from renderThumbnail
  28. */
  29. @property (nonatomic, assign, readonly) int thumbnailWidth;
  30. /**
  31. * @return height of image from renderThumbnail
  32. */
  33. @property (nonatomic, assign, readonly) int thumbnailHeight;
  34. - (id)initWithYuvData:(int8_t *)yuvData yuvDataLen:(int)yuvDataLen dataWidth:(int)dataWidth
  35. dataHeight:(int)dataHeight left:(int)left top:(int)top width:(int)width height:(int)height
  36. reverseHorizontal:(BOOL)reverseHorizontal;
  37. - (int32_t *)renderThumbnail;
  38. @end