libcamera: geometry: Turn Size and Rectangle into classes

SizeRange is defined as a class while Size and Rectangle are defined as
struct. This is confusing for users in forward declarations. Simplify it
by turning both structures into classes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart 2020-07-15 01:49:32 +03:00
parent 4f509caa8e
commit 945eedaf2f
4 changed files with 10 additions and 6 deletions

View file

@ -2,7 +2,7 @@
/* /*
* Copyright (C) 2019, Google Inc. * Copyright (C) 2019, Google Inc.
* *
* geometry.h - Geometry-related structure * geometry.h - Geometry-related classes
*/ */
#ifndef __LIBCAMERA_GEOMETRY_H__ #ifndef __LIBCAMERA_GEOMETRY_H__
@ -13,7 +13,9 @@
namespace libcamera { namespace libcamera {
struct Size { class Size
{
public:
Size() Size()
: Size(0, 0) : Size(0, 0)
{ {
@ -126,7 +128,9 @@ static inline bool operator!=(const SizeRange &lhs, const SizeRange &rhs)
return !(lhs == rhs); return !(lhs == rhs);
} }
struct Rectangle { class Rectangle
{
public:
Rectangle() Rectangle()
: Rectangle(0, 0, 0, 0) : Rectangle(0, 0, 0, 0)
{ {

View file

@ -21,8 +21,8 @@ class CameraSensor;
class FrameBuffer; class FrameBuffer;
class MediaDevice; class MediaDevice;
class Request; class Request;
class Size;
class V4L2Subdevice; class V4L2Subdevice;
struct Size;
struct StreamConfiguration; struct StreamConfiguration;
class CIO2Device class CIO2Device

View file

@ -17,7 +17,7 @@ namespace libcamera {
class FrameBuffer; class FrameBuffer;
class MediaDevice; class MediaDevice;
struct Size; class Size;
struct StreamConfiguration; struct StreamConfiguration;
class ImgUDevice class ImgUDevice

View file

@ -20,7 +20,7 @@ namespace libcamera {
class FrameBuffer; class FrameBuffer;
class MediaDevice; class MediaDevice;
struct Size; class Size;
class SizeRange; class SizeRange;
struct StreamConfiguration; struct StreamConfiguration;
class V4L2M2MDevice; class V4L2M2MDevice;