Sha256: 4e6aaecbb53cf21069ffe5fec0f10e801e030c9631b7b767aab56519511b0bb6

Contents?: true

Size: 1.71 KB

Versions: 51

Compression:

Stored size: 1.71 KB

Contents

//! \file ImageData.hpp
//! Interface of the ImageData class.

#ifndef GOSU_IMAGEDATA_HPP
#define GOSU_IMAGEDATA_HPP

#include <Gosu/Color.hpp>
#include <Gosu/GraphicsBase.hpp>
#include <Gosu/Fwd.hpp>
#include <Gosu/Platform.hpp>

namespace Gosu
{
    //! Contains information about the underlying OpenGL texture and the
    //! u/v space used for image data. Can be retrieved from some images
    //! to use them in OpenGL operations.
    struct GLTexInfo
    {
        int texName;
        float left, right, top, bottom;
    };

    //! The ImageData class is an abstract base class for drawable images.
    //! Instances of classes derived by ImageData are usually returned by
    //! Graphics::createImage and usually only used to implement drawing
    //! primitives like Image, which then provide a more specialized and
    //! intuitive drawing interface.
    class ImageData
    {
        // Non-copyable
        ImageData(const ImageData&);
        ImageData& operator=(const ImageData&);
        
    public:
        ImageData()
        {
        }
        
        virtual ~ImageData()
        {
        }

        virtual int width() const = 0;
        virtual int height() const = 0;

        virtual void draw(double x1, double y1, Color c1,
            double x2, double y2, Color c2,
            double x3, double y3, Color c3,
            double x4, double y4, Color c4,
            ZPos z, AlphaMode mode) const = 0;
            
        virtual const GLTexInfo* glTexInfo() const = 0;
        virtual Bitmap toBitmap() const = 0;
        
        virtual GOSU_UNIQUE_PTR<ImageData> subimage(int x, int y, int width, int height) const = 0;
        
        virtual void insert(const Bitmap& bitmap, int x, int y) = 0;
    };
}

#endif

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
gosu-0.10.9.pre1 Gosu/ImageData.hpp
gosu-0.10.8 Gosu/ImageData.hpp
gosu-0.10.7 Gosu/ImageData.hpp
gosu-0.10.6 Gosu/ImageData.hpp
gosu-0.10.5 Gosu/ImageData.hpp
gosu-0.10.5.pre0 Gosu/ImageData.hpp
gosu-0.10.5.pre1 Gosu/ImageData.hpp
gosu-0.10.4 Gosu/ImageData.hpp
gosu-0.10.3 Gosu/ImageData.hpp
gosu-0.10.2 Gosu/ImageData.hpp
gosu-0.10.2.pre1 Gosu/ImageData.hpp
gosu-0.10.1.2 Gosu/ImageData.hpp
gosu-0.10.1.1 Gosu/ImageData.hpp
gosu-0.10.1 Gosu/ImageData.hpp
gosu-0.10.0 Gosu/ImageData.hpp
gosu-0.9.2 Gosu/ImageData.hpp
gosu-0.9.2.pre1 Gosu/ImageData.hpp
gosu-0.9.1 Gosu/ImageData.hpp
gosu-0.9.0 Gosu/ImageData.hpp
gosu-0.9.0.pre1 Gosu/ImageData.hpp