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.

ZXReader.h 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 ZXBinaryBitmap, ZXDecodeHints, ZXResult;
  17. /**
  18. * Implementations of this interface can decode an image of a barcode in some format into
  19. * the String it encodes. For example, ZXQRCodeReader can
  20. * decode a QR code. The decoder may optionally receive hints from the caller which may help
  21. * it decode more quickly or accurately.
  22. *
  23. * See ZXMultiFormatReader, which attempts to determine what barcode
  24. * format is present within the image as well, and then decodes it accordingly.
  25. */
  26. @protocol ZXReader <NSObject>
  27. /**
  28. * Locates and decodes a barcode in some format within an image.
  29. *
  30. * @param image image of barcode to decode
  31. * @return String which the barcode encodes or nil if
  32. * the barcode cannot be located or decoded for any reason
  33. */
  34. - (ZXResult *)decode:(ZXBinaryBitmap *)image error:(NSError **)error;
  35. /**
  36. * Locates and decodes a barcode in some format within an image. This method also accepts
  37. * hints, each possibly associated to some data, which may help the implementation decode.
  38. *
  39. * @param image image of barcode to decode
  40. * @param hints passed as a {@link java.util.Map} from {@link com.google.zxing.DecodeHintType}
  41. * to arbitrary data. The
  42. * meaning of the data depends upon the hint type. The implementation may or may not do
  43. * anything with these hints.
  44. * @return String which the barcode encodes or nil if
  45. * the barcode cannot be located or decoded for any reason
  46. */
  47. - (ZXResult *)decode:(ZXBinaryBitmap *)image hints:(ZXDecodeHints *)hints error:(NSError **)error;
  48. /**
  49. * Resets any internal state the implementation has after a decode, to prepare it
  50. * for reuse.
  51. */
  52. - (void)reset;
  53. @end