[vlc-devel] [PATCH 3/12] esformat: fix ORIENT_LEFT_BOTTOM and ORIENT_RIGHT_TOP descriptions

Lyndon Brown jnqnfe at gmail.com
Sat Sep 26 17:02:47 CEST 2020


On Sat, 2020-09-26 at 12:48 +0200, Romain Vimont wrote:
> On Thu, Sep 24, 2020 at 11:29:58PM +0100, Lyndon Brown wrote:
> > From: Lyndon Brown <jnqnfe at gmail.com>
> > Date: Sun, 7 Jan 2018 19:22:38 +0000
> > Subject: esformat: fix ORIENT_LEFT_BOTTOM and ORIENT_RIGHT_TOP
> > descriptions
> > 
> > They had 90 degree clockwise / anti-clockwise rotation the wrong
> > way
> > around.
> > 
> > diff --git a/include/vlc_es.h b/include/vlc_es.h
> > index a7af6c118c..841fa05bf6 100644
> > --- a/include/vlc_es.h
> > +++ b/include/vlc_es.h
> > @@ -181,8 +181,8 @@ typedef enum video_orientation_t
> >      ORIENT_BOTTOM_LEFT, /**< Flipped vertically */
> >      ORIENT_BOTTOM_RIGHT, /**< Rotated 180 degrees */
> >      ORIENT_LEFT_TOP, /**< Transposed */
> > -    ORIENT_LEFT_BOTTOM, /**< Rotated 90 degrees clockwise */
> > -    ORIENT_RIGHT_TOP, /**< Rotated 90 degrees anti-clockwise */
> > +    ORIENT_LEFT_BOTTOM, /**< Rotated 90 degrees anti-clockwise */
> > +    ORIENT_RIGHT_TOP, /**< Rotated 90 degrees clockwise */
> 
> I think is was correct before the patch:
> 
> ORIENT_LEFT_BOTTOM: top line represents LEFT, left column BOTTOM.
> 
>  original          rotated
>   +-T-+             +-L-+
>   L   R    ---->    B   T    : it's rotated 90 degrees clockwise
>   +-B-+             +-R-+
> 
> Similarly ORIENT_RIGHT_TOP was correct.

No, I'm certain that it wasn't right before...

As you show in your diagram, "original" is the picture oriented
"normally", while "rotated" with left moving to top, etc, is it having
been rotated 90 degrees clockwise.

ORIENT_X_Y means that top has moved to X from "normal" and left has
moved to Y...

Thus in the case of ORIENT_LEFT_BOTTOM, top->left and left->bottom,
which is a 90 degrees **anti-clockwise** rotation, but was mistakenly
described in the comment as being clockwise.

Similarly with ORIENT_RIGHT_TOP, top->right and left->top, which is a
90 degrees **clockwise** rotation, but was mistakenly described in the
comment as being anti-clockwise.

The documentation around this is improved in the "esformat" work I
submitted separately. (Which also carried this fix - I wouldn't
normally put the same thing in two submissions).

Regards,
Lyndon



More information about the vlc-devel mailing list