Functions
contrib/mul/mbl/mbl_mask.cxx File Reference

Class representing a binary mask, and related functions. More...

#include "mbl_mask.h"
#include <vcl_set.h>
#include <vcl_map.h>
#include <vcl_fstream.h>
#include <vcl_string.h>
#include <mbl/mbl_exception.h>

Go to the source code of this file.

Functions

void mbl_masks_from_index_set (const vcl_vector< unsigned > &indices, vcl_vector< mbl_mask > &masks)
 Given a collection of indices, produce a collection of masks that isolate each indexed set.
void mbl_mask_on_mask (const mbl_mask &A, mbl_mask &B)
 Replace 'true' values in B with values taken from A. size of A must match 'true' count in B.
void mbl_mask_logic_and (const mbl_mask &A, mbl_mask &B)
 Apply an "AND" (rule 0001) logical operation between two masks.
void mbl_mask_logic_or (const mbl_mask &A, mbl_mask &B)
 Apply an "OR" (rule 0111) logical operation between two masks.
void mbl_mask_logic_xor (const mbl_mask &A, mbl_mask &B)
 Apply an "XOR" (rule 0110) logical operation between two masks.
void mbl_mask_logic_nor (const mbl_mask &A, mbl_mask &B)
 Apply a "NOR" (rule 1000) logical operation between two masks.
void mbl_mask_logic_xnor (const mbl_mask &A, mbl_mask &B)
 Apply an "XNOR" (rule 1001) logical operation between two masks.
void mbl_mask_logic_nand (const mbl_mask &A, mbl_mask &B)
 Apply an "NAND" (rule 1110) logical operation between two masks.
void mbl_mask_logic (const mbl_mask &A, mbl_mask &B, const vcl_string &operation)
 Apply a general logical operation between two masks.
void mbl_save_mask (const mbl_mask &mask, vcl_ostream &stream)
 Save to file.
void mbl_save_mask (const mbl_mask &mask, const char *filename)
 Save to file.
void mbl_save_mask (const mbl_mask &mask, const vcl_string &filename)
 Save to file.
void mbl_load_mask (mbl_mask &mask, vcl_istream &stream)
 Load from file.
void mbl_load_mask (mbl_mask &mask, const char *filename)
 Load from file.

Detailed Description

Class representing a binary mask, and related functions.

Author:
Barry Skellern

Definition in file mbl_mask.cxx.


Function Documentation

void mbl_load_mask ( mbl_mask mask,
vcl_istream &  stream 
)

Load from file.

Definition at line 149 of file mbl_mask.cxx.

void mbl_load_mask ( mbl_mask mask,
const char *  filename 
)

Load from file.

Definition at line 168 of file mbl_mask.cxx.

void mbl_mask_logic ( const mbl_mask A,
mbl_mask B,
const vcl_string &  operation 
)

Apply a general logical operation between two masks.

Definition at line 98 of file mbl_mask.cxx.

void mbl_mask_logic_and ( const mbl_mask A,
mbl_mask B 
)

Apply an "AND" (rule 0001) logical operation between two masks.

Definition at line 61 of file mbl_mask.cxx.

void mbl_mask_logic_nand ( const mbl_mask A,
mbl_mask B 
)

Apply an "NAND" (rule 1110) logical operation between two masks.

Definition at line 91 of file mbl_mask.cxx.

void mbl_mask_logic_nor ( const mbl_mask A,
mbl_mask B 
)

Apply a "NOR" (rule 1000) logical operation between two masks.

Definition at line 79 of file mbl_mask.cxx.

void mbl_mask_logic_or ( const mbl_mask A,
mbl_mask B 
)

Apply an "OR" (rule 0111) logical operation between two masks.

Definition at line 67 of file mbl_mask.cxx.

void mbl_mask_logic_xnor ( const mbl_mask A,
mbl_mask B 
)

Apply an "XNOR" (rule 1001) logical operation between two masks.

Definition at line 85 of file mbl_mask.cxx.

void mbl_mask_logic_xor ( const mbl_mask A,
mbl_mask B 
)

Apply an "XOR" (rule 0110) logical operation between two masks.

Definition at line 73 of file mbl_mask.cxx.

void mbl_mask_on_mask ( const mbl_mask A,
mbl_mask B 
)

Replace 'true' values in B with values taken from A. size of A must match 'true' count in B.

Definition at line 47 of file mbl_mask.cxx.

void mbl_masks_from_index_set ( const vcl_vector< unsigned > &  indices,
vcl_vector< mbl_mask > &  masks 
)

Given a collection of indices, produce a collection of masks that isolate each indexed set.

The input index set does not need to be zero based or continuous The output vector of masks is sorted such that for example: (1,4,2,1,2) will make three masks: (1,0,0,1,0), (0,0,1,0,1) and (0,1,0,0,0) which correspond to the sorted index sets 1,2,4

Definition at line 22 of file mbl_mask.cxx.

void mbl_save_mask ( const mbl_mask mask,
vcl_ostream &  stream 
)

Save to file.

Definition at line 122 of file mbl_mask.cxx.

void mbl_save_mask ( const mbl_mask mask,
const char *  filename 
)

Save to file.

Definition at line 131 of file mbl_mask.cxx.

void mbl_save_mask ( const mbl_mask mask,
const vcl_string &  filename 
)

Save to file.

Definition at line 140 of file mbl_mask.cxx.