Loading...
Searching...
No Matches
QtHtmlReader.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_QT_HTML_READER_H
#define OPENSHOT_QT_HTML_READER_H
#include "ReaderBase.h"
#include <cmath>
#include <ctime>
#include <iostream>
#include <omp.h>
#include <stdio.h>
#include <memory>
#include "CacheMemory.h"
#include "Enums.h"
class QImage;
namespace openshot
{
// Forward decls
class CacheBase;
class QtHtmlReader : public ReaderBase
{
private:
int width;
int height;
int x_offset;
int y_offset;
std::string html;
std::string css;
std::string background_color;
std::shared_ptr<QImage> image;
bool is_open;
openshot::GravityType gravity;
public:
QtHtmlReader();
QtHtmlReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string html, std::string css, std::string background_color);
void Close() override;
CacheBase* GetCache() override { return NULL; };
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
bool IsOpen() override { return is_open; };
std::string Name() override { return "QtHtmlReader"; };
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
void Open() override;
};
}
#endif
CacheMemory.h
Header file for CacheMemory class.
Enums.h
Header file for TextReader class.
ReaderBase.h
Header file for ReaderBase class.
openshot::CacheBase
All cache managers in libopenshot are based on this CacheBase class.
Definition CacheBase.h:35
openshot::QtHtmlReader
This class uses Qt libraries, to create frames with rendered HTML, and return openshot::Frame objects...
Definition QtHtmlReader.h:70
openshot::QtHtmlReader::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition QtHtmlReader.cpp:214
openshot::QtHtmlReader::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t requested_frame) override
Definition QtHtmlReader.cpp:145
openshot::QtHtmlReader::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition QtHtmlReader.cpp:178
openshot::QtHtmlReader::GetCache
CacheBase * GetCache() override
Get the cache object used by this reader (always returns NULL for this object)
Definition QtHtmlReader.h:102
openshot::QtHtmlReader::Json
std::string Json() const override
Generate JSON string of this object.
Definition QtHtmlReader.cpp:171
openshot::QtHtmlReader::Close
void Close() override
Close Reader.
Definition QtHtmlReader.cpp:128
openshot::QtHtmlReader::QtHtmlReader
QtHtmlReader()
Default constructor (blank text)
Definition QtHtmlReader.cpp:28
openshot::QtHtmlReader::IsOpen
bool IsOpen() override
Determine if reader is open or closed.
Definition QtHtmlReader.h:112
openshot::QtHtmlReader::Open
void Open() override
Open Reader - which is called by the constructor automatically.
Definition QtHtmlReader.cpp:44
openshot::QtHtmlReader::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition QtHtmlReader.cpp:197
openshot::QtHtmlReader::Name
std::string Name() override
Return the type name of the class.
Definition QtHtmlReader.h:115
openshot::ReaderBase
This abstract class is the base class, used by all readers in libopenshot.
Definition ReaderBase.h:76
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29
openshot::GravityType
GravityType
This enumeration determines how clips are aligned to their parent container.
Definition Enums.h:22