jabcode
 All Classes Files Functions Variables Enumerations Macros
mask.c File Reference

Data module masking. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "jabcode.h"
#include "encoder.h"
#include "detector.h"

Macros

#define W1   100
 
#define W2   3
 
#define W3   3
 

Functions

jab_int32 applyRule1 (jab_int32 *matrix, jab_int32 width, jab_int32 height, jab_int32 color_number)
 Apply mask penalty rule 1. More...
 
jab_int32 applyRule2 (jab_int32 *matrix, jab_int32 width, jab_int32 height)
 Apply mask penalty rule 2. More...
 
jab_int32 applyRule3 (jab_int32 *matrix, jab_int32 width, jab_int32 height)
 Apply mask penalty rule 3. More...
 
jab_int32 evaluateMask (jab_int32 *matrix, jab_int32 width, jab_int32 height, jab_int32 color_number)
 Evaluate masking results. More...
 
void maskSymbols (jab_encode *enc, jab_int32 mask_type, jab_int32 *masked, jab_code *cp)
 Mask the data modules in symbols. More...
 
jab_int32 maskCode (jab_encode *enc, jab_code *cp)
 Mask modules. More...
 
void demaskSymbol (jab_data *data, jab_byte *data_map, jab_vector2d symbol_size, jab_int32 mask_type, jab_int32 color_number)
 Demask modules. More...
 

Detailed Description

Data module masking.

libjabcode - JABCode Encoding/Decoding Library

Copyright 2016 by Fraunhofer SIT. All rights reserved. See LICENSE file for full terms of use and distribution.

Contact: Huajian Liu liu@s.nosp@m.it.f.nosp@m.raunh.nosp@m.ofer.nosp@m..de Waldemar Berchtold walde.nosp@m.mar..nosp@m.berch.nosp@m.told.nosp@m.@sit..nosp@m.frau.nosp@m.nhofe.nosp@m.r.de

Function Documentation

jab_int32 applyRule1 ( jab_int32 *  matrix,
jab_int32  width,
jab_int32  height,
jab_int32  color_number 
)

Apply mask penalty rule 1.

Parameters
matrixthe symbol matrix
widththe symbol matrix width
heightthe symbol matrix height
color_numberthe number of module colors
Returns
the penalty score
jab_int32 applyRule2 ( jab_int32 *  matrix,
jab_int32  width,
jab_int32  height 
)

Apply mask penalty rule 2.

Parameters
matrixthe symbol matrix
widththe symbol matrix width
heightthe symbol matrix height
Returns
the penalty score
jab_int32 applyRule3 ( jab_int32 *  matrix,
jab_int32  width,
jab_int32  height 
)

Apply mask penalty rule 3.

Parameters
matrixthe symbol matrix
widththe symbol matrix width
heightthe symbol matrix height
Returns
the penalty score
void demaskSymbol ( jab_data data,
jab_byte *  data_map,
jab_vector2d  symbol_size,
jab_int32  mask_type,
jab_int32  color_number 
)

Demask modules.

Parameters
datathe decoded data module values
data_mapthe data module positions
symbol_sizethe symbol size in module
mask_typethe mask pattern reference
color_numberthe number of module colors
jab_int32 evaluateMask ( jab_int32 *  matrix,
jab_int32  width,
jab_int32  height,
jab_int32  color_number 
)

Evaluate masking results.

Parameters
matrixthe symbol matrix
widththe symbol matrix width
heightthe symbol matrix height
color_numberthe number of module colors
Returns
the penalty score
jab_int32 maskCode ( jab_encode enc,
jab_code cp 
)

Mask modules.

Parameters
encthe encode parameters
cpthe code parameters
Returns
the mask pattern reference | -1 if fails
void maskSymbols ( jab_encode enc,
jab_int32  mask_type,
jab_int32 *  masked,
jab_code cp 
)

Mask the data modules in symbols.

Parameters
encthe encode parameters
mask_typethe mask pattern reference
maskedthe masked symbol matrix
cpthe code parameters