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 SAVE_OPTIONS_JPEG // Jpeg image options
    {
            int Quality; // Compression quality. 0..100
    };
public:
    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 String getFilter() = 0; // Return filter to be used in Open/Save dialogs to allow select all supported formats

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