Class representing a binary mask, and related functions. More...
#include <vcl_vector.h>#include <vcl_stdexcept.h>#include <vcl_iterator.h>#include <vcl_string.h>#include <vcl_iosfwd.h>Go to the source code of this file.
Classes | |
| class | mbl_mask |
| Defines a binary mask. More... | |
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. | |
| template<typename ForwardIterator > | |
| void | mbl_mask_merge_values (const mbl_mask &mask, ForwardIterator first1, ForwardIterator last1, ForwardIterator first2, ForwardIterator last2, ForwardIterator result) |
| Merge two input ranges according to a mask ('false' indicates element drawn from range 1, 'true' from range 2). | |
| 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_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. | |
| template<typename ForwardIterator , typename OutputIterator > | |
| void | mbl_apply_mask (const mbl_mask &mask, ForwardIterator first, ForwardIterator last, OutputIterator target) |
| Apply a mask to a range of values. Result inserted at 'target'. | |
| template<typename T > | |
| vcl_vector< T > | mbl_apply_mask (const mbl_mask &mask, const vcl_vector< T > &values) |
| Apply a mask to a vector, returning a new vector. | |
| template<typename T > | |
| void | mbl_apply_mask (const mbl_mask &mask, const vcl_vector< T > &src, vcl_vector< T > &dst) |
| Apply a mask to a vector, returning a new vector. | |
| template<typename T > | |
| void | mbl_apply_mask (const mbl_mask &mask, vcl_vector< T > &values) |
| Apply a mask to a vector in-place. | |
| 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. | |
Class representing a binary mask, and related functions.
Definition in file mbl_mask.h.
| void mbl_apply_mask | ( | const mbl_mask & | mask, |
| ForwardIterator | first, | ||
| ForwardIterator | last, | ||
| OutputIterator | target | ||
| ) |
Apply a mask to a range of values. Result inserted at 'target'.
Definition at line 73 of file mbl_mask.h.
| vcl_vector<T> mbl_apply_mask | ( | const mbl_mask & | mask, |
| const vcl_vector< T > & | values | ||
| ) |
Apply a mask to a vector, returning a new vector.
This can be inefficient. See mbl_apply_mask(mask, src, dst) for an alternative.
Definition at line 85 of file mbl_mask.h.
| void mbl_apply_mask | ( | const mbl_mask & | mask, |
| const vcl_vector< T > & | src, | ||
| vcl_vector< T > & | dst | ||
| ) |
Apply a mask to a vector, returning a new vector.
| mask | The mask to apply. |
| src | The source vector. |
| dst | The destination vector (existing contents will be lost). |
Definition at line 97 of file mbl_mask.h.
| void mbl_apply_mask | ( | const mbl_mask & | mask, |
| vcl_vector< T > & | values | ||
| ) |
Apply a mask to a vector in-place.
Definition at line 116 of file mbl_mask.h.
| 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.
Apply a general logical operation between two masks.
Definition at line 98 of file mbl_mask.cxx.
Apply an "AND" (rule 0001) logical operation between two masks.
Definition at line 61 of file mbl_mask.cxx.
Apply an "NAND" (rule 1110) logical operation between two masks.
Definition at line 91 of file mbl_mask.cxx.
Apply a "NOR" (rule 1000) logical operation between two masks.
Definition at line 79 of file mbl_mask.cxx.
Apply an "OR" (rule 0111) logical operation between two masks.
Definition at line 67 of file mbl_mask.cxx.
Apply an "XNOR" (rule 1001) logical operation between two masks.
Definition at line 85 of file mbl_mask.cxx.
Apply an "XOR" (rule 0110) logical operation between two masks.
Definition at line 73 of file mbl_mask.cxx.
| void mbl_mask_merge_values | ( | const mbl_mask & | mask, |
| ForwardIterator | first1, | ||
| ForwardIterator | last1, | ||
| ForwardIterator | first2, | ||
| ForwardIterator | last2, | ||
| ForwardIterator | result | ||
| ) |
Merge two input ranges according to a mask ('false' indicates element drawn from range 1, 'true' from range 2).
Definition at line 38 of file mbl_mask.h.
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 by corresponding index 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 index sets 1,2,4
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.
1.7.5.1