Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
test/testing.cpp@6:5e9b842d6085, 2020-12-13 (annotated)
- Committer:
- kemzebra
- Date:
- Sun Dec 13 19:50:14 2020 +0000
- Revision:
- 6:5e9b842d6085
- Parent:
- 5:48f476a1bc60
Comment fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kemzebra | 5:48f476a1bc60 | 1 | /** |
kemzebra | 5:48f476a1bc60 | 2 | * |
kemzebra | 5:48f476a1bc60 | 3 | * Manual-testing file |
kemzebra | 5:48f476a1bc60 | 4 | * for stat implementations |
kemzebra | 5:48f476a1bc60 | 5 | * |
kemzebra | 5:48f476a1bc60 | 6 | */ |
kemzebra | 5:48f476a1bc60 | 7 | |
kemzebra | 5:48f476a1bc60 | 8 | /* |
kemzebra | 5:48f476a1bc60 | 9 | #include <iostream> |
kemzebra | 5:48f476a1bc60 | 10 | #include <vector> |
kemzebra | 5:48f476a1bc60 | 11 | #include <cstdlib> |
kemzebra | 5:48f476a1bc60 | 12 | |
kemzebra | 5:48f476a1bc60 | 13 | #include "rgbhlr.h" |
kemzebra | 5:48f476a1bc60 | 14 | #include "rgbstats.h" |
kemzebra | 5:48f476a1bc60 | 15 | using namespace rgb_dws; |
kemzebra | 5:48f476a1bc60 | 16 | |
kemzebra | 5:48f476a1bc60 | 17 | int main() { |
kemzebra | 5:48f476a1bc60 | 18 | srand(time(NULL)); |
kemzebra | 5:48f476a1bc60 | 19 | std::vector<RGB> d; |
kemzebra | 5:48f476a1bc60 | 20 | d.resize(30); |
kemzebra | 5:48f476a1bc60 | 21 | |
kemzebra | 5:48f476a1bc60 | 22 | std::cout << "Red\tGreen\tBlue\n"; |
kemzebra | 5:48f476a1bc60 | 23 | |
kemzebra | 5:48f476a1bc60 | 24 | for(int i = 0; i < d.size(); i++) { |
kemzebra | 5:48f476a1bc60 | 25 | d[i].red = rand() % 256; |
kemzebra | 5:48f476a1bc60 | 26 | d[i].green = rand() % 256; |
kemzebra | 5:48f476a1bc60 | 27 | d[i].blue = rand() % 256; |
kemzebra | 5:48f476a1bc60 | 28 | std::cout << d[i].red << "\t" << d[i].green << "\t" << d[i].blue << "\n"; |
kemzebra | 5:48f476a1bc60 | 29 | } |
kemzebra | 5:48f476a1bc60 | 30 | |
kemzebra | 5:48f476a1bc60 | 31 | |
kemzebra | 5:48f476a1bc60 | 32 | RGBCalc test = samp_mean(d); |
kemzebra | 5:48f476a1bc60 | 33 | std::cout << "\n"; |
kemzebra | 5:48f476a1bc60 | 34 | std::cout << test.red << " " << test.green << " " << test.blue << "\n"; |
kemzebra | 5:48f476a1bc60 | 35 | return 0; |
kemzebra | 5:48f476a1bc60 | 36 | } |
kemzebra | 5:48f476a1bc60 | 37 | |
kemzebra | 5:48f476a1bc60 | 38 | */ |