Ocean
OILBufferImage.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_MEDIA_OPEN_IMAGE_LIBRARIES_OL_BUFFER_IMAGE_H
9 #define META_OCEAN_MEDIA_OPEN_IMAGE_LIBRARIES_OL_BUFFER_IMAGE_H
10 
12 
14 
15 namespace Ocean
16 {
17 
18 namespace Media
19 {
20 
21 namespace OpenImageLibraries
22 {
23 
24 /**
25  * This class implements a buffer image class for OpenImageLibraries.
26  * @ingroup mediaoil
27  */
28 class OCEAN_MEDIA_OIL_EXPORT OILBufferImage : virtual public BufferImage
29 {
30  friend class OILLibrary;
31 
32  public:
33 
34  /**
35  * Starts the medium.
36  * @see Medium::start().
37  */
38  bool start() override;
39 
40  /**
41  * Pauses the medium.
42  * @see Medium::pause():
43  */
44  bool pause() override;
45 
46  /**
47  * Stops the medium.
48  * @see Medium::stop().
49  */
50  bool stop() override;
51 
52  /**
53  * Clones this medium and returns a new independent instance of this medium.
54  * @see Medium::clone().
55  */
56  MediumRef clone() const override;
57 
58  /**
59  * Releases the image.
60  */
61  void release();
62 
63  /**
64  * Sets the preferred frame pixel format.
65  * @see FrameMedium::setPreferredFramePixelFormat().
66  */
67  bool setPreferredFramePixelFormat(const FrameType::PixelFormat pixelFormat) override;
68 
69  protected:
70 
71  /**
72  * Creates a new medium by a given url.
73  * @param url Url of the medium
74  */
75  explicit OILBufferImage(const std::string& url);
76 
77  /**
78  * Destructs an image object.
79  */
80  ~OILBufferImage() override;
81 
82  /**
83  * (Re-)loads the image.
84  * @return True, if succeeded
85  */
86  bool loadImage();
87 };
88 
89 }
90 
91 }
92 
93 }
94 
95 #endif // META_OCEAN_MEDIA_OPEN_IMAGE_LIBRARIES_OL_BUFFER_IMAGE_H
PixelFormat
Definition of all pixel formats available in the Ocean framework.
Definition: Frame.h:183
This class implements a frame medium object which is defined by a given buffer and image or frame typ...
Definition: BufferImage.h:38
This class implements a buffer image class for OpenImageLibraries.
Definition: OILBufferImage.h:29
bool setPreferredFramePixelFormat(const FrameType::PixelFormat pixelFormat) override
Sets the preferred frame pixel format.
MediumRef clone() const override
Clones this medium and returns a new independent instance of this medium.
~OILBufferImage() override
Destructs an image object.
bool pause() override
Pauses the medium.
OILBufferImage(const std::string &url)
Creates a new medium by a given url.
bool start() override
Starts the medium.
bool stop() override
Stops the medium.
This class implements the OpenImageLibraries library.
Definition: OILLibrary.h:30
This template class implements a object reference with an internal reference counter.
Definition: base/ObjectRef.h:58
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15