Content


NTL
Core
IPicture

IPicture



Describes system dependent interfaces for working with images. You may access it via application getPicture().

You can find more information in comments below.

class IPicture
{
public:
    struct Format // Describe file format
    {
        String Name; // Format name
        String Extension; // Format file extension
    };

    struct SaveOptionsJpeg // Jpeg image options
    {
        int Quality; // Compression quality. 0..100
    };
protected:
    String m_sFilter;
public:
    String const &Filter; // Filter to be used in Open/Save dialogs to allow select all supported formats

    virtual int getSupportedFormatCount() = 0; // Return count of supported image formats
    virtual Format getSupportedFormat(const int index) = 0; // Return supported image format by index. Members are empty strings if index is out of bounds

    virtual Image Load(const String &filename) = 0; // Load image from file. If it's failed, result bitmap size is zero
    virtual bool Load(const String &filename, ITexture *dest) = 0; // Load image from file directly into texture
    virtual bool Save(const String &filename, const Image &bmp, const void *options = nullptr) = 0; // Save bitmap into file. Format depends on extension
    virtual bool Save(const String &filename, ITexture *texture, const void *options = nullptr) = 0; // Save texture into file. Format depends on extension
};
Namespace: nitisa
Include: Nitisa/Interfaces/IPicture.h