mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 13:36:54 +03:00
cleanup
This commit is contained in:
@@ -126,33 +126,64 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
||||
else if ((toUpper(splitted[0]) == "CAMGAINCEILING") && (splitted.size() > 1))
|
||||
{
|
||||
std::string _ImageGainceiling = toUpper(splitted[1]);
|
||||
if (_ImageGainceiling == "X4")
|
||||
|
||||
if (isStringNumeric(_ImageGainceiling))
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_4X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X8")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_8X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X16")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_16X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X32")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_32X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X64")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_64X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X128")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_128X;
|
||||
int _ImageGainceiling_ = std::stoi(_ImageGainceiling);
|
||||
switch (_ImageGainceiling_)
|
||||
{
|
||||
case 1:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_4X;
|
||||
break;
|
||||
case 2:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_8X;
|
||||
break;
|
||||
case 3:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_16X;
|
||||
break;
|
||||
case 4:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_32X;
|
||||
break;
|
||||
case 5:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_64X;
|
||||
break;
|
||||
case 6:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_128X;
|
||||
break;
|
||||
default:
|
||||
CFstatus.ImageGainceiling = GAINCEILING_2X;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_2X;
|
||||
if (_ImageGainceiling == "X4")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_4X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X8")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_8X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X16")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_16X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X32")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_32X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X64")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_64X;
|
||||
}
|
||||
else if (_ImageGainceiling == "X128")
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_128X;
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageGainceiling = GAINCEILING_2X;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,58 +247,76 @@ bool ClassFlowTakeImage::ReadParameter(FILE *pfile, string &aktparamgraph)
|
||||
else if ((toUpper(splitted[0]) == "CAMSPECIALEFFECT") && (splitted.size() > 1))
|
||||
{
|
||||
std::string _ImageSpecialEffect = toUpper(splitted[1]);
|
||||
if (_ImageSpecialEffect == "NEGATIVE")
|
||||
|
||||
if (isStringNumeric(_ImageSpecialEffect))
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 1;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "GRAYSCALE")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 2;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "RED")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 3;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "GREEN")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 4;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "BLUE")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 5;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "RETRO")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 6;
|
||||
int _ImageSpecialEffect_ = std::stoi(_ImageSpecialEffect);
|
||||
CFstatus.ImageSpecialEffect = clipInt(_ImageSpecialEffect_, 6, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 0;
|
||||
if (_ImageSpecialEffect == "NEGATIVE")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 1;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "GRAYSCALE")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 2;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "RED")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 3;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "GREEN")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 4;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "BLUE")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 5;
|
||||
}
|
||||
else if (_ImageSpecialEffect == "RETRO")
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageSpecialEffect = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ((toUpper(splitted[0]) == "CAMWBMODE") && (splitted.size() > 1))
|
||||
{
|
||||
std::string _ImageWbMode = toUpper(splitted[1]);
|
||||
if (_ImageWbMode == "SUNNY")
|
||||
|
||||
if (isStringNumeric(_ImageWbMode))
|
||||
{
|
||||
CCstatus.ImageWbMode = 1;
|
||||
}
|
||||
else if (_ImageWbMode == "CLOUDY")
|
||||
{
|
||||
CCstatus.ImageWbMode = 2;
|
||||
}
|
||||
else if (_ImageWbMode == "OFFICE")
|
||||
{
|
||||
CCstatus.ImageWbMode = 3;
|
||||
}
|
||||
else if (_ImageWbMode == "HOME")
|
||||
{
|
||||
CCstatus.ImageWbMode = 4;
|
||||
int _ImageWbMode_ = std::stoi(_ImageWbMode);
|
||||
CFstatus.ImageWbMode = clipInt(_ImageWbMode_, 4, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageWbMode = 0;
|
||||
if (_ImageWbMode == "SUNNY")
|
||||
{
|
||||
CCstatus.ImageWbMode = 1;
|
||||
}
|
||||
else if (_ImageWbMode == "CLOUDY")
|
||||
{
|
||||
CCstatus.ImageWbMode = 2;
|
||||
}
|
||||
else if (_ImageWbMode == "OFFICE")
|
||||
{
|
||||
CCstatus.ImageWbMode = 3;
|
||||
}
|
||||
else if (_ImageWbMode == "HOME")
|
||||
{
|
||||
CCstatus.ImageWbMode = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
CCstatus.ImageWbMode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -790,11 +790,11 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
||||
|
||||
ESP_LOGD(TAG, "handler_editflow uri: %s", req->uri);
|
||||
|
||||
char _query[200];
|
||||
char _query[512];
|
||||
char _valuechar[30];
|
||||
std::string _task;
|
||||
|
||||
if (httpd_req_get_url_query_str(req, _query, 200) == ESP_OK)
|
||||
if (httpd_req_get_url_query_str(req, _query, 512) == ESP_OK)
|
||||
{
|
||||
if (httpd_query_key_value(_query, "task", _valuechar, 30) == ESP_OK)
|
||||
{
|
||||
@@ -997,6 +997,30 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
||||
CFstatus.ImageGainceiling = GAINCEILING_2X;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_aecgc == "X4") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_4X;
|
||||
}
|
||||
else if (_aecgc == "X8") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_8X;
|
||||
}
|
||||
else if (_aecgc == "X16") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_16X;
|
||||
}
|
||||
else if (_aecgc == "X32") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_32X;
|
||||
}
|
||||
else if (_aecgc == "X64") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_64X;
|
||||
}
|
||||
else if (_aecgc == "X128") {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_128X;
|
||||
}
|
||||
else {
|
||||
CFstatus.ImageGainceiling = GAINCEILING_2X;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (httpd_query_key_value(_query, "qual", _valuechar, 30) == ESP_OK)
|
||||
@@ -1070,6 +1094,30 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
||||
int _spe_ = std::stoi(_valuechar);
|
||||
CFstatus.ImageSpecialEffect = clipInt(_spe_, 6, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_spe == "negative") {
|
||||
CFstatus.ImageSpecialEffect = 1;
|
||||
}
|
||||
else if (_spe == "grayscale") {
|
||||
CFstatus.ImageSpecialEffect = 2;
|
||||
}
|
||||
else if (_spe == "red") {
|
||||
CFstatus.ImageSpecialEffect = 3;
|
||||
}
|
||||
else if (_spe == "green") {
|
||||
CFstatus.ImageSpecialEffect = 4;
|
||||
}
|
||||
else if (_spe == "blue") {
|
||||
CFstatus.ImageSpecialEffect = 5;
|
||||
}
|
||||
else if (_spe == "retro") {
|
||||
CFstatus.ImageSpecialEffect = 6;
|
||||
}
|
||||
else {
|
||||
CFstatus.ImageSpecialEffect = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (httpd_query_key_value(_query, "wbm", _valuechar, 30) == ESP_OK)
|
||||
@@ -1080,6 +1128,24 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
||||
int _wbm_ = std::stoi(_valuechar);
|
||||
CFstatus.ImageWbMode = clipInt(_wbm_, 4, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_wbm == "sunny") {
|
||||
CFstatus.ImageWbMode = 1;
|
||||
}
|
||||
else if (_wbm == "cloudy") {
|
||||
CFstatus.ImageWbMode = 2;
|
||||
}
|
||||
else if (_wbm == "office") {
|
||||
CFstatus.ImageWbMode = 3;
|
||||
}
|
||||
else if (_wbm == "home") {
|
||||
CFstatus.ImageWbMode = 4;
|
||||
}
|
||||
else {
|
||||
CFstatus.ImageWbMode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (httpd_query_key_value(_query, "awb", _valuechar, 30) == ESP_OK)
|
||||
|
||||
Reference in New Issue
Block a user