|
@@ -90,9 +90,9 @@ esp_err_t GetJPG(std::string _filename, httpd_req_t *req)
|
|
|
return flowctrl.GetJPGStream(_filename, req);
|
|
return flowctrl.GetJPGStream(_filename, req);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-esp_err_t GetRawJPG(httpd_req_t *req)
|
|
|
|
|
|
|
+esp_err_t GetRawJPG(httpd_req_t *req, bool previewCapture)
|
|
|
{
|
|
{
|
|
|
- return flowctrl.SendRawJPG(req);
|
|
|
|
|
|
|
+ return flowctrl.SendRawJPG(req, previewCapture);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool isSetupModusActive(void)
|
|
bool isSetupModusActive(void)
|
|
@@ -152,25 +152,6 @@ bool doflow(void)
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-esp_err_t setCCstatusToCFstatus(void)
|
|
|
|
|
-{
|
|
|
|
|
- static_cast<CameraSettings &>(CFstatus) =
|
|
|
|
|
- static_cast<const CameraSettings &>(CCstatus);
|
|
|
|
|
- return ESP_OK;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-esp_err_t setCFstatusToCCstatus(void)
|
|
|
|
|
-{
|
|
|
|
|
- static_cast<CameraSettings &>(CCstatus) =
|
|
|
|
|
- static_cast<const CameraSettings &>(CFstatus);
|
|
|
|
|
- return ESP_OK;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-esp_err_t setCFstatusToCam(void)
|
|
|
|
|
-{
|
|
|
|
|
- return Camera.ApplySettings(CFstatus);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
esp_err_t handler_get_heap(httpd_req_t *req)
|
|
esp_err_t handler_get_heap(httpd_req_t *req)
|
|
|
{
|
|
{
|
|
|
#ifdef DEBUG_DETAIL_ON
|
|
#ifdef DEBUG_DETAIL_ON
|
|
@@ -841,8 +822,16 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
{
|
|
{
|
|
|
std::string _host = "";
|
|
std::string _host = "";
|
|
|
|
|
|
|
|
- // laden der aktuellen Kameraeinstellungen(CCstatus) in den Zwischenspeicher(CFstatus)
|
|
|
|
|
- setCCstatusToCFstatus(); // CCstatus >>> CFstatus
|
|
|
|
|
|
|
+ // CFstatus is only used as the temporary settings copy for test_take.
|
|
|
|
|
+ const bool isTestTake = (_task.compare("test_take") == 0);
|
|
|
|
|
+ CameraSettings *settingsTarget = &static_cast<CameraSettings &>(CCstatus);
|
|
|
|
|
+ if (isTestTake)
|
|
|
|
|
+ {
|
|
|
|
|
+ static_cast<CameraSettings &>(CFstatus) =
|
|
|
|
|
+ static_cast<const CameraSettings &>(CCstatus);
|
|
|
|
|
+ settingsTarget = &static_cast<CameraSettings &>(CFstatus);
|
|
|
|
|
+ }
|
|
|
|
|
+ CameraSettings &settings = *settingsTarget;
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "host", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
@@ -854,7 +843,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
std::string _xclk = std::string(_valuechar);
|
|
std::string _xclk = std::string(_valuechar);
|
|
|
if (isStringNumeric(_xclk))
|
|
if (isStringNumeric(_xclk))
|
|
|
{
|
|
{
|
|
|
- CFstatus.CamXclkFreqMhz = clipInt(std::stoi(_xclk), 20, 1);
|
|
|
|
|
|
|
+ settings.CamXclkFreqMhz = clipInt(std::stoi(_xclk), 20, 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -863,7 +852,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
std::string _waitb = std::string(_valuechar);
|
|
std::string _waitb = std::string(_valuechar);
|
|
|
if (isStringNumeric(_waitb))
|
|
if (isStringNumeric(_waitb))
|
|
|
{
|
|
{
|
|
|
- CFstatus.WaitBeforePicture = std::max(0, std::stoi(_valuechar));
|
|
|
|
|
|
|
+ settings.WaitBeforePicture = std::max(0, std::stoi(_valuechar));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -876,49 +865,49 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
switch (_aecgc_)
|
|
switch (_aecgc_)
|
|
|
{
|
|
{
|
|
|
case 1:
|
|
case 1:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_4X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_4X;
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_8X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_8X;
|
|
|
break;
|
|
break;
|
|
|
case 3:
|
|
case 3:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_16X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_16X;
|
|
|
break;
|
|
break;
|
|
|
case 4:
|
|
case 4:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_32X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_32X;
|
|
|
break;
|
|
break;
|
|
|
case 5:
|
|
case 5:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_64X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_64X;
|
|
|
break;
|
|
break;
|
|
|
case 6:
|
|
case 6:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_128X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_128X;
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_2X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_2X;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
if (_aecgc == "X4") {
|
|
if (_aecgc == "X4") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_4X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_4X;
|
|
|
}
|
|
}
|
|
|
else if (_aecgc == "X8") {
|
|
else if (_aecgc == "X8") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_8X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_8X;
|
|
|
}
|
|
}
|
|
|
else if (_aecgc == "X16") {
|
|
else if (_aecgc == "X16") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_16X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_16X;
|
|
|
}
|
|
}
|
|
|
else if (_aecgc == "X32") {
|
|
else if (_aecgc == "X32") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_32X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_32X;
|
|
|
}
|
|
}
|
|
|
else if (_aecgc == "X64") {
|
|
else if (_aecgc == "X64") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_64X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_64X;
|
|
|
}
|
|
}
|
|
|
else if (_aecgc == "X128") {
|
|
else if (_aecgc == "X128") {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_128X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_128X;
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- CFstatus.ImageGainceiling = GAINCEILING_2X;
|
|
|
|
|
|
|
+ settings.ImageGainceiling = GAINCEILING_2X;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -929,7 +918,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_qual))
|
|
if (isStringNumeric(_qual))
|
|
|
{
|
|
{
|
|
|
int _qual_ = std::stoi(_valuechar);
|
|
int _qual_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageQuality = clipInt(_qual_, 63, 6);
|
|
|
|
|
|
|
+ settings.ImageQuality = clipInt(_qual_, 63, 6);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -939,7 +928,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_bri))
|
|
if (isStringNumeric(_bri))
|
|
|
{
|
|
{
|
|
|
int _bri_ = std::stoi(_valuechar);
|
|
int _bri_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageBrightness = clipInt(_bri_, 2, -2);
|
|
|
|
|
|
|
+ settings.ImageBrightness = clipInt(_bri_, 2, -2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -949,7 +938,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_con))
|
|
if (isStringNumeric(_con))
|
|
|
{
|
|
{
|
|
|
int _con_ = std::stoi(_valuechar);
|
|
int _con_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageContrast = clipInt(_con_, 2, -2);
|
|
|
|
|
|
|
+ settings.ImageContrast = clipInt(_con_, 2, -2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -959,7 +948,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_sat))
|
|
if (isStringNumeric(_sat))
|
|
|
{
|
|
{
|
|
|
int _sat_ = std::stoi(_valuechar);
|
|
int _sat_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageSaturation = clipInt(_sat_, 2, -2);
|
|
|
|
|
|
|
+ settings.ImageSaturation = clipInt(_sat_, 2, -2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -971,11 +960,11 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _shp_ = std::stoi(_valuechar);
|
|
int _shp_ = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageSharpness = clipInt(_shp_, 2, -2);
|
|
|
|
|
|
|
+ settings.ImageSharpness = clipInt(_shp_, 2, -2);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageSharpness = clipInt(_shp_, 3, -3);
|
|
|
|
|
|
|
+ settings.ImageSharpness = clipInt(_shp_, 3, -3);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -983,7 +972,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (httpd_query_key_value(_query, "ashp", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "ashp", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _ashp = std::string(_valuechar);
|
|
std::string _ashp = std::string(_valuechar);
|
|
|
- CFstatus.ImageAutoSharpness = alphanumericToBoolean(_ashp);
|
|
|
|
|
|
|
+ settings.ImageAutoSharpness = alphanumericToBoolean(_ashp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "spe", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "spe", _valuechar, 30) == ESP_OK)
|
|
@@ -992,30 +981,30 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_spe))
|
|
if (isStringNumeric(_spe))
|
|
|
{
|
|
{
|
|
|
int _spe_ = std::stoi(_valuechar);
|
|
int _spe_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageSpecialEffect = clipInt(_spe_, 6, 0);
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = clipInt(_spe_, 6, 0);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
if (_spe == "negative") {
|
|
if (_spe == "negative") {
|
|
|
- CFstatus.ImageSpecialEffect = 1;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 1;
|
|
|
}
|
|
}
|
|
|
else if (_spe == "grayscale") {
|
|
else if (_spe == "grayscale") {
|
|
|
- CFstatus.ImageSpecialEffect = 2;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 2;
|
|
|
}
|
|
}
|
|
|
else if (_spe == "red") {
|
|
else if (_spe == "red") {
|
|
|
- CFstatus.ImageSpecialEffect = 3;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 3;
|
|
|
}
|
|
}
|
|
|
else if (_spe == "green") {
|
|
else if (_spe == "green") {
|
|
|
- CFstatus.ImageSpecialEffect = 4;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 4;
|
|
|
}
|
|
}
|
|
|
else if (_spe == "blue") {
|
|
else if (_spe == "blue") {
|
|
|
- CFstatus.ImageSpecialEffect = 5;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 5;
|
|
|
}
|
|
}
|
|
|
else if (_spe == "retro") {
|
|
else if (_spe == "retro") {
|
|
|
- CFstatus.ImageSpecialEffect = 6;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 6;
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- CFstatus.ImageSpecialEffect = 0;
|
|
|
|
|
|
|
+ settings.ImageSpecialEffect = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1026,24 +1015,24 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_wbm))
|
|
if (isStringNumeric(_wbm))
|
|
|
{
|
|
{
|
|
|
int _wbm_ = std::stoi(_valuechar);
|
|
int _wbm_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageWbMode = clipInt(_wbm_, 4, 0);
|
|
|
|
|
|
|
+ settings.ImageWbMode = clipInt(_wbm_, 4, 0);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
if (_wbm == "sunny") {
|
|
if (_wbm == "sunny") {
|
|
|
- CFstatus.ImageWbMode = 1;
|
|
|
|
|
|
|
+ settings.ImageWbMode = 1;
|
|
|
}
|
|
}
|
|
|
else if (_wbm == "cloudy") {
|
|
else if (_wbm == "cloudy") {
|
|
|
- CFstatus.ImageWbMode = 2;
|
|
|
|
|
|
|
+ settings.ImageWbMode = 2;
|
|
|
}
|
|
}
|
|
|
else if (_wbm == "office") {
|
|
else if (_wbm == "office") {
|
|
|
- CFstatus.ImageWbMode = 3;
|
|
|
|
|
|
|
+ settings.ImageWbMode = 3;
|
|
|
}
|
|
}
|
|
|
else if (_wbm == "home") {
|
|
else if (_wbm == "home") {
|
|
|
- CFstatus.ImageWbMode = 4;
|
|
|
|
|
|
|
+ settings.ImageWbMode = 4;
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- CFstatus.ImageWbMode = 0;
|
|
|
|
|
|
|
+ settings.ImageWbMode = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1051,25 +1040,25 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (httpd_query_key_value(_query, "awb", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "awb", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _awb = std::string(_valuechar);
|
|
std::string _awb = std::string(_valuechar);
|
|
|
- CFstatus.ImageAwb = alphanumericToBoolean(_awb);
|
|
|
|
|
|
|
+ settings.ImageAwb = alphanumericToBoolean(_awb);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "awbg", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "awbg", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _awbg = std::string(_valuechar);
|
|
std::string _awbg = std::string(_valuechar);
|
|
|
- CFstatus.ImageAwbGain = alphanumericToBoolean(_awbg);
|
|
|
|
|
|
|
+ settings.ImageAwbGain = alphanumericToBoolean(_awbg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "aec", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "aec", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _aec = std::string(_valuechar);
|
|
std::string _aec = std::string(_valuechar);
|
|
|
- CFstatus.ImageAec = alphanumericToBoolean(_aec);
|
|
|
|
|
|
|
+ settings.ImageAec = alphanumericToBoolean(_aec);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "aec2", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "aec2", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _aec2 = std::string(_valuechar);
|
|
std::string _aec2 = std::string(_valuechar);
|
|
|
- CFstatus.ImageAec2 = alphanumericToBoolean(_aec2);
|
|
|
|
|
|
|
+ settings.ImageAec2 = alphanumericToBoolean(_aec2);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "ael", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "ael", _valuechar, 30) == ESP_OK)
|
|
@@ -1080,11 +1069,11 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _ael_ = std::stoi(_valuechar);
|
|
int _ael_ = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageAeLevel = clipInt(_ael_, 2, -2);
|
|
|
|
|
|
|
+ settings.ImageAeLevel = clipInt(_ael_, 2, -2);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageAeLevel = clipInt(_ael_, 5, -5);
|
|
|
|
|
|
|
+ settings.ImageAeLevel = clipInt(_ael_, 5, -5);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1095,14 +1084,14 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_aecv))
|
|
if (isStringNumeric(_aecv))
|
|
|
{
|
|
{
|
|
|
int _aecv_ = std::stoi(_valuechar);
|
|
int _aecv_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageAecValue = clipInt(_aecv_, 1200, 0);
|
|
|
|
|
|
|
+ settings.ImageAecValue = clipInt(_aecv_, 1200, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "agc", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "agc", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _agc = std::string(_valuechar);
|
|
std::string _agc = std::string(_valuechar);
|
|
|
- CFstatus.ImageAgc = alphanumericToBoolean(_agc);
|
|
|
|
|
|
|
+ settings.ImageAgc = alphanumericToBoolean(_agc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "agcg", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "agcg", _valuechar, 30) == ESP_OK)
|
|
@@ -1111,50 +1100,50 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_agcg))
|
|
if (isStringNumeric(_agcg))
|
|
|
{
|
|
{
|
|
|
int _agcg_ = std::stoi(_valuechar);
|
|
int _agcg_ = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageAgcGain = clipInt(_agcg_, 30, 0);
|
|
|
|
|
|
|
+ settings.ImageAgcGain = clipInt(_agcg_, 30, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "bpc", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "bpc", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _bpc = std::string(_valuechar);
|
|
std::string _bpc = std::string(_valuechar);
|
|
|
- CFstatus.ImageBpc = alphanumericToBoolean(_bpc);
|
|
|
|
|
|
|
+ settings.ImageBpc = alphanumericToBoolean(_bpc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "wpc", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "wpc", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _wpc = std::string(_valuechar);
|
|
std::string _wpc = std::string(_valuechar);
|
|
|
- CFstatus.ImageWpc = alphanumericToBoolean(_wpc);
|
|
|
|
|
|
|
+ settings.ImageWpc = alphanumericToBoolean(_wpc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "rgma", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "rgma", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _rgma = std::string(_valuechar);
|
|
std::string _rgma = std::string(_valuechar);
|
|
|
- CFstatus.ImageRawGma = alphanumericToBoolean(_rgma);
|
|
|
|
|
|
|
+ settings.ImageRawGma = alphanumericToBoolean(_rgma);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "lenc", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "lenc", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _lenc = std::string(_valuechar);
|
|
std::string _lenc = std::string(_valuechar);
|
|
|
- CFstatus.ImageLenc = alphanumericToBoolean(_lenc);
|
|
|
|
|
|
|
+ settings.ImageLenc = alphanumericToBoolean(_lenc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "mirror", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "mirror", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _mirror = std::string(_valuechar);
|
|
std::string _mirror = std::string(_valuechar);
|
|
|
- CFstatus.ImageHmirror = alphanumericToBoolean(_mirror);
|
|
|
|
|
|
|
+ settings.ImageHmirror = alphanumericToBoolean(_mirror);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "flip", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "flip", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _flip = std::string(_valuechar);
|
|
std::string _flip = std::string(_valuechar);
|
|
|
- CFstatus.ImageVflip = alphanumericToBoolean(_flip);
|
|
|
|
|
|
|
+ settings.ImageVflip = alphanumericToBoolean(_flip);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "dcw", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "dcw", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _dcw = std::string(_valuechar);
|
|
std::string _dcw = std::string(_valuechar);
|
|
|
- CFstatus.ImageDcw = alphanumericToBoolean(_dcw);
|
|
|
|
|
|
|
+ settings.ImageDcw = alphanumericToBoolean(_dcw);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "den", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "den", _valuechar, 30) == ESP_OK)
|
|
@@ -1165,11 +1154,11 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _ImageDenoiseLevel = std::stoi(_valuechar);
|
|
int _ImageDenoiseLevel = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageDenoiseLevel = 0;
|
|
|
|
|
|
|
+ settings.ImageDenoiseLevel = 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageDenoiseLevel = clipInt(_ImageDenoiseLevel, 8, 0);
|
|
|
|
|
|
|
+ settings.ImageDenoiseLevel = clipInt(_ImageDenoiseLevel, 8, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1177,7 +1166,7 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (httpd_query_key_value(_query, "zoom", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "zoom", _valuechar, 30) == ESP_OK)
|
|
|
{
|
|
{
|
|
|
std::string _zoom = std::string(_valuechar);
|
|
std::string _zoom = std::string(_valuechar);
|
|
|
- CFstatus.ImageZoomEnabled = alphanumericToBoolean(_zoom);
|
|
|
|
|
|
|
+ settings.ImageZoomEnabled = alphanumericToBoolean(_zoom);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (httpd_query_key_value(_query, "zoomx", _valuechar, 30) == ESP_OK)
|
|
if (httpd_query_key_value(_query, "zoomx", _valuechar, 30) == ESP_OK)
|
|
@@ -1188,15 +1177,15 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _ImageZoomOffsetX = std::stoi(_valuechar);
|
|
int _ImageZoomOffsetX = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 480, -480);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 480, -480);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 704, -704);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 704, -704);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 960, -960);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetX = clipInt(_ImageZoomOffsetX, 960, -960);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1209,15 +1198,15 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _ImageZoomOffsetY = std::stoi(_valuechar);
|
|
int _ImageZoomOffsetY = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 360, -360);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 360, -360);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 528, -528);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 528, -528);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 720, -720);
|
|
|
|
|
|
|
+ settings.ImageZoomOffsetY = clipInt(_ImageZoomOffsetY, 720, -720);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1230,15 +1219,15 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
int _ImageZoomSize = std::stoi(_valuechar);
|
|
int _ImageZoomSize = std::stoi(_valuechar);
|
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
if (CCstatus.CamSensor_id == OV2640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 29, 0);
|
|
|
|
|
|
|
+ settings.ImageZoomSize = clipInt(_ImageZoomSize, 29, 0);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
else if (CCstatus.CamSensor_id == OV3660_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 43, 0);
|
|
|
|
|
|
|
+ settings.ImageZoomSize = clipInt(_ImageZoomSize, 43, 0);
|
|
|
}
|
|
}
|
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
else if (CCstatus.CamSensor_id == OV5640_PID)
|
|
|
{
|
|
{
|
|
|
- CFstatus.ImageZoomSize = clipInt(_ImageZoomSize, 59, 0);
|
|
|
|
|
|
|
+ settings.ImageZoomSize = clipInt(_ImageZoomSize, 59, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1249,18 +1238,18 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
if (isStringNumeric(_ledi))
|
|
if (isStringNumeric(_ledi))
|
|
|
{
|
|
{
|
|
|
int _ImageLedIntensity = std::stoi(_valuechar);
|
|
int _ImageLedIntensity = std::stoi(_valuechar);
|
|
|
- CFstatus.ImageLedIntensity = Camera.SetLEDIntensity(_ImageLedIntensity);
|
|
|
|
|
|
|
+ settings.ImageLedIntensity = Camera.SetLEDIntensity(_ImageLedIntensity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (_task.compare("cam_settings") == 0)
|
|
|
|
|
|
|
+ if (!isTestTake)
|
|
|
{
|
|
{
|
|
|
- // wird aufgerufen, wenn das Referenzbild + Kameraeinstellungen gespeichert wurden
|
|
|
|
|
- setCFstatusToCCstatus(); // CFstatus >>> CCstatus
|
|
|
|
|
- CFstatus.previewCapturePending = false;
|
|
|
|
|
-
|
|
|
|
|
- // Kameraeinstellungen wurden verädert
|
|
|
|
|
- CFstatus.changedCameraSettings = true;
|
|
|
|
|
|
|
+ // Saved camera settings are committed in CCstatus.
|
|
|
|
|
+ if (Camera.setSensorDatenFromCCstatus() != ESP_OK)
|
|
|
|
|
+ {
|
|
|
|
|
+ httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Could not apply committed camera settings");
|
|
|
|
|
+ return ESP_FAIL;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
ESP_LOGD(TAG, "Cam Settings set");
|
|
ESP_LOGD(TAG, "Cam Settings set");
|
|
|
std::string _zw = "CamSettingsSet";
|
|
std::string _zw = "CamSettingsSet";
|
|
@@ -1269,19 +1258,22 @@ esp_err_t handler_editflow(httpd_req_t *req)
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- // wird aufgerufen, wenn ein neues Referenzbild erstellt oder aktualisiert wurde
|
|
|
|
|
- // CFstatus >>> Kamera
|
|
|
|
|
- if (setCFstatusToCam() != ESP_OK)
|
|
|
|
|
|
|
+ // Only test_take applies temporary camera settings.
|
|
|
|
|
+ if (Camera.ApplyPreviewSettings(settings) != ESP_OK)
|
|
|
{
|
|
{
|
|
|
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Could not apply temporary camera settings");
|
|
httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Could not apply temporary camera settings");
|
|
|
return ESP_FAIL;
|
|
return ESP_FAIL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- CFstatus.changedCameraSettings = true;
|
|
|
|
|
- CFstatus.previewCapturePending = true;
|
|
|
|
|
-
|
|
|
|
|
ESP_LOGD(TAG, "test_take - vor TakeImage");
|
|
ESP_LOGD(TAG, "test_take - vor TakeImage");
|
|
|
std::string image_temp = flowctrl.doSingleStep("[TakeImage]", _host);
|
|
std::string image_temp = flowctrl.doSingleStep("[TakeImage]", _host);
|
|
|
|
|
+ const std::string rawImagePath = "/img_tmp/raw.jpg";
|
|
|
|
|
+ const std::size_t rawImagePosition = image_temp.find(rawImagePath);
|
|
|
|
|
+ if (rawImagePosition != std::string::npos)
|
|
|
|
|
+ {
|
|
|
|
|
+ image_temp.replace(rawImagePosition, rawImagePath.length(),
|
|
|
|
|
+ rawImagePath + "?preview=1");
|
|
|
|
|
+ }
|
|
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
|
|
httpd_resp_send(req, image_temp.c_str(), image_temp.length());
|
|
httpd_resp_send(req, image_temp.c_str(), image_temp.length());
|
|
|
}
|
|
}
|