lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** |
| 2 | * qrencode - QR Code encoder |
| 3 | * |
| 4 | * Header for test use |
| 5 | * Copyright (C) 2006-2011 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 | |
| 22 | #ifndef __QRENCODE_INNER_H__ |
| 23 | #define __QRENCODE_INNER_H__ |
| 24 | |
| 25 | /** |
| 26 | * This header file includes definitions for test use. |
| 27 | */ |
| 28 | |
| 29 | /****************************************************************************** |
| 30 | * Raw code |
| 31 | *****************************************************************************/ |
| 32 | |
| 33 | typedef struct { |
| 34 | int dataLength; |
| 35 | unsigned char *data; |
| 36 | int eccLength; |
| 37 | unsigned char *ecc; |
| 38 | } RSblock; |
| 39 | |
| 40 | typedef struct { |
| 41 | int version; |
| 42 | int dataLength; |
| 43 | int eccLength; |
| 44 | unsigned char *datacode; |
| 45 | unsigned char *ecccode; |
| 46 | int b1; |
| 47 | int blocks; |
| 48 | RSblock *rsblock; |
| 49 | int count; |
| 50 | } QRRawCode; |
| 51 | |
| 52 | extern QRRawCode *QRraw_new(QRinput *input); |
| 53 | extern unsigned char QRraw_getCode(QRRawCode *raw); |
| 54 | extern void QRraw_free(QRRawCode *raw); |
| 55 | |
| 56 | /****************************************************************************** |
| 57 | * Raw code for Micro QR Code |
| 58 | *****************************************************************************/ |
| 59 | |
| 60 | typedef struct { |
| 61 | int version; |
| 62 | int dataLength; |
| 63 | int eccLength; |
| 64 | unsigned char *datacode; |
| 65 | unsigned char *ecccode; |
| 66 | RSblock *rsblock; |
| 67 | int oddbits; |
| 68 | int count; |
| 69 | } MQRRawCode; |
| 70 | |
| 71 | extern MQRRawCode *MQRraw_new(QRinput *input); |
| 72 | extern unsigned char MQRraw_getCode(MQRRawCode *raw); |
| 73 | extern void MQRraw_free(MQRRawCode *raw); |
| 74 | |
| 75 | /****************************************************************************** |
| 76 | * Frame filling |
| 77 | *****************************************************************************/ |
| 78 | extern unsigned char *FrameFiller_test(int version); |
| 79 | extern unsigned char *FrameFiller_testMQR(int version); |
| 80 | |
| 81 | /****************************************************************************** |
| 82 | * QR-code encoding |
| 83 | *****************************************************************************/ |
| 84 | extern QRcode *QRcode_encodeMask(QRinput *input, int mask); |
| 85 | extern QRcode *QRcode_encodeMaskMQR(QRinput *input, int mask); |
| 86 | extern QRcode *QRcode_new(int version, int width, unsigned char *data); |
| 87 | |
| 88 | #endif /* __QRENCODE_INNER_H__ */ |