Ocean
Loading...
Searching...
No Matches
Ocean::Media::WIC::WICImageRecorder Class Reference

This class implements an image recorder for WIC. More...

#include <WICImageRecorder.h>

Inheritance diagram for Ocean::Media::WIC::WICImageRecorder:

Public Member Functions

bool saveImage (const Frame &frame, const std::string &filename) override
 Saves a given frame as file.
 
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.
 
void unlockBufferToFill () override
 Unlocks the filled buffer.
 
- Public Member Functions inherited from Ocean::Media::ImageRecorder
bool start () override
 Saves an image the next time a requested framebuffer is filled with valid image data.
 
bool stop () override
 Stops the recorder, this functions is unused for image recorders.
 
bool isRecording () const override
 Returns whether this recorder will save an image the next time a framebuffer is requested.
 
- Public Member Functions inherited from Ocean::Media::FrameRecorder
const FrameTypeframeType () const
 Returns the actual frame type of this recorder.
 
double frameFrequency () const
 Returns the frame frequency of this recorder in Hz.
 
const std::string & frameEncoder () const
 Returns the name of the encoder used to encoder the frames.
 
virtual bool frameEncoderHasConfiguration ()
 Returns whether the selected frame encoder has a configuration possibility.
 
virtual bool setPreferredFrameType (const FrameType &type)
 Sets the preferred frame type of this recorder.
 
virtual bool setFrameFrequency (const double frequency)
 Sets the frame frequency of this recorder.
 
virtual bool setFrameEncoder (const std::string &encoder)
 Sets the frame encoder used to encode the frames.
 
virtual bool frameEncoderConfiguration (long long data)
 Starts the frame encoder configuration possibility.
 
- Public Member Functions inherited from Ocean::Media::Recorder
Type type () const
 Returns the type of this recorder.
 
- Public Member Functions inherited from Ocean::Media::FileRecorder
const std::string & filename () const
 Returns the filename of this recorder.
 
bool filenameSuffixed () const
 Returns whether the filename of this recorder will be suffixed with date and time.
 
virtual bool setFilename (const std::string &filename)
 Sets the filename of this recorder.
 
virtual bool setFilenameSuffixed (const bool suffixed)
 Sets whether the filename will be suffixed with date and time.
 

Protected Member Functions

 WICImageRecorder ()
 Creates a new image recorder object.
 
virtual ~WICImageRecorder ()
 Destructs an image recorder object.
 
- Protected Member Functions inherited from Ocean::Media::ImageRecorder
 ImageRecorder ()
 Creates a new image recorder object.
 
 ~ImageRecorder () override
 Destructs an image recorder object.
 
- Protected Member Functions inherited from Ocean::Media::FrameRecorder
 FrameRecorder ()
 Creats a new frame recorder.
 
 ~FrameRecorder () override
 Destructs a frame recorder.
 
- Protected Member Functions inherited from Ocean::Media::Recorder
 Recorder ()
 Creates a new recorder.
 
virtual ~Recorder ()
 Destructs a recorder.
 
- Protected Member Functions inherited from Ocean::Media::FileRecorder
 FileRecorder ()
 Creates a new file recorder.
 
 ~FileRecorder () override
 Destructs a file recorder.
 
- Protected Member Functions inherited from Ocean::Media::ExplicitRecorder
 ExplicitRecorder ()
 Creates a new explicit recorder.
 
 ~ExplicitRecorder () override
 Destructs a explicit recorder.
 

Protected Attributes

Frame recorderFrame_
 Image buffer if the image is not saved explicitly but by a buffer request.
 
- Protected Attributes inherited from Ocean::Media::ImageRecorder
bool recorderSaveImage
 State determining whether the file recorder is asked to save a new image.
 
- Protected Attributes inherited from Ocean::Media::FrameRecorder
FrameType recorderFrameType
 Type of the frame to record.
 
double recorderFrameFrequency
 Frame frequency used by the recorder.
 
std::string recorderFrameEncoder
 Name of the frame encoder used to encode the frames.
 
- Protected Attributes inherited from Ocean::Media::Recorder
Type recorderType
 Type of this recorder.
 
Lock recorderLock
 Lock of this recorder.
 
- Protected Attributes inherited from Ocean::Media::FileRecorder
std::string recorderFilename
 Filename of this recorder.
 
bool recorderFilenameSuffixed
 Flag determining whether the filename will be suffixed with date and time.
 

Friends

