This commit is contained in:
jomjol
2021-02-27 12:51:50 +01:00
parent 9dbad050fd
commit 688cee9463
13 changed files with 91 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ void ClassFlowMakeImage::SetInitialParameter(void)
ImageSize = FRAMESIZE_VGA;
SaveAllFiles = false;
disabled = false;
FixedExposure = false;
namerawimage = "/sdcard/img_tmp/raw.jpg";
}
@@ -97,6 +98,11 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
_saturation = stoi(zerlegt[1]);
}
if ((toUpper(zerlegt[0]) == "FIXEDEXPOSURE") && (zerlegt.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
FixedExposure = true;
}
}
Camera.SetBrightnessContrastSaturation(_brightness, _contrast, _saturation);
@@ -107,6 +113,18 @@ bool ClassFlowMakeImage::ReadParameter(FILE* pfile, string& aktparamgraph)
rawImage = new CImageBasis();
rawImage->CreateEmptyImage(image_width, image_height, 3);
waitbeforepicture_store = waitbeforepicture;
if (FixedExposure)
{
printf("Fixed Exposure enabled!\n");
int flashdauer = (int) (waitbeforepicture * 1000);
Camera.EnableAutoExposure(flashdauer);
waitbeforepicture = 0.2;
// flashdauer = (int) (waitbeforepicture * 1000);
// takePictureWithFlash(flashdauer);
// rawImage->SaveToFile("/sdcard/init2.jpg");
}
return true;
}
@@ -121,7 +139,7 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
{
string logPath = CreateLogFolder(zwtime);
int flashdauer = (int) waitbeforepicture * 1000;
int flashdauer = (int) (waitbeforepicture * 1000);
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("ClassFlowMakeImage::doFlow - Before takePictureWithFlash");
@@ -146,7 +164,7 @@ bool ClassFlowMakeImage::doFlow(string zwtime)
esp_err_t ClassFlowMakeImage::SendRawJPG(httpd_req_t *req)
{
int flashdauer = (int) waitbeforepicture * 1000;
int flashdauer = (int) (waitbeforepicture * 1000);
return Camera.CaptureToHTTP(req, flashdauer);
}
@@ -155,7 +173,7 @@ ImageData* ClassFlowMakeImage::SendRawImage()
{
CImageBasis *zw = new CImageBasis(rawImage);
ImageData *id;
int flashdauer = (int) waitbeforepicture * 1000;
int flashdauer = (int) (waitbeforepicture * 1000);
Camera.CaptureToBasisImage(zw, flashdauer);
id = zw->writeToMemoryAsJPG();
delete zw;