From 667dd72ef2cd1da8b3ca220cf7fee0640420ff1f Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Thu, 25 May 2017 23:16:58 +0100 Subject: [PATCH] minor improvements indentation shorted string comparison --- motion.h | 14 +++++++------- motion_guide.html | 4 ++-- rotate.c | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/motion.h b/motion.h index 23c2b8dc..658dc2e4 100644 --- a/motion.h +++ b/motion.h @@ -329,9 +329,9 @@ struct images { }; enum FLIP_TYPE { - FLIP_TYPE_NONE, - FLIP_TYPE_HORIZONTAL, - FLIP_TYPE_VERTICAL + FLIP_TYPE_NONE, + FLIP_TYPE_HORIZONTAL, + FLIP_TYPE_VERTICAL }; /* Contains data for image rotation, see rotate.c. */ @@ -346,12 +346,12 @@ struct rotdata { */ int degrees; - /* - * Rotate image over the Horizontal or Vertical axis. + /* + * Rotate image over the Horizontal or Vertical axis. * As with degrees, this is the value actually used, and value of conf.flip_axis * cannot be used. - */ - enum FLIP_TYPE axis; + */ + enum FLIP_TYPE axis; /* * Capture width and height - different from output width and height if * rotating 90 or 270 degrees. diff --git a/motion_guide.html b/motion_guide.html index ef9713a5..4cee11c2 100644 --- a/motion_guide.html +++ b/motion_guide.html @@ -3214,8 +3214,8 @@ Motion automatically swaps width and height if you rotate 90 or 270 degrees, so

Flip the image according to specified axis. The flip affects all saved images as well as movies. -The flip feature is used when the camera is pointed towards a mirror or provides itself a mirrored image (as found in some cars) -Note that the CPU load increases when using this feature with a value other than none. Also note that +The flip feature is used when the camera is pointed towards a mirror or provides itself a mirrored image (as found in some cars). +Note that the CPU load increases when using this feature with a value other than none.

width

diff --git a/rotate.c b/rotate.c index bc4f90f3..af73f5f3 100644 --- a/rotate.c +++ b/rotate.c @@ -206,9 +206,9 @@ void rotate_init(struct context *cnt) cnt->rotate_data.degrees = cnt->conf.rotate_deg % 360; /* Range: 0..359 */ } - if ( strncmp(cnt->conf.flip_axis, "h", 1) == 0 ) { + if (cnt->conf.flip_axis[0]=='h') { cnt->rotate_data.axis = FLIP_TYPE_HORIZONTAL; - } else if ( strncmp(cnt->conf.flip_axis, "v", 1) == 0 ) { + } else if (cnt->conf.flip_axis[0]=='v') { cnt->rotate_data.axis = FLIP_TYPE_VERTICAL; } else { cnt->rotate_data.axis = FLIP_TYPE_NONE; @@ -347,18 +347,18 @@ int rotate_map(struct context *cnt, unsigned char *map) switch (axis) { case FLIP_TYPE_HORIZONTAL: flip_inplace_horizontal(map,width, height); - if (cnt->imgs.type == VIDEO_PALETTE_YUV420P) { - flip_inplace_horizontal(map + wh, w2, h2); - flip_inplace_horizontal(map + wh + wh4, w2, h2); + if (cnt->imgs.type == VIDEO_PALETTE_YUV420P) { + flip_inplace_horizontal(map + wh, w2, h2); + flip_inplace_horizontal(map + wh + wh4, w2, h2); } break; case FLIP_TYPE_VERTICAL: flip_inplace_vertical(map,width, height); - if (cnt->imgs.type == VIDEO_PALETTE_YUV420P) { - flip_inplace_vertical(map + wh, w2, h2); - flip_inplace_vertical(map + wh + wh4, w2, h2); + if (cnt->imgs.type == VIDEO_PALETTE_YUV420P) { + flip_inplace_vertical(map + wh, w2, h2); + flip_inplace_vertical(map + wh + wh4, w2, h2); } - break; + break; default: break; }