mirror of
https://github.com/Motion-Project/motion.git
synced 2026-04-18 21:17:04 -04:00
minor improvements
indentation shorted string comparison
This commit is contained in:
14
motion.h
14
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.
|
||||
|
||||
@@ -3214,8 +3214,8 @@ Motion automatically swaps width and height if you rotate 90 or 270 degrees, so
|
||||
</ul>
|
||||
<p></p>
|
||||
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.
|
||||
<p></p>
|
||||
|
||||
<h3><a name="width"></a> width </h3>
|
||||
|
||||
18
rotate.c
18
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user