TBitmap


This template class has been removed in release 10.0.0. Use ntl::TBitmap template class or Image class instead.

Represents image im memory. Can have different channels for colors and can have different data type for channels.

You can find more information in comments below.

template<unsigned char Channels, class Type>
    class TBitmap
    {
    public:
        TBitmap(); // Create empty 
        TBitmap(const int w, const int h); // Create with specified size 
        TBitmap(const int w, const int h, void *data); // Create with specified size and data 
        TBitmap(const TBitmap &other);
        TBitmap(TBitmap &&other);
        ~TBitmap();
    
        COLUMN &operator[](const int x); // Return bitmap column. You can access pixel as bmp[x][y] 
        bool operator==(const TBitmap &other) const; // Check if it is equal to another bitmap 
        bool operator!=(const TBitmap &other) const; // Check if it is unequal to another bitmap 
        TBitmap &operator=(const TBitmap &other);
        TBitmap &operator=(TBitmap &&other);
    
        int getWidth() const; // Return width 
        int getHeight() const; // Return height 
        const TPixel<Channels, Type> &getPixel(const math::TPoint<int> &p) const; // Return pixel from specified position 
        TPixel<Channels, Type> getPixel(const math::TPoint<int> &p); // Return pixel from specified position 
        TPixel<Channels, ChannelType> getPixel(const math::TPoint<int> &p, const TPixel<Channels, ChannelType> &def) const // Return pixel from specified position or def one if position is out of bitmap 
        const TPixel<Channels, Type> *getData() const; // Return bitmap data 
        TPixel<Channels, Type> *getData(); // Return bitmap data 
        const bool isEmpty() const; // Check whether it is empty 
    
        void setWidth(const int value); // Set width 
        void setHeight(const int value); // Set height 
        void setSize(const int w, const int h); // Set size 
        void setPixel(const math::TPoint<int> &p, const TPixel<Channels, Type> &value); // Set pixel at specified position 
        void setData(const int width, const int height, void *data); // Set size and data 
    };
Namespace: nitisa::graphics
Include: Nitisa/Modules/Graphics/Bitmap.h