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.

ZXMonochromeRectangleDetector.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. @class ZXBitMatrix;
  17. /**
  18. * A somewhat generic detector that looks for a barcode-like rectangular region within an image.
  19. * It looks within a mostly white region of an image for a region of black and white, but mostly
  20. * black. It returns the four corners of the region, as best it can determine.
  21. */
  22. @interface ZXMonochromeRectangleDetector : NSObject
  23. - (id)initWithImage:(ZXBitMatrix *)image;
  24. /**
  25. * Detects a rectangular region of black and white -- mostly black -- with a region of mostly
  26. * white, in an image.
  27. *
  28. * @return ZXResultPoint array describing the corners of the rectangular region. The first and
  29. * last points are opposed on the diagonal, as are the second and third. The first point will be
  30. * the topmost point and the last, the bottommost. The second point will be leftmost and the
  31. * third, the rightmost
  32. * @return nil if no Data Matrix Code can be found
  33. */
  34. - (NSArray *)detectWithError:(NSError **)error;
  35. @end