Loading...
Searching...
No Matches
openshot::QtImageReader Class Reference

This class uses the Qt library, to open image files, and return openshot::Frame objects containing the image. More...

`#include <QtImageReader.h>`

Inheritance diagram for openshot::QtImageReader:

## Public Member Functions

void | Close () override
| Close File.
CacheBase * | GetCache () override
| Get the cache object used by this reader (always returns NULL for this object).
std::shared_ptr< Frame > | GetFrame (int64_t requested_frame) override
bool | IsOpen () override
| Determine if reader is open or closed.
std::string | Json () const override
| Generate JSON string of this object.
Json::Value | JsonValue () const override
| Generate Json::Value for this object.
std::string | Name () override
| Return the type name of the class.
void | Open () override
| Open File - which is called by the constructor automatically.
| QtImageReader (std::string path, bool inspect_reader=true)
| Constructor for QtImageReader.
void | SetJson (const std::string value) override
| Load JSON string into this object.
void | SetJsonValue (const Json::Value root) override
| Load Json::Value into this object.
virtual | ~QtImageReader ()
Public Member Functions inherited from openshot::ReaderBase
void | DisplayInfo (std::ostream *out=&std::cout)
| Display file information in the standard output stream (stdout).
openshot::ClipBase * | ParentClip ()
| Parent clip object of this reader (which can be unparented and NULL).
void | ParentClip (openshot::ClipBase *new_clip)
| Set parent clip object of this reader.
| ReaderBase ()
| Constructor for the base reader, where many things are initialized.
virtual | ~ReaderBase ()=default

## Additional Inherited Members

Public Attributes inherited from openshot::ReaderBase
openshot::ReaderInfo | info
| Information about the current media file.
Protected Attributes inherited from openshot::ReaderBase
openshot::ClipBase * | clip
| Pointer to the parent clip instance (if any).
std::recursive_mutex | getFrameMutex
| Mutex for multiple threads.

## Detailed Description

This class uses the Qt library, to open image files, and return openshot::Frame objects containing the image.

// Create a reader for a video
QtImageReader r("MyAwesomeImage.jpeg");
r.Open(); // Open the reader
// Get frame number 1 from the video
std::shared_ptr<Frame> f = r.GetFrame(1);
// Now that we have an openshot::Frame object, lets have some fun!
f->Display(); // Display the frame on the screen
// Close the reader
r.Close();
openshot::QtImageReader::QtImageReader
QtImageReader(std::string path, bool inspect_reader=true)
Constructor for QtImageReader.
Definition QtImageReader.cpp:30

Definition at line 74 of file QtImageReader.h.

## Constructor & Destructor Documentation

## QtImageReader()

QtImageReader::QtImageReader | ( | std::string | path,
|  | bool | inspect_reader = true )

Constructor for QtImageReader.

Opens the media file to inspect its properties and loads frame 1, iff inspect_reader == true (the default). Pass a false value in the optional parameter to defer this initial Open()/Close() cycle.

When not inspecting the media file, it's much faster, and useful when you are inflating the object using JSON after instantiation.

Definition at line 30 of file QtImageReader.cpp.

## ~QtImageReader()

QtImageReader::~QtImageReader | ( |  | ) |

virtual

Definition at line 39 of file QtImageReader.cpp.

## Member Function Documentation

## Close()

void QtImageReader::Close | ( |  | ) |

override virtual

Close File.

Implements openshot::ReaderBase.

Definition at line 133 of file QtImageReader.cpp.

Referenced by QtImageReader(), SetJsonValue(), and ~QtImageReader().

## GetCache()

CacheBase * openshot::QtImageReader::GetCache | ( |  | ) |

inline override virtual

Get the cache object used by this reader (always returns NULL for this object).

Implements openshot::ReaderBase.

Definition at line 113 of file QtImageReader.h.

## GetFrame()

std::shared_ptr< Frame > QtImageReader::GetFrame | ( | int64_t | requested_frame | ) |

override virtual

Get an openshot::Frame object for a specific frame number of this reader. All numbers return the same Frame, since they all share the same image data.

Returns
  The requested frame (containing the image)

Parameters

  requested_frame | The frame number that is requested.

Implements openshot::ReaderBase.

Definition at line 151 of file QtImageReader.cpp.

## IsOpen()

bool openshot::QtImageReader::IsOpen | ( |  | ) |

inline override virtual

Determine if reader is open or closed.

Implements openshot::ReaderBase.

Definition at line 123 of file QtImageReader.h.

## Json()

std::string QtImageReader::Json | ( |  | ) | const

override virtual

Generate JSON string of this object.

Implements openshot::ReaderBase.

Definition at line 326 of file QtImageReader.cpp.

## JsonValue()

Json::Value QtImageReader::JsonValue | ( |  | ) | const

override virtual

Generate Json::Value for this object.

Implements openshot::ReaderBase.

Definition at line 333 of file QtImageReader.cpp.

Referenced by Json().

## Name()

std::string openshot::QtImageReader::Name | ( |  | ) |

inline override virtual

Return the type name of the class.

Implements openshot::ReaderBase.

Definition at line 126 of file QtImageReader.h.

## Open()

void QtImageReader::Open | ( |  | ) |

override virtual

Open File - which is called by the constructor automatically.

Implements openshot::ReaderBase.

Definition at line 45 of file QtImageReader.cpp.

Referenced by QtImageReader(), and SetJsonValue().

## SetJson()

void QtImageReader::SetJson | ( | const std::string | value | ) |

override virtual

Load JSON string into this object.

Implements openshot::ReaderBase.

Definition at line 345 of file QtImageReader.cpp.

## SetJsonValue()

void QtImageReader::SetJsonValue | ( | const Json::Value | root | ) |

override virtual

Load Json::Value into this object.

Implements openshot::ReaderBase.

Definition at line 362 of file QtImageReader.cpp.

Referenced by SetJson().

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

- QtImageReader.h
- QtImageReader.cpp