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.

ZXQRCodeAlignmentPatternFinder.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. @protocol ZXResultPointCallback;
  17. @class ZXBitMatrix, ZXQRCodeAlignmentPattern;
  18. /**
  19. * This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder
  20. * patterns but are smaller and appear at regular intervals throughout the image.
  21. *
  22. * At the moment this only looks for the bottom-right alignment pattern.
  23. *
  24. * This is mostly a simplified copy of {@link FinderPatternFinder}. It is copied,
  25. * pasted and stripped down here for maximum performance but does unfortunately duplicate
  26. * some code.
  27. *
  28. * This class is thread-safe but not reentrant. Each thread must allocate its own object.
  29. */
  30. @interface ZXQRCodeAlignmentPatternFinder : NSObject
  31. /**
  32. * Creates a finder that will look in a portion of the whole image.
  33. *
  34. * @param image image to search
  35. * @param startX left column from which to start searching
  36. * @param startY top row from which to start searching
  37. * @param width width of region to search
  38. * @param height height of region to search
  39. * @param moduleSize estimated module size so far
  40. */
  41. - (id)initWithImage:(ZXBitMatrix *)image startX:(int)startX startY:(int)startY width:(int)width height:(int)height moduleSize:(float)moduleSize resultPointCallback:(id<ZXResultPointCallback>)resultPointCallback;
  42. /**
  43. * This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since
  44. * it's pretty performance-critical and so is written to be fast foremost.
  45. *
  46. * @return ZXAlignmentPattern if found or nil if not found
  47. */
  48. - (ZXQRCodeAlignmentPattern *)findWithError:(NSError **)error;
  49. @end