class WICLibrary
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::Recorder
enum  Type {
  RECORDER = 0 , FRAME_RECORDER = 1 , SOUND_RECORDER = 2 , EXPLICIT_RECORDER = 4 ,
  IMPLICIT_RECORDER = 8 , FILE_RECORDER = 16 | EXPLICIT_RECORDER , BUFFER_RECORDER = 32 | EXPLICIT_RECORDER , STREAMING_RECORDER = 64 | IMPLICIT_RECORDER ,
  MOVIE_RECORDER = 128 | FRAME_RECORDER | FILE_RECORDER , FRAME_STREAMING_RECORDER = 256 | FRAME_RECORDER | STREAMING_RECORDER , IMAGE_RECORDER = 512 | FRAME_RECORDER | FILE_RECORDER , BUFFER_IMAGE_RECORDER = 1024 | FRAME_RECORDER | BUFFER_RECORDER ,
  IMAGE_SEQUENCE_RECORDER = 2048 | FRAME_RECORDER | FILE_RECORDER , FRAME_MEMORY_RECORDER = 4096 | FRAME_RECORDER
}
 Definition of different recorder types. More...
 
typedef std::vector< std::string > Encoders
 Definition of a vector holding encoder names.
 
- Static Public Member Functions inherited from Ocean::Media::WIC::WICObject
static FrameType::PixelFormat translatePixelFormat (const WICPixelFormatGUID &format, FrameType::PixelOrigin *pixelOrigin=nullptr)
 Translates a pixel format from Windows Imaging Component to a framework pixel format.
 
static WICPixelFormatGUID matchingPixelFormat (const FrameType::PixelFormat format, FrameType::PixelFormat &adjustedFormat, const std::vector< GUID > &supportedPixelFormats=std::vector< GUID >())
 Determines the best matching Windows Imaging Component pixel format for a given Ocean pixel format.
 
static bool hasAlphaChannel (IWICImagingFactory *imagingFactory, IWICBitmapDecoder *bitmapDecoder, IWICBitmapFrameDecode *frameDecode)
 Returns whether a Windows Imaging Component pixel format has an alpha channel.
 
static GUID findContainerFormat (const std::string &fileExtension)
 Finds the corresponding container format for a specified file extension.
 
static std::string translateContainerFormat (const GUID &containerFormat)
 Translates a container format to the corresponding file extension.
 
static Frame loadFrameFromBitmapDecoder (IWICImagingFactory *imagingFactory, IWICBitmapDecoder *bitmapDecoder)
 Loads a frame from a bitmap decoder object.
 
static bool writeFrameToBitmapDecoder (IWICImagingFactory *imagingFactory, IWICBitmapEncoder *bitmapEncoder, const Frame &frame, const bool allowConversion=true, bool *hasBeenConverted=nullptr)
 Writes a frame to a bitmap encoder object.
 
- Static Public Member Functions inherited from Ocean::Media::FileRecorder
static std::string addOptionalSuffixToFilename (const std::string &filename, const bool addSuffix)
 Determines the filename to be used for the next file.
 
static std::string addOptionalSuffixToFilename (const std::string &filename, const unsigned int index, const bool addSuffix)
 Determines the filename to be used for the next file.
 

Detailed Description

This class implements an image recorder for WIC.

This recorder can be used to save images to files.

Constructor & Destructor Documentation

◆ WICImageRecorder()

Ocean::Media::WIC::WICImageRecorder::WICImageRecorder ( )
protected

Creates a new image recorder object.

◆ ~WICImageRecorder()

virtual Ocean::Media::WIC::WICImageRecorder::~WICImageRecorder ( )
protectedvirtual

Destructs an image recorder object.

Member Function Documentation

◆ frameEncoders()

Encoders Ocean::Media::WIC::WICImageRecorder::frameEncoders ( ) const
overridevirtual

Returns a list of possible frame encoders for this recorder.

See also
FrameRecorder::frameEncoders().

Reimplemented from Ocean::Media::FrameRecorder.

◆ lockBufferToFill()

bool Ocean::Media::WIC::WICImageRecorder::lockBufferToFill ( Frame recorderFrame,
const bool  respectFrameFrequency = true 
)
overridevirtual

Locks the most recent frame and returns it so that the image data can be written to this frame.

See also
FrameRecorder::lockBufferToFill().

Reimplemented from Ocean::Media::ImageRecorder.

◆ saveImage()

bool Ocean::Media::WIC::WICImageRecorder::saveImage ( const Frame frame,
const std::string &  filename 
)
overridevirtual

Saves a given frame as file.

See also
ImageRecorder::saveImage().

Implements Ocean::Media::ImageRecorder.

◆ unlockBufferToFill()

void Ocean::Media::WIC::WICImageRecorder::unlockBufferToFill ( )
overridevirtual

Unlocks the filled buffer.

See also
ILImageRecorder::unlockBufferToFill().

Reimplemented from Ocean::Media::ImageRecorder.

Friends And Related Symbol Documentation

◆ WICLibrary

friend class WICLibrary
friend

Field Documentation

◆ recorderFrame_

Frame Ocean::Media::WIC::WICImageRecorder::recorderFrame_
protected

Image buffer if the image is not saved explicitly but by a buffer request.


The documentation for this class was generated from the following file: