OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
ImageReader.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2019 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_IMAGE_READER_H
14
#define OPENSHOT_IMAGE_READER_H
15
16
// Require ImageMagick support
17
#ifdef USE_IMAGEMAGICK
18
19
#include <memory>
20
#include <string>
21
22
#include "
ReaderBase.h
"
23
#include "
Json.h
"
24
25
// Forward decls
26
namespace
Magick
{
27
class
Image;
28
}
29
namespace
openshot
{
30
class
CacheBase;
31
class
Frame;
32
}
33
34
namespace
openshot
35
{
55
class
ImageReader
:
public
ReaderBase
56
{
57
private
:
58
std::string path;
59
std::shared_ptr<Magick::Image> image;
60
bool
is_open;
61
62
public
:
71
ImageReader
(
const
std::string& path,
bool
inspect_reader=
true
);
72
74
void
Close
()
override
;
75
77
CacheBase
*
GetCache
()
override
{
return
NULL; };
78
84
std::shared_ptr<Frame>
GetFrame
(int64_t requested_frame)
override
;
85
87
bool
IsOpen
()
override
{
return
is_open; };
88
90
std::string
Name
()
override
{
return
"ImageReader"
; };
91
92
// Get and Set JSON methods
93
std::string
Json
()
const override
;
94
void
SetJson
(
const
std::string value)
override
;
95
Json::Value
JsonValue
()
const override
;
96
void
SetJsonValue
(
const
Json::Value root)
override
;
97
99
void
Open
()
override
;
100
};
101
102
}
103
104
#endif
//USE_IMAGEMAGICK
105
#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:27
Magick
Definition
ImageReader.h:26
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
ImageReader.h
Generated by
1.17.0