Skip to content

Commit ef80ad4

Browse files
author
Alrik Vidstrom
committed
Change parameter names for flipping and mirroring
The parameter names are changed from _mode to _enable.
1 parent 39bb1ba commit ef80ad4

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

libraries/Camera/src/camera.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -598,14 +598,14 @@ int Camera::zoomToCenter(int32_t zoom_resolution)
598598
return setResolutionWithZoom(this->original_resolution, zoom_resolution, zoom_x, zoom_y);
599599
}
600600

601-
int Camera::setVerticalFlip(bool flip_mode)
601+
int Camera::setVerticalFlip(bool flip_enable)
602602
{
603-
return (this->sensor->setVerticalFlip(flip_mode));
603+
return (this->sensor->setVerticalFlip(flip_enable));
604604
}
605605

606-
int Camera::setHorizontalMirror(bool mirror_mode)
606+
int Camera::setHorizontalMirror(bool mirror_enable)
607607
{
608-
return (this->sensor->setHorizontalMirror(mirror_mode));
608+
return (this->sensor->setHorizontalMirror(mirror_enable));
609609
}
610610

611611
uint32_t Camera::getResolutionWidth()

libraries/Camera/src/camera.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ class ImageSensor {
7878
virtual int setMotionDetectionWindow(uint32_t x, uint32_t y, uint32_t w, uint32_t h) = 0;
7979
virtual int setMotionDetectionThreshold(uint32_t threshold) = 0;
8080
virtual int motionDetected() = 0;
81-
virtual int setVerticalFlip(bool flip_mode) = 0;
82-
virtual int setHorizontalMirror(bool flip_mode) = 0;
81+
virtual int setVerticalFlip(bool flip_enable) = 0;
82+
virtual int setHorizontalMirror(bool flip_enable) = 0;
8383
virtual void debug(Stream &stream) = 0;
8484

8585
virtual int setStandby(bool enable) {
@@ -143,8 +143,8 @@ class Camera {
143143
int motionDetected();
144144
int zoomTo(int32_t zoom_resolution, uint32_t zoom_x, uint32_t zoom_y);
145145
int zoomToCenter(int32_t zoom_resolution);
146-
int setVerticalFlip(bool flip_mode);
147-
int setHorizontalMirror(bool mirror_mode);
146+
int setVerticalFlip(bool flip_enable);
147+
int setHorizontalMirror(bool mirror_enable;
148148
uint32_t getResolutionWidth();
149149
uint32_t getResolutionHeight();
150150
void debug(Stream &stream);

libraries/GC2145/gc2145.cpp

+6-6
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

+2-2
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

+2-2
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

+2-2
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

+2-2
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

+2-2
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

+2-2
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

+2-2
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)