qrspec.h ( File view )

  • By green75 2014-11-06
  • View(s):334
  • Download(s):8
  • Point(s): 3
			/*
 * qrencode - QR Code encoder
 *
 * QR Code specification in convenient format. 
 * Copyright (C) 2006-2011 Kentaro Fukuchi <kentaro@fukuchi.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef __QRSPEC_H__
#define __QRSPEC_H__

#include "qrencode.h"

/******************************************************************************
 * Version and capacity
 *****************************************************************************/

/**
 * Maximum width of a symbol
 */
#define QRSPEC_WIDTH_MAX 177

/**
 * Return maximum data code length (bytes) for the version.
 * @param version
 * @param level
 * @return maximum size (bytes)
 */
extern int QRspec_getDataLength(int version, QRecLevel level);

/**
 * Return maximum error correction code length (bytes) for the version.
 * @param version
 * @param level
 * @return ECC size (bytes)
 */
extern int QRspec_getECCLength(int version, QRecLevel level);

/**
 * Return a version number that satisfies the input code length.
 * @param size input code length (byte)
 * @param level
 * @return version number
 */
extern int QRspec_getMinimumVersion(int size, QRecLevel level);

/**
 * Return the width of the symbol for the version.
 * @param version
 * @return width
 */
extern int QRspec_getWidth(int version);

/**
 * Return the numer of remainder bits.
 * @param version
 * @return number of remainder bits
 */
extern int QRspec_getRemainder(int version);

/******************************************************************************
 * Length indicator
 *****************************************************************************/

/**
 * Return the size of lenght indicator for the mode and version.
 * @param mode
 * @param version
 * @return the size of the appropriate length indicator (bits).
 */
extern int QRspec_lengthIndicator(QRencodeMode mode, int version);

/**
 * Return the maximum length for the mode and version.
 * @param mode
 * @param version
 * @return the maximum length (bytes)
 */
extern int QRspec_maximumWords(QRencodeMode mode, int version);

/******************************************************************************
 * Error correction code
 *****************************************************************************/

/**
 * Return an array of ECC specification.
 * @param version
 * @param level
 * @param spec an array of ECC specification contains as following:
 * {
# of type1 blocks, # of data code, # of ecc code,
 *  # of type2 blocks, # of data code
}
 */
void QRspec_getEccSpec(int version, QRecLevel level, int spec[5]);

#define QRspec_rsBlockNum(__spec__) (__spec__[0] + __spec__[3])
#define QRspec_rsBlockNum1(__spec__) (__spec__[0])
#define QRspec_rsDataCodes1(__spec__) (__spec__[1])
#define QRspec_rsEccCodes1(__spec__) (__spec__[2])
#define QRspec_rsBlockNum2(__spec__) (__spec__[3])
#define QRspec_rsDataCodes2(__spec__) (__spec__[4])
#define QRspec_rsEccCodes2(__spec__) (__spec__[2])

#define QRspec_rsDataLength(__spec__) \
	((QRspec_rsBlockNum1(__spec__) * QRspec_rsDataCodes1(__spec__)) + \
	 (QRspec_rsBlockNum2(__spec__) * QRspec_rsDataCodes2(__spec__)))
#define QRspec_rsEccLength(__spec__) \
	(QRspec_rsBlockNum(__spec__) * QRspec_rsEccCodes1(__spec__))

/***********************
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 3

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.97 kB
01.97 kB
QRGenerator.ilk366.95 kB2013-06-11|12:21
01.97 kB
01.97 kB
BuildLog.htm15.69 kB2013-06-11|12:21
01.97 kB
bitstream.c4.21 kB2013-05-15|12:07
bitstream.h1.40 kB2013-05-15|12:07
config.h230.00 B2013-05-15|12:07
mask.c6.79 kB2013-05-15|12:07
mask.h1.52 kB2013-05-15|12:07
mmask.c4.01 kB2013-05-15|12:07
mmask.h1.37 kB2013-05-15|12:07
mqrspec.c6.92 kB2013-05-15|12:07
mqrspec.h4.66 kB2013-05-15|12:07
qrenc.c21.53 kB2013-06-05|16:59
qrencode.c19.60 kB2013-05-15|12:07
qrencode.h20.17 kB2013-05-15|12:07
qrencode_inner.h2.71 kB2013-05-15|12:07
qrinput.c38.05 kB2013-05-15|12:07
qrinput.h3.57 kB2013-05-15|12:07
qrspec.c15.35 kB2013-05-15|12:07
qrspec.h5.70 kB2013-05-15|12:07
rscode.c8.96 kB2013-05-15|12:07
rscode.h1.43 kB2013-05-15|12:07
split.c7.20 kB2013-05-15|12:07
split.h1.87 kB2013-05-15|12:07
QRGenerator.cpp6.14 kB2013-05-15|12:07
QRGenerator.vcproj5.68 kB2013-06-11|12:20
QRGenerator.vcproj.NCC1701A.TWOTM.user1.39 kB2013-06-11|12:21
QRGenerator.vcproj.PROXIMA.TWOTM.user1.38 kB2013-05-15|12:07
01.97 kB
bitstream.obj15.25 kB2013-06-11|12:21
BuildLog.htm10.58 kB2013-06-11|12:21
mask.obj19.98 kB2013-06-11|12:21
mmask.obj12.95 kB2013-06-11|12:21
mqrspec.obj16.01 kB2013-06-11|12:21
mt.dep62.00 B2013-06-11|12:21
qrencode.obj40.71 kB2013-06-11|12:21
QRGenerator.exe.intermediate.manifest616.00 B2013-06-11|12:21
QRGenerator.obj34.64 kB2013-06-11|12:21
qrinput.obj62.77 kB2013-06-11|12:21
qrspec.obj26.07 kB2013-06-11|12:21
rscode.obj14.36 kB2013-06-11|12:21
split.obj16.79 kB2013-06-11|12:21
stdafx.obj25.93 kB2013-06-11|12:21
vc90.idb83.00 kB2013-06-11|12:21
vc90.pdb76.00 kB2013-06-11|12:21
stdafx.cpp298.00 B2013-05-15|12:07
stdafx.h320.00 B2013-05-15|12:07
targetver.h765.00 B2013-05-15|12:07
QRGenerator.ncb683.00 kB2013-06-11|12:21
QRGenerator.sln899.00 B2013-05-15|12:07
QRGenerator.suo23.00 kB2013-06-11|12:21
01.97 kB
QRGenerator.exe28.00 kB2013-06-11|12:21
QRGenerator.pdb267.00 kB2013-06-11|12:21
...
Sponsored links

qrspec.h (497.86 kB)

Need 3 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D