ZBar bar code reader . http://zbar.sourceforge.net/ ZBar is licensed under the GNU LGPL 2.1 to enable development of both open source and commercial projects.

Dependents:   GR-PEACH_Camera_in_barcode levkov_ov7670

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers i25.h Source File

i25.h

00001 /*------------------------------------------------------------------------
00002  *  Copyright 2008-2009 (c) Jeff Brown <spadix@users.sourceforge.net>
00003  *
00004  *  This file is part of the ZBar Bar Code Reader.
00005  *
00006  *  The ZBar Bar Code Reader is free software; you can redistribute it
00007  *  and/or modify it under the terms of the GNU Lesser Public License as
00008  *  published by the Free Software Foundation; either version 2.1 of
00009  *  the License, or (at your option) any later version.
00010  *
00011  *  The ZBar Bar Code Reader is distributed in the hope that it will be
00012  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00013  *  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU Lesser Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser Public License
00017  *  along with the ZBar Bar Code Reader; if not, write to the Free
00018  *  Software Foundation, Inc., 51 Franklin St, Fifth Floor,
00019  *  Boston, MA  02110-1301  USA
00020  *
00021  *  http://sourceforge.net/projects/zbar
00022  *------------------------------------------------------------------------*/
00023 #ifndef _I25_H_
00024 #define _I25_H_
00025 
00026 /* interleaved 2 of 5 specific decode state */
00027 typedef struct i25_decoder_s {
00028     unsigned direction : 1;     /* scan direction: 0=fwd/space, 1=rev/bar */
00029     unsigned element : 4;       /* element offset 0-8 */
00030     int character : 12;         /* character position in symbol */
00031     unsigned s10;               /* current character width */
00032     unsigned width;             /* last character width */
00033 
00034     unsigned config;
00035     int configs[NUM_CFGS];      /* int valued configurations */
00036 } i25_decoder_t;
00037 
00038 /* reset interleaved 2 of 5 specific state */
00039 static inline void i25_reset (i25_decoder_t *i25)
00040 {
00041     i25->direction = 0;
00042     i25->element = 0;
00043     i25->character = -1;
00044     i25->s10 = 0;
00045 }
00046 
00047 /* decode interleaved 2 of 5 symbols */
00048 zbar_symbol_type_t _zbar_decode_i25(zbar_decoder_t *dcode);
00049 
00050 #endif
00051