-
Notifications
You must be signed in to change notification settings - Fork 190
Master al #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Master al #8
Changes from all commits
4a0b3c6
9e503dd
6135241
d739cf4
1763f2f
12370f5
ac169f0
c61dc47
0ce16c2
33e5c93
2035e41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,19 @@ | |
|
||
namespace esp32cam { | ||
|
||
struct StreamMjpegConfig | ||
{ | ||
/// minimum interval between frame captures. | ||
int minInterval = 0; | ||
/// maximum number of frames before disconnecting. | ||
int maxFrames = -1; | ||
/// time limit of writing one frame in millis. | ||
int frameTimeout = 10000; | ||
/// Abort flags | ||
bool bAbort = false; | ||
|
||
}; | ||
|
||
class CameraClass | ||
{ | ||
public: | ||
|
@@ -29,33 +42,231 @@ class CameraClass | |
bool | ||
changeResolution(const Resolution& resolution, int sleepFor = 500); | ||
|
||
/** \brief Change camera resolution. | ||
* \pre Change Camera Frequence Clock | ||
* \param iMhz new Frequence, must be in MHZ | ||
*/ | ||
bool | ||
changeFrequence(int iMhz); | ||
|
||
/** \brief Change Sensor Contrast level | ||
* must be -2 to +2, default 0 | ||
*/ | ||
bool | ||
changeContrast(int ilevel); | ||
|
||
/** \brief Change Brightness level | ||
* \param ilevel must be -2 to +2, default 0 | ||
*/ | ||
bool | ||
changeBrightness(int ilevel); | ||
|
||
/** \brief Change Saturation level | ||
* \param ilevel must be -2 to +2, default 0 | ||
*/ | ||
bool | ||
changeSaturation(int ilevel); | ||
|
||
/** \brief Change SpecialEffect | ||
* \param ilevel must be > 0 && <= NUM_SPECIAL_EFFECTS, default 0 | ||
* \ 1 = no effect | ||
* \ 2 = negative | ||
* \ 3 = black and white | ||
* \ 4 = reddish | ||
* \ 5 = greenish | ||
* \ 6 = blue | ||
* \ 7 = retro | ||
*/ | ||
bool | ||
changeSpecialEffect(int ilevel); | ||
|
||
/** \brief Change WbMode | ||
* \param ilevel must be > 0 && <= NUM_WB_MODES, default 0 | ||
* \ 0 = default | ||
* \ 1 = sunny | ||
* \ 2 = cloudy | ||
* \ 3 = office | ||
* \ 4 = home | ||
*/ | ||
bool | ||
changeWbMode(int ilevel); | ||
|
||
/** \brief Change AE Levels | ||
* \param ilevel must be -2 to +2, default 0 | ||
*/ | ||
bool | ||
changeAeLevels(int ilevel); | ||
|
||
/** \brief Enable/Disable AEC (Auto Exposure Control) | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changAutoExposurecontrol(int iEnable); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some drive-by comments while I was looking at OV2640 libraries... There are a bunch of methods named |
||
|
||
/** \brief Change AGC Gain | ||
* \param ilevel must be >= 0 and <= 30, default 30 | ||
*/ | ||
bool | ||
changAgcGain(int ilevel); | ||
|
||
/** \brief Change Gainceiling | ||
* \param iGainCeiling must be between GAINCEILING_2X and GAINCEILING_128X | ||
*/ | ||
bool | ||
changGainceilingSensor(int iGainCeiling); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't that be Can And maybe drop There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possible that some settings did not work at all. |
||
|
||
/** \brief Enable/Disable Awb GainControl | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changeAwbGainControl(int iEnable); | ||
|
||
/** \brief Enable/Disable Gaincontrol | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changeGaincontrol(int iEnable); | ||
|
||
/** \brief Enable/Disable Testing Colorbar | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changeColorbar(int iEnable); | ||
|
||
/** \brief Enable/Disable Whitebalance | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changeWhitebalance(int iEnable); | ||
|
||
/** \brief Change JPEG Quality | ||
* \param iEnable iQuality must be within 0 and 63 | ||
*/ | ||
bool changeQuality(int iQuality); | ||
|
||
/** \brief Change AEC Value | ||
* \param iEnable iValue must be 0 to 1200, default 0 | ||
*/ | ||
bool | ||
changeAecValue(int iValue); | ||
|
||
/** \brief Enable/Disable Auto/Manual Exposure control | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changAec2(int iEnable); | ||
|
||
/** \brief Enable/Disable horizontal mirror | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changHMirror(int iEnable); | ||
|
||
/** \brief Enable/Disable vertical mirror | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changVFlip(int iEnable); | ||
|
||
/** \brief Enable/Disable black pixel correction | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changBPC(int iEnable); | ||
|
||
/** \brief Enable/Disable white pixel correction | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changWPC(int iEnable); | ||
|
||
/** \brief Enable/Disable Denoise Control | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changDenoise(int iEnable); | ||
|
||
/** \brief Enable/Disable Lenc Correction | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is Lenc correction? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some questions will be answered here: And some you need to research in ov2640 sensor doc (Or whatever sensor you have) I remember the lenc and rawgma had big impact on how low light is being handeled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changLenc(int iEnable); | ||
|
||
/** \brief Enable/Disable RAW Gamma | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changRawGMA(int iEnable); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
/** \brief Enable/Disable DCW | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is DCW? |
||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changDcw(int iEnable); | ||
|
||
/** \brief Enable/Disable COM7_ZOOM_EN | ||
* \param iEnable must be 0(disable) or 1 (enable) | ||
*/ | ||
bool | ||
changeZoom(int iEnable); | ||
|
||
/** \brief Get detectedBandMode Light Frequence Detection (Antiflicker) | ||
* return | ||
* \ 0 = 60hz | ||
* \ 1 = 50hz | ||
*/ | ||
int | ||
getBandMode(void); | ||
|
||
/** \brief Change BandMode Light Frequewnce Detection (Antiflicker) | ||
* \param ilevel must be > 0 && <= NUM_SPECIAL_EFFECTS, default 0 | ||
* \ 0 = AUTO | ||
* \ 1 = MANUAL 50hz | ||
* \ 2 = MANUAL 60hz | ||
*/ | ||
bool | ||
changeBandMode(int ilevel); | ||
|
||
/** \brief TODO | ||
* \param iMul | ||
* \param iPclk | ||
* \param iPre | ||
* \ is set to 50hz or 60hz. | ||
*/ | ||
bool | ||
changePll(int iMul, int iPre, int iPclk); | ||
|
||
/** \brief Set Double Clock Mode for ov2640 | ||
*/ | ||
bool | ||
setDoubleClk(); | ||
|
||
/** \brief Capture a frame of picture. | ||
*/ | ||
std::unique_ptr<Frame> | ||
capture(); | ||
|
||
struct StreamMjpegConfig | ||
{ | ||
/// minimum interval between frame captures. | ||
int minInterval = 0; | ||
/// maximum number of frames before disconnecting. | ||
int maxFrames = -1; | ||
/// time limit of writing one frame in millis. | ||
int frameTimeout = 10000; | ||
}; | ||
|
||
/** \brief Stream Motion JPEG. | ||
* \pre The camera has been initialized to JPEG mode. | ||
* \return number of frames streamed. | ||
*/ | ||
int | ||
streamMjpeg(Client& client, const StreamMjpegConfig& cfg); | ||
|
||
int | ||
streamMjpeg(Client& client) | ||
{ | ||
int streamMjpeg(Client& client, const StreamMjpegConfig& cfg); | ||
int streamMjpeg(Client& client) { | ||
return streamMjpeg(client, StreamMjpegConfig()); | ||
} | ||
|
||
/** \brief Stream Motion JPEG. | ||
* \Function cloned for AsyncClient | ||
* \pre The camera has been initialized to JPEG mode. | ||
* \return number of frames streamed. | ||
*/ | ||
int streamMjpeg(AsyncClient& client, const StreamMjpegConfig* cfg); | ||
|
||
/** \brief Return value for esp API calls | ||
* \Store last api return value here useful for error handling! | ||
*/ | ||
esp_err_t lastEspErr; | ||
|
||
}; | ||
|
||
extern CameraClass Camera; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't proper Doxygen syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with commit -a -amend, please verify if it is correct now - have not used doxygen yet