Source/Gorgon/CGI.h

Tue, 06 Jul 2021 10:22:49 +0300

author
cemkalyoncu
date
Tue, 06 Jul 2021 10:22:49 +0300
branch
4.x-dev
changeset 1701
b168349a931d
parent 1265
71c987b33d4c
child 1768
8627dc24c8c6
permissions
-rw-r--r--

* Image/Bitmap rotate

#pragma once

#include "Graphics/Color.h"

namespace Gorgon { namespace CGI {
    
    /**
     * Fills a drawing with a solid color
     */
    template<class Color_ = Graphics::RGBA>
    class SolidFill {
    public:
        typedef Color_ ColorType;
        
        /// Implicit typecast from a solid color
        SolidFill(Color_ color) : color(color) { }
        
        /// Sets the color
        void SetColor(Color_ value) {
            color = value;
        }
        
        /// Returns the color
        Color_ GetColor() const {
            return color;
        }
        
        Color_ operator()(Geometry::Pointf /* relative */, Geometry::Point /* absolute */, Color_ underlying, float alpha) {
            underlying.Blend(color, alpha);
            return underlying;
        }
        
    private:
        Color_ color;
    };
    
} }

mercurial