mirror of
https://onedev.site.tesses.net/tesses-framework/tessesframework-gfx
synced 2026-09-30 15:44:12 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ImageFormat.hpp"
|
||||
namespace Tesses::Framework::Graphics::ImageFormats {
|
||||
class BitmapFormat : public ImageFormat {
|
||||
public:
|
||||
BitmapFormat();
|
||||
void Load(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image);
|
||||
void Save(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image,std::string flags="");
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "BitmapFormat.hpp"
|
||||
#include "PngFormat.hpp"
|
||||
#include "JpegFormat.hpp"
|
||||
namespace Tesses::Framework::Graphics::ImageFormats {
|
||||
class Formats {
|
||||
public:
|
||||
static BitmapFormat Bitmap;
|
||||
static PngFormat Png;
|
||||
static JpegFormat Jpeg;
|
||||
//Don't free the ImageFormat (may return null)
|
||||
static ImageFormat* FromExtension(std::string ext);
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <TessesFramework/Streams/Stream.hpp>
|
||||
#include "../Image.hpp"
|
||||
|
||||
namespace Tesses::Framework::Graphics::ImageFormats {
|
||||
class ImageFormat {
|
||||
public:
|
||||
virtual void Load(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image)=0;
|
||||
virtual void Save(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image,std::string flags="")=0;
|
||||
|
||||
virtual ~ImageFormat();
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ImageFormat.hpp"
|
||||
namespace Tesses::Framework::Graphics::ImageFormats {
|
||||
class JpegFormat : public ImageFormat {
|
||||
public:
|
||||
JpegFormat();
|
||||
void Load(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image);
|
||||
void Save(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image,std::string flags="");
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ImageFormat.hpp"
|
||||
namespace Tesses::Framework::Graphics::ImageFormats {
|
||||
class PngFormat : public ImageFormat {
|
||||
public:
|
||||
PngFormat();
|
||||
void Load(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image);
|
||||
void Save(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, Image* image,std::string flags="");
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user