OpenShot Library | libopenshot  0.2.4
Public Member Functions | List of all members
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:
openshot::ReaderBase

Public Member Functions

void Close ()
 Close File. More...
 
CacheMemoryGetCache ()
 Get the cache object used by this reader (always returns NULL for this object) More...
 
std::shared_ptr< FrameGetFrame (int64_t requested_frame)
 
bool IsOpen ()
 Determine if reader is open or closed. More...
 
std::string Json ()
 Get and Set JSON methods. More...
 
Json::Value JsonValue ()
 Generate Json::JsonValue for this object. More...
 
std::string Name ()
 Return the type name of the class. More...
 
void Open ()
 Open File - which is called by the constructor automatically. More...
 
 QtImageReader (std::string path)
 

Current max_size as calculated with Clip properties

More...
 
 QtImageReader (std::string path, bool inspect_reader)
 
void SetJson (std::string value)
 Load JSON string into this object. More...
 
void SetJsonValue (Json::Value root)
 Load Json::JsonValue into this object. More...
 
virtual ~QtImageReader ()
 
- Public Member Functions inherited from openshot::ReaderBase
void DisplayInfo ()
 Display file information in the standard output stream (stdout) More...
 
openshot::ClipBaseGetClip ()
 Parent clip object of this reader (which can be unparented and NULL) More...
 
 ReaderBase ()
 Constructor for the base reader, where many things are initialized. More...
 
void SetClip (openshot::ClipBase *clip)
 Set parent clip object of this reader. More...
 
virtual ~ReaderBase ()=default
 

Additional Inherited Members

- Public Attributes inherited from openshot::ReaderBase
openshot::ReaderInfo info
 Information about the current media file. More...
 
- Protected Attributes inherited from openshot::ReaderBase
juce::CriticalSection getFrameCriticalSection
 Section lock for multiple threads. More...
 
openshot::ClipBaseparent
 
juce::CriticalSection processingCriticalSection
 

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();

Definition at line 65 of file QtImageReader.h.

Constructor & Destructor Documentation

◆ QtImageReader() [1/2]

QtImageReader::QtImageReader ( std::string  path)

Current max_size as calculated with Clip properties

Constructor for QtImageReader. This automatically opens the media file and loads frame 1, or it throws one of the following exceptions.

Definition at line 47 of file QtImageReader.cpp.

◆ QtImageReader() [2/2]

QtImageReader::QtImageReader ( std::string  path,
bool  inspect_reader 
)

Constructor for QtImageReader. This only opens the media file to inspect its properties if inspect_reader=true. When not inspecting the media file, it's much faster, and useful when you are inflating the object using JSON after instantiating it.

Definition at line 54 of file QtImageReader.cpp.

◆ ~QtImageReader()

QtImageReader::~QtImageReader ( )
virtual

Definition at line 63 of file QtImageReader.cpp.

Member Function Documentation

◆ Close()

void QtImageReader::Close ( )
virtual

Close File.

Implements openshot::ReaderBase.

Definition at line 147 of file QtImageReader.cpp.

Referenced by QtImageReader(), and SetJsonValue().

◆ GetCache()

CacheMemory* openshot::QtImageReader::GetCache ( )
inlinevirtual

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

Implements openshot::ReaderBase.

Definition at line 91 of file QtImageReader.h.

◆ GetFrame()

std::shared_ptr< Frame > QtImageReader::GetFrame ( int64_t  requested_frame)
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_frameThe frame number that is requested.

Implements openshot::ReaderBase.

Definition at line 164 of file QtImageReader.cpp.

Referenced by GetCache().

◆ IsOpen()

bool openshot::QtImageReader::IsOpen ( )
inlinevirtual

Determine if reader is open or closed.

Implements openshot::ReaderBase.

Definition at line 101 of file QtImageReader.h.

◆ Json()

std::string QtImageReader::Json ( )
virtual

Get and Set JSON methods.

Generate JSON string of this object

Implements openshot::ReaderBase.

Definition at line 272 of file QtImageReader.cpp.

Referenced by Name().

◆ JsonValue()

Json::Value QtImageReader::JsonValue ( )
virtual

Generate Json::JsonValue for this object.

Implements openshot::ReaderBase.

Definition at line 279 of file QtImageReader.cpp.

Referenced by Json(), and Name().

◆ Name()

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

Return the type name of the class.

Implements openshot::ReaderBase.

Definition at line 104 of file QtImageReader.h.

◆ Open()

void QtImageReader::Open ( )
virtual

Open File - which is called by the constructor automatically.

Implements openshot::ReaderBase.

Definition at line 68 of file QtImageReader.cpp.

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

◆ SetJson()

void QtImageReader::SetJson ( std::string  value)
virtual

Load JSON string into this object.

Implements openshot::ReaderBase.

Definition at line 291 of file QtImageReader.cpp.

Referenced by Name().

◆ SetJsonValue()

void QtImageReader::SetJsonValue ( Json::Value  root)
virtual

Load Json::JsonValue into this object.

Implements openshot::ReaderBase.

Definition at line 320 of file QtImageReader.cpp.

Referenced by Name(), and SetJson().


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