Loading...
Searching...
No Matches
ImageReader.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_IMAGE_READER_H
#define OPENSHOT_IMAGE_READER_H
// Require ImageMagick support
#ifdef USE_IMAGEMAGICK
#include <memory>
#include <string>
#include "ReaderBase.h"
#include "Json.h"
// Forward decls
namespace Magick {
class Image;
}
namespace openshot {
class CacheBase;
class Frame;
}
namespace openshot
{
class ImageReader : public ReaderBase
{
private:
std::string path;
std::shared_ptr<Magick::Image> image;
bool is_open;
public:
ImageReader(const std::string& path, bool inspect_reader=true);
void Close() override;
CacheBase* GetCache() override { return NULL; };
std::shared_ptr<Frame> GetFrame(int64_t requested_frame) override;
bool IsOpen() override { return is_open; };
std::string Name() override { return "ImageReader"; };
// 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 //USE_IMAGEMAGICK
#endif //OPENSHOT_IMAGE_READER_H
Json.h
Header file for JSON 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::ImageReader::IsOpen
bool IsOpen() override
Determine if reader is open or closed.
Definition ImageReader.h:87
openshot::ImageReader::Open
void Open() override
Open File - which is called by the constructor automatically.
Definition ImageReader.cpp:35
openshot::ImageReader::GetFrame
std::shared_ptr< Frame > GetFrame(int64_t requested_frame) override
Definition ImageReader.cpp:95
openshot::ImageReader::ImageReader
ImageReader(const std::string &path, bool inspect_reader=true)
Constructor for ImageReader.
Definition ImageReader.cpp:25
openshot::ImageReader::Name
std::string Name() override
Return the type name of the class.
Definition ImageReader.h:90
openshot::ImageReader::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition ImageReader.cpp:134
openshot::ImageReader::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition ImageReader.cpp:151
openshot::ImageReader::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition ImageReader.cpp:123
openshot::ImageReader::GetCache
CacheBase * GetCache() override
Get the cache object used by this reader (always returns NULL for this object).
Definition ImageReader.h:77
openshot::ImageReader::Json
std::string Json() const override
Generate JSON string of this object.
Definition ImageReader.cpp:116
openshot::ImageReader::Close
void Close() override
Close File.
Definition ImageReader.cpp:84
openshot::ReaderBase::ReaderBase
ReaderBase()
Constructor for the base reader, where many things are initialized.
Definition ReaderBase.cpp:26
Magick
Definition ImageReader.h:26
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29