Skip to content

Commit a6a013a

Browse files
Alrik Vidstromsebromero
Alrik Vidstrom
authored andcommitted
Change parameter names for flipping and mirroring
The parameter names are changed from _mode to _enable.
1 parent 4a46b58 commit a6a013a

File tree

10 files changed

+29
-32
lines changed

10 files changed

+29
-32
lines changed

libraries/Camera/src/camera.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,14 @@ int Camera::zoomToCenter(int32_t zoom_resolution)
600600
return setResolutionWithZoom(this->original_resolution, zoom_resolution, zoom_x, zoom_y);
601601
}
602602

603-
int Camera::setVerticalFlip(bool flip_mode)
603+
int Camera::setVerticalFlip(bool flip_enable)
604604
{
605-
return (this->sensor->setVerticalFlip(flip_mode));
605+
return (this->sensor->setVerticalFlip(flip_enable));
606606
}
607607

608-
int Camera::setHorizontalMirror(bool mirror_mode)
608+
int Camera::setHorizontalMirror(bool mirror_enable)
609609
{
610-
return (this->sensor->setHorizontalMirror(mirror_mode));
610+
return (this->sensor->setHorizontalMirror(mirror_enable));
611611
}
612612

613613
uint32_t Camera::getResolutionWidth()

libraries/Camera/src/camera.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,13 @@ class ImageSensor {
279279
* @return int 0 if no motion is detected, non-zero if motion is detected
280280
*/
281281
virtual int motionDetected() = 0;
282-
283-
virtual int setVerticalFlip(bool flip_mode) = 0;
284-
virtual int setHorizontalMirror(bool flip_mode) = 0;
285-
286-
282+
virtual int setVerticalFlip(bool flip_enable) = 0;
283+
virtual int setHorizontalMirror(bool flip_enable) = 0;
287284
/**
288285
* @brief Output debug information to a stream.
289286
* You can use this function to output debug information to the serial port by passing Serial as the stream.
290287
* @param stream Stream to output the debug information
291-
*/
288+
*/
292289
virtual void debug(Stream &stream) = 0;
293290

294291
/**
@@ -533,8 +530,8 @@ class Camera {
533530
int motionDetected();
534531
int zoomTo(int32_t zoom_resolution, uint32_t zoom_x, uint32_t zoom_y);
535532
int zoomToCenter(int32_t zoom_resolution);
536-
int setVerticalFlip(bool flip_mode);
537-
int setHorizontalMirror(bool mirror_mode);
533+
int setVerticalFlip(bool flip_enable);
534+
int setHorizontalMirror(bool mirror_enable;
538535
uint32_t getResolutionWidth();
539536
uint32_t getResolutionHeight();
540537

libraries/GC2145/gc2145.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,26 +763,26 @@ int GC2145::setFrameRate(int32_t framerate)
763763
return 0;
764764
}
765765

766-
int GC2145::setVerticalFlip(bool flip_mode)
766+
int GC2145::setVerticalFlip(bool flip_enable)
767767
{
768768
// The GC2145 doesn't return this value when reading the Analog mode 1 register
769769
// so we have to save it for setHorizontalMirror()
770-
vertical_flip_state = flip_mode;
770+
vertical_flip_state = flip_enable;
771771
// Using the Analog mode 1 register (0x17)
772772
uint8_t old_value = regRead(GC2145_I2C_ADDR, 0x17);
773-
int retVal = regWrite(GC2145_I2C_ADDR, 0x17, (old_value & 0b11111100) | (flip_mode << 1) | horizontal_mirror_state);
773+
int retVal = regWrite(GC2145_I2C_ADDR, 0x17, (old_value & 0b11111100) | (flip_enable << 1) | horizontal_mirror_state);
774774
// Notice that the error codes from regWrite() are positive ones passed on from Wire, not -1
775775
return ((0 == retVal) ? 0 : -1);
776776
}
777777

778-
int GC2145::setHorizontalMirror(bool mirror_mode)
778+
int GC2145::setHorizontalMirror(bool mirror_enable)
779779
{
780780
// The GC2145 doesn't return this value when reading the Analog mode 1 register
781781
// so we have to save it for setVerticalFlip()
782-
horizontal_mirror_state = mirror_mode;
782+
horizontal_mirror_state = mirror_enable;
783783
// Using the Analog mode 1 register (0x17)
784784
uint8_t old_value = regRead(GC2145_I2C_ADDR, 0x17);
785-
int retVal = regWrite(GC2145_I2C_ADDR, 0x17, (old_value & 0b11111100) | mirror_mode | (vertical_flip_state << 1));
785+
int retVal = regWrite(GC2145_I2C_ADDR, 0x17, (old_value & 0b11111100) | mirror_enable | (vertical_flip_state << 1));
786786
// Notice that the error codes from regWrite() are positive ones passed on from Wire, not -1
787787
return ((0 == retVal) ? 0 : -1);
788788
}

libraries/GC2145/gc2145.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class GC2145: public ImageSensor {
4646
int setMotionDetectionWindow(uint32_t x, uint32_t y, uint32_t w, uint32_t h) { return 0; };
4747
int setMotionDetectionThreshold(uint32_t threshold) { return 0; };
4848
int motionDetected() { return 0; };
49-
int setVerticalFlip(bool flip_mode);
50-
int setHorizontalMirror(bool mirror_mode);
49+
int setVerticalFlip(bool flip_enable);
50+
int setHorizontalMirror(bool mirror_enable);
5151
void debug(Stream &stream);
5252
};
5353

libraries/Himax_HM01B0/himax.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,12 @@ int HM01B0::reset()
341341
return (max_timeout > 0) ? 0 : -1;
342342
}
343343

344-
int HM01B0::setVerticalFlip(bool flip_mode)
344+
int HM01B0::setVerticalFlip(bool flip_enable)
345345
{
346346
return -1;
347347
}
348348

349-
int HM01B0::setHorizontalMirror(bool mirror_mode)
349+
int HM01B0::setHorizontalMirror(bool mirror_enable)
350350
{
351351
return -1;
352352
}

libraries/Himax_HM01B0/himax.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class HM01B0: public ImageSensor {
5050
int motionDetected();
5151
int pollMotionDetection();
5252
int clearMotionDetection();
53-
int setVerticalFlip(bool flip_mode);
54-
int setHorizontalMirror(bool mirror_mode);
53+
int setVerticalFlip(bool flip_enable);
54+
int setHorizontalMirror(bool mirror_enable);
5555

5656
uint8_t printRegs();
5757
void debug(Stream &stream);

libraries/Himax_HM0360/hm0360.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,12 @@ int HM0360::reset()
586586
return (max_timeout > 0) ? 0 : -1;
587587
}
588588

589-
int HM0360::setVerticalFlip(bool flip_mode)
589+
int HM0360::setVerticalFlip(bool flip_enable)
590590
{
591591
return -1;
592592
}
593593

594-
int HM0360::setHorizontalMirror(bool mirror_mode)
594+
int HM0360::setHorizontalMirror(bool mirror_enable)
595595
{
596596
return -1;
597597
}

libraries/Himax_HM0360/hm0360.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class HM0360: public ImageSensor {
5050
int motionDetected();
5151
int pollMotionDetection();
5252
int clearMotionDetection();
53-
int setVerticalFlip(bool flip_mode);
54-
int setHorizontalMirror(bool mirror_mode);
53+
int setVerticalFlip(bool flip_enable);
54+
int setHorizontalMirror(bool mirror_enable);
5555

5656
uint8_t printRegs();
5757
void debug(Stream &stream);

libraries/OV7670/ov7670.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,12 @@ int OV7670::setFrameRate(int32_t framerate)
697697
return 0;
698698
}
699699

700-
int OV7670::setVerticalFlip(bool flip_mode)
700+
int OV7670::setVerticalFlip(bool flip_enable)
701701
{
702702
return -1;
703703
}
704704

705-
int OV7670::setHorizontalMirror(bool mirror_mode)
705+
int OV7670::setHorizontalMirror(bool mirror_enable)
706706
{
707707
return -1;
708708
}

libraries/OV7670/ov767x.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class OV7670: public ImageSensor {
5252
int setMotionDetectionWindow(uint32_t x, uint32_t y, uint32_t w, uint32_t h) { return 0; };
5353
int setMotionDetectionThreshold(uint32_t threshold) { return 0; };
5454
int motionDetected() { return 0; };
55-
int setVerticalFlip(bool flip_mode);
56-
int setHorizontalMirror(bool mirror_mode);
55+
int setVerticalFlip(bool flip_enable);
56+
int setHorizontalMirror(bool mirror_enable);
5757
void debug(Stream &stream);
5858
};
5959

0 commit comments

Comments
 (0)