qrencode  4.1.1
About: libqrencode is a fast and compact library and command-line utility for encoding data in a QR Code symbol.
  Fossies Dox: qrencode-4.1.1.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mmask.c File Reference
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include "qrencode.h"
#include "mqrspec.h"
#include "mmask.h"
Include dependency graph for mmask.c:

Go to the source code of this file.

Macros

#define MASKMAKER(__exp__)
 
#define maskNum   (4)
 

Typedefs

typedef void MaskMaker(int, const unsigned char *, unsigned char *)
 

Functions

STATIC_IN_RELEASE void MMask_writeFormatInformation (int version, int width, unsigned char *frame, int mask, QRecLevel level)
 
static void Mask_mask0 (int width, const unsigned char *s, unsigned char *d)
 
static void Mask_mask1 (int width, const unsigned char *s, unsigned char *d)
 
static void Mask_mask2 (int width, const unsigned char *s, unsigned char *d)
 
static void Mask_mask3 (int width, const unsigned char *s, unsigned char *d)
 
unsigned char * MMask_makeMask (int version, unsigned char *frame, int mask, QRecLevel level)
 
STATIC_IN_RELEASE int MMask_evaluateSymbol (int width, unsigned char *frame)
 
unsigned char * MMask_mask (int version, unsigned char *frame, QRecLevel level)
 

Variables

static MaskMakermaskMakers [(4)]
 

Macro Definition Documentation

◆ MASKMAKER

#define MASKMAKER (   __exp__)
Value:
int x, y;\
\
for(y = 0; y < width; y++) {\
for(x = 0; x < width; x++) {\
if(*s & 0x80) {\
*d = *s;\
} else {\
*d = *s ^ ((__exp__) == 0);\
}\
s++; d++;\
}\
}

Definition at line 54 of file mmask.c.

◆ maskNum

#define maskNum   (4)

Definition at line 88 of file mmask.c.

Typedef Documentation

◆ MaskMaker

typedef void MaskMaker(int, const unsigned char *, unsigned char *)

Definition at line 89 of file mmask.c.

Function Documentation

◆ Mask_mask0()

static void Mask_mask0 ( int  width,
const unsigned char *  s,
unsigned char *  d 
)
static

Definition at line 68 of file mmask.c.

References MASKMAKER.

◆ Mask_mask1()

static void Mask_mask1 ( int  width,
const unsigned char *  s,
unsigned char *  d 
)
static

Definition at line 73 of file mmask.c.

References MASKMAKER.

◆ Mask_mask2()

static void Mask_mask2 ( int  width,
const unsigned char *  s,
unsigned char *  d 
)
static

Definition at line 78 of file mmask.c.

References MASKMAKER.

◆ Mask_mask3()

static void Mask_mask3 ( int  width,
const unsigned char *  s,
unsigned char *  d 
)
static

Definition at line 83 of file mmask.c.

References MASKMAKER.

◆ MMask_evaluateSymbol()

STATIC_IN_RELEASE int MMask_evaluateSymbol ( int  width,
unsigned char *  frame 
)

Definition at line 128 of file mmask.c.

Referenced by MMask_mask().

◆ MMask_makeMask()

unsigned char * MMask_makeMask ( int  version,
unsigned char *  frame,
int  mask,
QRecLevel  level 
)

Definition at line 108 of file mmask.c.

References level, maskMakers, maskNum, MMask_writeFormatInformation(), MQRspec_getWidth(), and version.

Referenced by QRcode_encodeMaskMQR().

◆ MMask_mask()

unsigned char * MMask_mask ( int  version,
unsigned char *  frame,
QRecLevel  level 
)

◆ MMask_writeFormatInformation()

STATIC_IN_RELEASE void MMask_writeFormatInformation ( int  version,
int  width,
unsigned char *  frame,
int  mask,
QRecLevel  level 
)

Definition at line 34 of file mmask.c.

References level, MQRspec_getFormatInfo(), and version.

Referenced by MMask_makeMask(), and MMask_mask().

Variable Documentation

◆ maskMakers

MaskMaker* maskMakers[(4)]
static
Initial value:
= {
}
static void Mask_mask3(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:83
static void Mask_mask2(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:78
static void Mask_mask1(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:73
static void Mask_mask0(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:68

Definition at line 90 of file mmask.c.

Referenced by MMask_makeMask(), and MMask_mask().