Ocean
Loading...
Searching...
No Matches
OILImageRecorder.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_IMAGE_RECORDER_H
9#define META_OCEAN_MEDIA_OPEN_IMAGE_LIBRARIES_OL_IMAGE_RECORDER_H
10
12
14
15namespace Ocean
16{
17
18namespace Media
19{
20
21namespace OpenImageLibraries
22{
23
24/**
25 * This class implements an image recorder for OpenImageLibraries.
26 * This recorder can be used to save images to files.
27 * @ingroup mediaoil
28 */
29class OCEAN_MEDIA_OIL_EXPORT OILImageRecorder : virtual public ImageRecorder
30{
31 friend class OILLibrary;
33
34 public:
35
36 /**
37 * Saves a given frame as file.
38 * @see ImageRecorder::saveImage().
39 */
40 bool saveImage(const Frame& frame, const std::string& filename) override;
41
42 /**
43 * Returns a list of possible frame encoders for this recorder.
44 * @see FrameRecorder::frameEncoders().
45 */
46 Encoders frameEncoders() const override;
47
48 /**
49 * Locks the most recent frame and returns it so that the image data can be written to this frame.
50 * @see FrameRecorder::lockBufferToFill().
51 */
52 bool lockBufferToFill(Frame& recorderFrame, const bool respectFrameFrequency = true) override;
53
54 /**
55 * Unlocks the filled buffer.
56 * @see OILImageRecorder::unlockBufferToFill().
57 */
58 void unlockBufferToFill() override;
59
60 protected:
61
62 /**
63 * Creates a new image recorder object.
64 */
66
67 /**
68 * Destructs an image recorder object.
69 */
71
72 protected:
73
74 /// Image buffer if the image is not saved explicitly but by a buffer request.
76};
77
78}
79
80}
81
82}
83
84#endif // META_OCEAN_MEDIA_OPEN_IMAGE_LIBRARIES_OL_IMAGE_RECORDER_H
This class implements Ocean's image class.
Definition Frame.h:1808
This class is the base class for all image recorders.
Definition ImageRecorder.h:45
This class implements an image recorder for OpenImageLibraries.
Definition OILImageRecorder.h:30
bool saveImage(const Frame &frame, const std::string &filename) override
Saves a given frame as file.
void unlockBufferToFill() override
Unlocks the filled buffer.
OILImageRecorder()
Creates a new image recorder object.
Frame recorderFrame_
Image buffer if the image is not saved explicitly but by a buffer request.
Definition OILImageRecorder.h:75
~OILImageRecorder() override
Destructs an image recorder object.
Encoders frameEncoders() const override
Returns a list of possible frame encoders for this recorder.
bool lockBufferToFill(Frame &recorderFrame, const bool respectFrameFrequency=true) override
Locks the most recent frame and returns it so that the image data can be written to this frame.
This class implements an OpenImageLibraries image sequence recorder.
Definition OILImageSequenceRecorder.h:36
This class implements the OpenImageLibraries library.
Definition OILLibrary.h:30
std::vector< std::string > Encoders
Definition of a vector holding encoder names.
Definition Recorder.h:80
The namespace covering the entire Ocean framework.
Definition Accessor.h:15