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.

ZXWhiteRectangleDetector.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "ZXResultPoint.h"
  17. #import "ZXBitMatrix.h"
  18. /**
  19. * Detects a candidate barcode-like rectangular region within an image. It
  20. * starts around the center of the image, increases the size of the candidate
  21. * region until it finds a white rectangular region. By keeping track of the
  22. * last black points it encountered, it determines the corners of the barcode.
  23. */
  24. @interface ZXWhiteRectangleDetector : NSObject
  25. - (id)initWithImage:(ZXBitMatrix *)image error:(NSError **)error;
  26. - (id)initWithImage:(ZXBitMatrix *)image initSize:(int)initSize x:(int)x y:(int)y error:(NSError **)error;
  27. /**
  28. * Detects a candidate barcode-like rectangular region within an image. It
  29. * starts around the center of the image, increases the size of the candidate
  30. * region until it finds a white rectangular region.
  31. *
  32. * @return {@link ResultPoint}[] describing the corners of the rectangular
  33. * region. The first and last points are opposed on the diagonal, as
  34. * are the second and third. The first point will be the topmost
  35. * point and the last, the bottommost. The second point will be
  36. * leftmost and the third, the rightmost
  37. * @return nil if no Data Matrix Code can be found
  38. */
  39. - (NSArray *)detectWithError:(NSError **)error;
  40. @end