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"
|  | 
| #define | W1   100 | 
|  | 
| #define | W2   3 | 
|  | 
| #define | W3   3 | 
|  | 
|  | 
| 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... 
 | 
|  | 
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 
      
        
          | jab_int32 applyRule1 | ( | jab_int32 * | matrix, | 
        
          |  |  | jab_int32 | width, | 
        
          |  |  | jab_int32 | height, | 
        
          |  |  | jab_int32 | color_number | 
        
          |  | ) |  |  | 
      
 
Apply mask penalty rule 1. 
- Parameters
- 
  
    | matrix | the symbol matrix |  | width | the symbol matrix width |  | height | the symbol matrix height |  | color_number | the 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
- 
  
    | matrix | the symbol matrix |  | width | the symbol matrix width |  | height | the 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
- 
  
    | matrix | the symbol matrix |  | width | the symbol matrix width |  | height | the 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
- 
  
    | data | the decoded data module values |  | data_map | the data module positions |  | symbol_size | the symbol size in module |  | mask_type | the mask pattern reference |  | color_number | the number of module colors |  
 
 
 
      
        
          | jab_int32 evaluateMask | ( | jab_int32 * | matrix, | 
        
          |  |  | jab_int32 | width, | 
        
          |  |  | jab_int32 | height, | 
        
          |  |  | jab_int32 | color_number | 
        
          |  | ) |  |  | 
      
 
Evaluate masking results. 
- Parameters
- 
  
    | matrix | the symbol matrix |  | width | the symbol matrix width |  | height | the symbol matrix height |  | color_number | the number of module colors |  
 
- Returns
- the penalty score 
 
 
Mask modules. 
- Parameters
- 
  
    | enc | the encode parameters |  | cp | the 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
- 
  
    | enc | the encode parameters |  | mask_type | the mask pattern reference |  | masked | the masked symbol matrix |  | cp | the code parameters |