TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Macros | Typedefs | Functions | Variables
mmask.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include "qrencode.h"
#include "mqrspec.h"
#include "mmask.h"

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 [maskNum]
 

Macro Definition Documentation

#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 52 of file mmask.c.

Referenced by Mask_mask0(), Mask_mask1(), Mask_mask2(), and Mask_mask3().

#define maskNum   (4)

Definition at line 86 of file mmask.c.

Referenced by MMask_makeMask(), and MMask_mask().

Typedef Documentation

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

Definition at line 87 of file mmask.c.

Function Documentation

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

Definition at line 66 of file mmask.c.

References MASKMAKER.

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

Definition at line 71 of file mmask.c.

References MASKMAKER.

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

Definition at line 76 of file mmask.c.

References MASKMAKER.

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

Definition at line 81 of file mmask.c.

References MASKMAKER.

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

Definition at line 126 of file mmask.c.

Referenced by MMask_mask().

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

Definition at line 106 of file mmask.c.

References malloc(), maskMakers, maskNum, MMask_writeFormatInformation(), and MQRspec_getWidth().

Referenced by QRcode_encodeMaskMQR().

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

Definition at line 32 of file mmask.c.

References MQRspec_getFormatInfo().

Referenced by MMask_makeMask(), and MMask_mask().

Variable Documentation

MaskMaker* maskMakers[maskNum]
static
Initial value:
= {
}
static void Mask_mask1(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:71
static void Mask_mask3(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:81
static void Mask_mask0(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:66
static void Mask_mask2(int width, const unsigned char *s, unsigned char *d)
Definition: mmask.c:76

Definition at line 88 of file mmask.c.

Referenced by MMask_makeMask(), and MMask_mask().