Zoltan Hudak / zbar

Dependents:   BarcodeReader_F103

Committer:
hudakz
Date:
Fri Jan 10 22:06:18 2020 +0000
Revision:
1:4f5c042a2d34
Parent:
0:e33621169e44
Streamlined barcode reader library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:e33621169e44 1 /*------------------------------------------------------------------------
hudakz 0:e33621169e44 2 * Copyright 2008-2009 (c) Jeff Brown <spadix@users.sourceforge.net>
hudakz 0:e33621169e44 3 *
hudakz 0:e33621169e44 4 * This file is part of the ZBar Bar Code Reader.
hudakz 0:e33621169e44 5 *
hudakz 0:e33621169e44 6 * The ZBar Bar Code Reader is free software; you can redistribute it
hudakz 0:e33621169e44 7 * and/or modify it under the terms of the GNU Lesser Public License as
hudakz 0:e33621169e44 8 * published by the Free Software Foundation; either version 2.1 of
hudakz 0:e33621169e44 9 * the License, or (at your option) any later version.
hudakz 0:e33621169e44 10 *
hudakz 0:e33621169e44 11 * The ZBar Bar Code Reader is distributed in the hope that it will be
hudakz 0:e33621169e44 12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
hudakz 0:e33621169e44 13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
hudakz 0:e33621169e44 14 * GNU Lesser Public License for more details.
hudakz 0:e33621169e44 15 *
hudakz 0:e33621169e44 16 * You should have received a copy of the GNU Lesser Public License
hudakz 0:e33621169e44 17 * along with the ZBar Bar Code Reader; if not, write to the Free
hudakz 0:e33621169e44 18 * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
hudakz 0:e33621169e44 19 * Boston, MA 02110-1301 USA
hudakz 0:e33621169e44 20 *
hudakz 0:e33621169e44 21 * http://sourceforge.net/projects/zbar
hudakz 0:e33621169e44 22 *------------------------------------------------------------------------*/
hudakz 0:e33621169e44 23 #ifndef _CODE39_H_
hudakz 0:e33621169e44 24 #define _CODE39_H_
hudakz 0:e33621169e44 25
hudakz 0:e33621169e44 26 #include <stdint.h>
hudakz 0:e33621169e44 27
hudakz 0:e33621169e44 28 /* Code 39 specific decode state */
hudakz 0:e33621169e44 29 /* Code 39 specific decode state */
hudakz 0:e33621169e44 30 //typedef struct code39_decoder_s {
hudakz 0:e33621169e44 31 // unsigned direction : 1; /* scan direction: 0=fwd, 1=rev */
hudakz 0:e33621169e44 32 // unsigned element : 4; /* element offset 0-8 */
hudakz 0:e33621169e44 33 // int character : 12; /* character position in symbol */
hudakz 0:e33621169e44 34 // unsigned s9; /* current character width */
hudakz 0:e33621169e44 35 // unsigned width; /* last character width */
hudakz 0:e33621169e44 36
hudakz 0:e33621169e44 37 // unsigned config;
hudakz 0:e33621169e44 38 // int configs[NUM_CFGS]; /* int valued configurations */
hudakz 0:e33621169e44 39 //} code39_decoder_t;
hudakz 0:e33621169e44 40
hudakz 0:e33621169e44 41 typedef struct code39_decoder_s {
hudakz 0:e33621169e44 42 uint8_t direction; /* scan direction: 0=fwd, 1=rev */
hudakz 0:e33621169e44 43 uint8_t element; /* element offset 0-8 */
hudakz 0:e33621169e44 44 int16_t character; /* character position in symbol */
hudakz 0:e33621169e44 45 uint16_t s9; /* current character width */
hudakz 0:e33621169e44 46 uint16_t width; /* last character width */
hudakz 0:e33621169e44 47
hudakz 0:e33621169e44 48 unsigned config;
hudakz 0:e33621169e44 49 int configs[NUM_CFGS]; /* int valued configurations */
hudakz 0:e33621169e44 50 } code39_decoder_t;
hudakz 0:e33621169e44 51
hudakz 0:e33621169e44 52 /* reset Code 39 specific state */
hudakz 0:e33621169e44 53 static inline void code39_reset (code39_decoder_t *dcode39)
hudakz 0:e33621169e44 54 {
hudakz 0:e33621169e44 55 dcode39->direction = 0;
hudakz 0:e33621169e44 56 dcode39->element = 0;
hudakz 0:e33621169e44 57 dcode39->character = -1;
hudakz 0:e33621169e44 58 dcode39->s9 = 0;
hudakz 0:e33621169e44 59 }
hudakz 0:e33621169e44 60
hudakz 0:e33621169e44 61 /* decode Code 39 symbols */
hudakz 0:e33621169e44 62 zbar_symbol_type_t _zbar_decode_code39(zbar_decoder_t *dcode);
hudakz 0:e33621169e44 63
hudakz 0:e33621169e44 64 #endif