 |
Gorgon Game Engine
|
Go to the documentation of this file.
8 #include "../Graphics/Animations.h"
9 #include "../Graphics/Texture.h"
10 #include "../Containers/Image.h"
11 #include "../Graphics/Bitmap.h"
13 namespace Gorgon {
namespace Resource {
46 virtual void Prepare()
override { Bitmap::Prepare(); }
48 virtual void Discard()
override { Bitmap::Discard(); }
76 bool load(std::shared_ptr<Reader>
reader,
unsigned long size,
bool forceload);
This class stores animations as a part of itself so that it can be moved around as a value rather tha...
Definition: Storage.h:21
constexpr Type PNG
PNG compression.
Definition: GID.h:126
constexpr Type File
File.
Definition: GID.h:84
GID::Type GetCompression() const
Returns the compression mode of this image resource.
Definition: Image.h:42
virtual void Discard() override
This function discards image data.
Definition: Image.h:48
bool isloaded
Whether this image resource is loaded or not.
Definition: Image.h:95
virtual Graphics::RectangularAnimationStorage animmoveout() override
Definition: Image.cpp:210
unsigned long entrypoint
Entry point of this resource within the physical file.
Definition: Image.h:89
static void SaveThis(Writer &writer, const Graphics::Bitmap &bmp, GID::Type type=GID::Image)
This function can be used to save a bitmap as image resource without modifying it.
Definition: Image.cpp:171
void SetCompression(GID::Type compression)
Changes the compression mode.
Definition: Image.h:37
virtual void Swap(Bitmap &other)
Swaps two images, mostly used for move constructor,.
Definition: Bitmap.h:85
void save(Writer &writer) const override
Definition: Image.cpp:141
constexpr Type Image
Image resource.
Definition: GID.h:149
Image(Graphics::Bitmap &&source)
Assumes the given bitmap and converts it to a resource.
Definition: Image.h:28
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class denotes the resource is an image animation storage.
Definition: AnimationStorage.h:12
bool IsLoaded() const
Returns whether the image data is loaded.
Definition: Image.h:58
virtual void Prepare() override
This function prepares image for drawing.
Definition: Image.h:46
Graphics::Bitmap MoveOutAsBitmap()
Moves the data out of resource system. Use Prepare and Discard before moving to avoid data duplicatio...
Definition: Image.cpp:204
This object contains an bitmap image.
Definition: Bitmap.h:25
bool Load()
Loads the image from the disk. This function requires image to be tied to a resource file.
Definition: Image.cpp:29
GID::Type compression
Compression mode.
Definition: Image.h:85
std::shared_ptr< Reader > reader
Used to handle late loading.
Definition: Image.h:92
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
virtual GID::Type GetGID() const override
This function shall return Gorgon ID of this resource.
Definition: Image.h:32
Graphics::RectangularAnimationStorage MoveOut()
Moves this animation out as a generic value type animation.
Definition: AnimationStorage.h:15
void loaded()
Definition: Image.cpp:22
Type to store GID information.
Definition: GID.h:23
virtual ~Image()
Definition: Image.h:71
static Image * LoadResource(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
This function loads a image resource from the given file.
Definition: Image.cpp:9
Geometry::Size size
Size of the texture.
Definition: Texture.h:195
This resource contains images.
Definition: Image.h:23
bool load(std::shared_ptr< Reader > reader, unsigned long size, bool forceload)
Loads the image from the data stream.
Definition: Image.cpp:48