Changes between Version 1 and Version 2 of IPP_Detection_Bitmasks
- Timestamp:
- Mar 12, 2009, 10:23:41 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IPP_Detection_Bitmasks
v1 v2 3 3 The IPP pipeline stores some information about object in the FLAGS value in the CMF file. These values represent "bit masks", not standard integer values. That is, individual bits within the value have meaning, rather than the value itself. The bit masks for CMF files are 4 4 5 <code> 6 <pre> 5 {{{ 7 6 typedef enum { 8 7 PM_SOURCE_MODE_DEFAULT = 0x0000, ///< … … 24 23 PM_SOURCE_MODE_SUBTRACTED = 0x8000, ///< XXX this flag is actually only used internally (move) 25 24 } pmSourceMode; 26 </pre> 27 </code> 25 }}} 28 26 29 27 These are defined in the IPP code base in "ipp/psModules/src/objects/pmSource.h" … … 31 29 If I were in charge of the Transient Classification Server and only wanted to consider objects that were single PSF-like, I might use the following bitmasks to denote bad and good objects: 32 30 33 <code> 34 <pre> 35 badbitmask = PM_SOURCE_MODE_FAIL + PM_SOURCE_MODE_POOR + PM_SOURCE_MODE_SATSTAR + PM_SOURCE_MODE_BLEND + 36 PM_SOURCE_MODE_EXTERNAL + PM_SOURCE_MODE_BADPSF + PM_SOURCE_MODE_DEFECT + PM_SOURCE_MODE_SATURATED + 37 PM_SOURCE_MODE_CR_LIMIT + PM_SOURCE_MODE_EXT_LIMIT 31 {{{ 32 badbitmask = PM_SOURCE_MODE_FAIL + PM_SOURCE_MODE_POOR + PM_SOURCE_MODE_SATSTAR + 33 PM_SOURCE_MODE_BLEND + PM_SOURCE_MODE_EXTERNAL + PM_SOURCE_MODE_BADPSF + PM_SOURCE_MODE_DEFECT + 34 PM_SOURCE_MODE_SATURATED + PM_SOURCE_MODE_CR_LIMIT + PM_SOURCE_MODE_EXT_LIMIT 38 35 39 36 goodbitmask = PM_SOURCE_MODE_PSFMODEL + PM_SOURCE_MODE_FITTED 40 </pre> 41 </code> 37 }}} 42 38 43 39 === Intro to Bit Masks === … … 51 47 their mask value in binary and decimal: 52 48 53 <code><pre> 49 {{{ 54 50 DELICIOUS 0001 => 1 55 51 SPICY 0010 => 2 56 52 CHEAP 0100 => 4 57 53 MEAT 1000 => 8 58 </pre></code> 54 }}} 59 55 60 56 Now, some typical dishes might be: 61 57 62 <code><pre> 58 {{{ 63 59 Lobster MEAT => 1000 => 8 64 60 Chicken salad CHEAP | MEAT => 1100 => 12 … … 66 62 Tofu curry SPICY | CHEAP => 0110 => 6 67 63 Spaghetti DELICIOUS | CHEAP => 0101 => 5 68 </pre></code> 64 }}} 69 65 70 66 Here, the pipe ("|") between symbols means a bitwise OR operation on the
