Skip to content

Commit 05fcdac

Browse files
committed
add functions to set white/black pixel correction flag
1 parent 6439c4b commit 05fcdac

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/esp32cam.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,34 @@ CameraClass::changVFlip(int iEnable)
296296
return false;
297297
}
298298

299+
bool
300+
CameraClass::changBPC(int iEnable)
301+
{
302+
sensor_t* sensor = esp_camera_sensor_get();
303+
if (sensor == nullptr) {
304+
return false;
305+
}
306+
307+
if (sensor->set_bpc_dsp(sensor, iEnable) == 0) {
308+
return true;
309+
} else
310+
return false;
311+
}
312+
313+
bool
314+
CameraClass::changWPC(int iEnable)
315+
{
316+
sensor_t* sensor = esp_camera_sensor_get();
317+
if (sensor == nullptr) {
318+
return false;
319+
}
320+
321+
if (sensor->set_wpc_dsp(sensor, iEnable) == 0) {
322+
return true;
323+
} else
324+
return false;
325+
}
326+
299327
std::unique_ptr<Frame>
300328
CameraClass::capture()
301329
{

src/esp32cam.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ class CameraClass
141141
*/
142142
bool
143143
changVFlip(int iEnable);
144+
145+
/** \brief Enable/Disable black pixel correction
146+
* \param iEnable must be 0(disable) or 1 (enable)
147+
*/
148+
bool
149+
changBPC(int iEnable);
150+
151+
/** \brief Enable/Disable white pixel correction
152+
* \param iEnable must be 0(disable) or 1 (enable)
153+
*/
154+
bool
155+
changWPC(int iEnable);
144156

145157
/** \brief Capture a frame of picture.
146158
*/

0 commit comments

Comments
 (0)