qrencode_inner.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * qrencode - QR Code encoder
  3. *
  4. * Header for test use
  5. * Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef QRENCODE_INNER_H
  22. #define QRENCODE_INNER_H
  23. /**
  24. * This header file includes definitions for test use.
  25. */
  26. /******************************************************************************
  27. * Raw code
  28. *****************************************************************************/
  29. typedef struct {
  30. int dataLength;
  31. int eccLength;
  32. unsigned char *data;
  33. unsigned char *ecc;
  34. } RSblock;
  35. typedef struct {
  36. int version;
  37. int dataLength;
  38. int eccLength;
  39. unsigned char *datacode;
  40. unsigned char *ecccode;
  41. int b1;
  42. int blocks;
  43. RSblock *rsblock;
  44. int count;
  45. } QRRawCode;
  46. extern QRRawCode *QRraw_new(QRinput *input);
  47. extern unsigned char QRraw_getCode(QRRawCode *raw);
  48. extern void QRraw_free(QRRawCode *raw);
  49. /******************************************************************************
  50. * Raw code for Micro QR Code
  51. *****************************************************************************/
  52. typedef struct {
  53. int version;
  54. int dataLength;
  55. int eccLength;
  56. unsigned char *datacode;
  57. unsigned char *ecccode;
  58. RSblock *rsblock;
  59. int oddbits;
  60. int count;
  61. } MQRRawCode;
  62. extern MQRRawCode *MQRraw_new(QRinput *input);
  63. extern unsigned char MQRraw_getCode(MQRRawCode *raw);
  64. extern void MQRraw_free(MQRRawCode *raw);
  65. /******************************************************************************
  66. * Frame filling
  67. *****************************************************************************/
  68. extern unsigned char *FrameFiller_test(int version);
  69. extern unsigned char *FrameFiller_testMQR(int version);
  70. /******************************************************************************
  71. * QR-code encoding
  72. *****************************************************************************/
  73. extern QRcode *QRcode_encodeMask(QRinput *input, int mask);
  74. extern QRcode *QRcode_encodeMaskMQR(QRinput *input, int mask);
  75. extern QRcode *QRcode_new(int version, int width, unsigned char *data);
  76. #endif /* QRENCODE_INNER_H */