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