![](/media/cache/profiles/89a26a363b87a87ac6a94277e841b7f4.50x50_q85.jpg)
The codebase to run the *spark d-fuser controller www.sparkav.co.uk/dvimixer
Dependencies: SPK-TVOne DMX DmxArtNet NetServicesMin OSC PinDetect mRotaryEncoder iniparser mbed spk_oled_ssd1305 filter
spk_settings.h@11:0783cfbeb746, 2012-08-27 (annotated)
- Committer:
- tobyspark
- Date:
- Mon Aug 27 15:10:23 2012 +0000
- Revision:
- 11:0783cfbeb746
- Child:
- 13:3796bde6ba8f
Settings abstracted out to a class, defaults being set and used.; Next step: implement SPKSettings::load()
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tobyspark | 11:0783cfbeb746 | 1 | // Parameter Set: minY, maxY, minU, maxU, minV, maxV |
tobyspark | 11:0783cfbeb746 | 2 | #define kKeyerParam1Name "Lumakey" |
tobyspark | 11:0783cfbeb746 | 3 | #define kKeyerParam1Set 0, 18, 128, 129, 128, 129 |
tobyspark | 11:0783cfbeb746 | 4 | #define kKeyerParam2Name "Chromakey - Blue" |
tobyspark | 11:0783cfbeb746 | 5 | #define kKeyerParam2Set 30, 35, 237, 242, 114, 121 |
tobyspark | 11:0783cfbeb746 | 6 | |
tobyspark | 11:0783cfbeb746 | 7 | #include "mbed.h" |
tobyspark | 11:0783cfbeb746 | 8 | |
tobyspark | 11:0783cfbeb746 | 9 | class SPKSettings { |
tobyspark | 11:0783cfbeb746 | 10 | public: |
tobyspark | 11:0783cfbeb746 | 11 | SPKSettings() |
tobyspark | 11:0783cfbeb746 | 12 | { |
tobyspark | 11:0783cfbeb746 | 13 | int paramSet1[6] = {kKeyerParam1Set}; |
tobyspark | 11:0783cfbeb746 | 14 | keyerParamNames.push_back(kKeyerParam1Name); |
tobyspark | 11:0783cfbeb746 | 15 | keyerParamSets.push_back(paramSet1); |
tobyspark | 11:0783cfbeb746 | 16 | |
tobyspark | 11:0783cfbeb746 | 17 | int paramSet2[6] = {kKeyerParam2Set}; |
tobyspark | 11:0783cfbeb746 | 18 | keyerParamNames.push_back(kKeyerParam2Name); |
tobyspark | 11:0783cfbeb746 | 19 | keyerParamSets.push_back(paramSet2); |
tobyspark | 11:0783cfbeb746 | 20 | } |
tobyspark | 11:0783cfbeb746 | 21 | |
tobyspark | 11:0783cfbeb746 | 22 | std::string keyerParamName (int index) |
tobyspark | 11:0783cfbeb746 | 23 | { |
tobyspark | 11:0783cfbeb746 | 24 | // TODO: Bounds check and return out of bounds name |
tobyspark | 11:0783cfbeb746 | 25 | return keyerParamNames[index]; |
tobyspark | 11:0783cfbeb746 | 26 | } |
tobyspark | 11:0783cfbeb746 | 27 | |
tobyspark | 11:0783cfbeb746 | 28 | int* keyerParamSet(int index) |
tobyspark | 11:0783cfbeb746 | 29 | { |
tobyspark | 11:0783cfbeb746 | 30 | return keyerParamSets[index]; |
tobyspark | 11:0783cfbeb746 | 31 | } |
tobyspark | 11:0783cfbeb746 | 32 | |
tobyspark | 11:0783cfbeb746 | 33 | int keyerSetCount() |
tobyspark | 11:0783cfbeb746 | 34 | { |
tobyspark | 11:0783cfbeb746 | 35 | return keyerParamSets.size(); |
tobyspark | 11:0783cfbeb746 | 36 | } |
tobyspark | 11:0783cfbeb746 | 37 | |
tobyspark | 11:0783cfbeb746 | 38 | bool load(std::string filename) |
tobyspark | 11:0783cfbeb746 | 39 | { |
tobyspark | 11:0783cfbeb746 | 40 | bool success = false; |
tobyspark | 11:0783cfbeb746 | 41 | |
tobyspark | 11:0783cfbeb746 | 42 | // TODO! |
tobyspark | 11:0783cfbeb746 | 43 | |
tobyspark | 11:0783cfbeb746 | 44 | return success; |
tobyspark | 11:0783cfbeb746 | 45 | } |
tobyspark | 11:0783cfbeb746 | 46 | |
tobyspark | 11:0783cfbeb746 | 47 | protected: |
tobyspark | 11:0783cfbeb746 | 48 | LocalFileSystem *local; |
tobyspark | 11:0783cfbeb746 | 49 | std::vector<int*> keyerParamSets; |
tobyspark | 11:0783cfbeb746 | 50 | std::vector<std::string> keyerParamNames; |
tobyspark | 11:0783cfbeb746 | 51 | }; |