120c516838913956e6f86347b305fe29506e2b491Jiho Chang/*
220c516838913956e6f86347b305fe29506e2b491Jiho Chang * Copyright@ Samsung Electronics Co. LTD
320c516838913956e6f86347b305fe29506e2b491Jiho Chang *
420c516838913956e6f86347b305fe29506e2b491Jiho Chang * Licensed under the Apache License, Version 2.0 (the "License");
520c516838913956e6f86347b305fe29506e2b491Jiho Chang * you may not use this file except in compliance with the License.
620c516838913956e6f86347b305fe29506e2b491Jiho Chang * You may obtain a copy of the License at
720c516838913956e6f86347b305fe29506e2b491Jiho Chang *
820c516838913956e6f86347b305fe29506e2b491Jiho Chang *      http://www.apache.org/licenses/LICENSE-2.0
920c516838913956e6f86347b305fe29506e2b491Jiho Chang *
1020c516838913956e6f86347b305fe29506e2b491Jiho Chang * Unless required by applicable law or agreed to in writing, software
1120c516838913956e6f86347b305fe29506e2b491Jiho Chang * distributed under the License is distributed on an "AS IS" BASIS,
1220c516838913956e6f86347b305fe29506e2b491Jiho Chang * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320c516838913956e6f86347b305fe29506e2b491Jiho Chang * See the License for the specific language governing permissions and
1420c516838913956e6f86347b305fe29506e2b491Jiho Chang * limitations under the License.
1520c516838913956e6f86347b305fe29506e2b491Jiho Chang*/
1620c516838913956e6f86347b305fe29506e2b491Jiho Chang
1720c516838913956e6f86347b305fe29506e2b491Jiho Chang/*!
1820c516838913956e6f86347b305fe29506e2b491Jiho Chang * \file      ExynosRect.h
1920c516838913956e6f86347b305fe29506e2b491Jiho Chang * \brief     header file for ExynosRect
2020c516838913956e6f86347b305fe29506e2b491Jiho Chang * \author    Sangwoo, Park(sw5771.park@samsung.com)
2120c516838913956e6f86347b305fe29506e2b491Jiho Chang * \date      2011/06/02
2220c516838913956e6f86347b305fe29506e2b491Jiho Chang *
2320c516838913956e6f86347b305fe29506e2b491Jiho Chang * <b>Revision History: </b>
2420c516838913956e6f86347b305fe29506e2b491Jiho Chang * - 2010/06/03 : Sangwoo, Park(sw5771.park@samsung.com) \n
2520c516838913956e6f86347b305fe29506e2b491Jiho Chang *   Initial version
2620c516838913956e6f86347b305fe29506e2b491Jiho Chang *
2720c516838913956e6f86347b305fe29506e2b491Jiho Chang * - 2012/03/14 : sangwoo.park(sw5771.park@samsung.com) \n
2820c516838913956e6f86347b305fe29506e2b491Jiho Chang *   Change file, struct name to ExynosXXX.
2920c516838913956e6f86347b305fe29506e2b491Jiho Chang *
3020c516838913956e6f86347b305fe29506e2b491Jiho Chang */
3120c516838913956e6f86347b305fe29506e2b491Jiho Chang
3220c516838913956e6f86347b305fe29506e2b491Jiho Chang#ifndef EXYNOS_RECT_H_
3320c516838913956e6f86347b305fe29506e2b491Jiho Chang#define EXYNOS_RECT_H_
3420c516838913956e6f86347b305fe29506e2b491Jiho Chang
3520c516838913956e6f86347b305fe29506e2b491Jiho Chang//! Rectangle information
3620c516838913956e6f86347b305fe29506e2b491Jiho Chang/*!
3720c516838913956e6f86347b305fe29506e2b491Jiho Chang * \ingroup Exynos
3820c516838913956e6f86347b305fe29506e2b491Jiho Chang */
3920c516838913956e6f86347b305fe29506e2b491Jiho Changstruct ExynosRect
4020c516838913956e6f86347b305fe29506e2b491Jiho Chang{
4120c516838913956e6f86347b305fe29506e2b491Jiho Chang    int x;           //!< x pos
4220c516838913956e6f86347b305fe29506e2b491Jiho Chang    int y;           //!< y pos
4320c516838913956e6f86347b305fe29506e2b491Jiho Chang    int w;           //!< width
4420c516838913956e6f86347b305fe29506e2b491Jiho Chang    int h;           //!< height
4520c516838913956e6f86347b305fe29506e2b491Jiho Chang    int fullW;       //!< full width of image
4620c516838913956e6f86347b305fe29506e2b491Jiho Chang    int fullH;       //!< full height of image
4720c516838913956e6f86347b305fe29506e2b491Jiho Chang    int colorFormat; //!< V4L2_PIX_FMT_XXX
4820c516838913956e6f86347b305fe29506e2b491Jiho Chang
4920c516838913956e6f86347b305fe29506e2b491Jiho Chang#ifdef __cplusplus
5020c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Constructor
5120c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect(int _x_ = 0,
5220c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _y_ = 0,
5320c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _w_ = 0,
5420c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _h_ = 0,
5520c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _fullW_ = 0,
5620c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _fullH_ = 0,
5720c516838913956e6f86347b305fe29506e2b491Jiho Chang            int _colorFormat_ = 0)
5820c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
5920c516838913956e6f86347b305fe29506e2b491Jiho Chang        x = _x_;
6020c516838913956e6f86347b305fe29506e2b491Jiho Chang        y = _y_;
6120c516838913956e6f86347b305fe29506e2b491Jiho Chang        w = _w_;
6220c516838913956e6f86347b305fe29506e2b491Jiho Chang        h = _h_;
6320c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullW = _fullW_;
6420c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullH = _fullH_;
6520c516838913956e6f86347b305fe29506e2b491Jiho Chang        colorFormat = _colorFormat_;
6620c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
6720c516838913956e6f86347b305fe29506e2b491Jiho Chang
6820c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Constructor
6920c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect(const ExynosRect *other)
7020c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
7120c516838913956e6f86347b305fe29506e2b491Jiho Chang        x           = other->x;
7220c516838913956e6f86347b305fe29506e2b491Jiho Chang        y           = other->y;
7320c516838913956e6f86347b305fe29506e2b491Jiho Chang        w           = other->w;
7420c516838913956e6f86347b305fe29506e2b491Jiho Chang        h           = other->h;
7520c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullW       = other->fullW;
7620c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullH       = other->fullH;
7720c516838913956e6f86347b305fe29506e2b491Jiho Chang        colorFormat = other->colorFormat;
7820c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
7920c516838913956e6f86347b305fe29506e2b491Jiho Chang
8020c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(=) override
8120c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect& operator =(const ExynosRect &other)
8220c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
8320c516838913956e6f86347b305fe29506e2b491Jiho Chang        x           = other.x;
8420c516838913956e6f86347b305fe29506e2b491Jiho Chang        y           = other.y;
8520c516838913956e6f86347b305fe29506e2b491Jiho Chang        w           = other.w;
8620c516838913956e6f86347b305fe29506e2b491Jiho Chang        h           = other.h;
8720c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullW       = other.fullW;
8820c516838913956e6f86347b305fe29506e2b491Jiho Chang        fullH       = other.fullH;
8920c516838913956e6f86347b305fe29506e2b491Jiho Chang        colorFormat = other.colorFormat;
9020c516838913956e6f86347b305fe29506e2b491Jiho Chang        return *this;
9120c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
9220c516838913956e6f86347b305fe29506e2b491Jiho Chang
9320c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(==) override
9420c516838913956e6f86347b305fe29506e2b491Jiho Chang    bool operator ==(const ExynosRect &other) const
9520c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
9620c516838913956e6f86347b305fe29506e2b491Jiho Chang        return (   x           == other.x
9720c516838913956e6f86347b305fe29506e2b491Jiho Chang                && y           == other.y
9820c516838913956e6f86347b305fe29506e2b491Jiho Chang                && w           == other.w
9920c516838913956e6f86347b305fe29506e2b491Jiho Chang                && h           == other.h
10020c516838913956e6f86347b305fe29506e2b491Jiho Chang                && fullW       == other.fullW
10120c516838913956e6f86347b305fe29506e2b491Jiho Chang                && fullH       == other.fullH
10220c516838913956e6f86347b305fe29506e2b491Jiho Chang                && colorFormat == other.colorFormat);
10320c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
10420c516838913956e6f86347b305fe29506e2b491Jiho Chang
10520c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(!=) override
10620c516838913956e6f86347b305fe29506e2b491Jiho Chang    bool operator !=(const ExynosRect &other) const
10720c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
10820c516838913956e6f86347b305fe29506e2b491Jiho Chang        // use operator(==)
10920c516838913956e6f86347b305fe29506e2b491Jiho Chang        return !(*this == other);
11020c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
11120c516838913956e6f86347b305fe29506e2b491Jiho Chang#endif
11220c516838913956e6f86347b305fe29506e2b491Jiho Chang};
11320c516838913956e6f86347b305fe29506e2b491Jiho Chang
11420c516838913956e6f86347b305fe29506e2b491Jiho Chang//! Clip information
11520c516838913956e6f86347b305fe29506e2b491Jiho Chang/*!
11620c516838913956e6f86347b305fe29506e2b491Jiho Chang * \ingroup Exynos
11720c516838913956e6f86347b305fe29506e2b491Jiho Chang */
11820c516838913956e6f86347b305fe29506e2b491Jiho Changstruct ExynosRect2
11920c516838913956e6f86347b305fe29506e2b491Jiho Chang{
12020c516838913956e6f86347b305fe29506e2b491Jiho Chang    int x1; //!< Left   (The x-coordinate value of upper-left corner)
12120c516838913956e6f86347b305fe29506e2b491Jiho Chang    int y1; //!< Top    (The y-coordinate value of upper-left corner)
12220c516838913956e6f86347b305fe29506e2b491Jiho Chang    int x2; //!< Right  (The x-coordinate value of lower-right corner)
12320c516838913956e6f86347b305fe29506e2b491Jiho Chang    int y2; //!< Bottom (The y-coordinate value of lower-right corner)
12420c516838913956e6f86347b305fe29506e2b491Jiho Chang
12520c516838913956e6f86347b305fe29506e2b491Jiho Chang#ifdef __cplusplus
12620c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Constructor
12720c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect2(int _x1_ = 0, int _y1_ = 0, int _x2_ = 0, int _y2_ = 0)
12820c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
12920c516838913956e6f86347b305fe29506e2b491Jiho Chang        x1 = _x1_;
13020c516838913956e6f86347b305fe29506e2b491Jiho Chang        y1 = _y1_;
13120c516838913956e6f86347b305fe29506e2b491Jiho Chang        x2 = _x2_;
13220c516838913956e6f86347b305fe29506e2b491Jiho Chang        y2 = _y2_;
13320c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
13420c516838913956e6f86347b305fe29506e2b491Jiho Chang
13520c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Constructor
13620c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect2(const ExynosRect2 *other)
13720c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
13820c516838913956e6f86347b305fe29506e2b491Jiho Chang        x1 = other->x1;
13920c516838913956e6f86347b305fe29506e2b491Jiho Chang        y1 = other->y1;
14020c516838913956e6f86347b305fe29506e2b491Jiho Chang        x2 = other->x2;
14120c516838913956e6f86347b305fe29506e2b491Jiho Chang        y2 = other->y2;
14220c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
14320c516838913956e6f86347b305fe29506e2b491Jiho Chang
14420c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(=) override
14520c516838913956e6f86347b305fe29506e2b491Jiho Chang    ExynosRect2& operator =(const ExynosRect2 &other)
14620c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
14720c516838913956e6f86347b305fe29506e2b491Jiho Chang        x1 = other.x1;
14820c516838913956e6f86347b305fe29506e2b491Jiho Chang        y1 = other.y1;
14920c516838913956e6f86347b305fe29506e2b491Jiho Chang        x2 = other.x2;
15020c516838913956e6f86347b305fe29506e2b491Jiho Chang        y2 = other.y2;
15120c516838913956e6f86347b305fe29506e2b491Jiho Chang        return *this;
15220c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
15320c516838913956e6f86347b305fe29506e2b491Jiho Chang
15420c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(==) override
15520c516838913956e6f86347b305fe29506e2b491Jiho Chang    bool operator ==(const ExynosRect2 &other) const
15620c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
15720c516838913956e6f86347b305fe29506e2b491Jiho Chang        return (   x1 == other.x1
15820c516838913956e6f86347b305fe29506e2b491Jiho Chang                && y1 == other.y1
15920c516838913956e6f86347b305fe29506e2b491Jiho Chang                && x2 == other.x2
16020c516838913956e6f86347b305fe29506e2b491Jiho Chang                && y2 == other.y2);
16120c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
16220c516838913956e6f86347b305fe29506e2b491Jiho Chang
16320c516838913956e6f86347b305fe29506e2b491Jiho Chang    //! Operator(!=) override
16420c516838913956e6f86347b305fe29506e2b491Jiho Chang    bool operator !=(const ExynosRect2 &other) const
16520c516838913956e6f86347b305fe29506e2b491Jiho Chang    {
16620c516838913956e6f86347b305fe29506e2b491Jiho Chang        // use operator(==)
16720c516838913956e6f86347b305fe29506e2b491Jiho Chang        return !(*this == other);
16820c516838913956e6f86347b305fe29506e2b491Jiho Chang    }
16920c516838913956e6f86347b305fe29506e2b491Jiho Chang#endif
17020c516838913956e6f86347b305fe29506e2b491Jiho Chang};
17120c516838913956e6f86347b305fe29506e2b491Jiho Chang
17220c516838913956e6f86347b305fe29506e2b491Jiho Chang#endif //EXYNOS_RECT_H_
173