Sha256: 1cc064829975debfdd36a14d63e85e5c424b08ee860f9b76202dcbc09237a3e2

Contents?: true

Size: 1.66 KB

Versions: 16

Compression:

Stored size: 1.66 KB

Contents

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

#pragma once

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

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 tex_name;
        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::create_image 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* gl_tex_info() const = 0;
        
        virtual Bitmap to_bitmap() const = 0;
        
        virtual std::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;
    };
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
gosu-0.13.3 Gosu/ImageData.hpp
gosu-0.13.2 Gosu/ImageData.hpp
gosu-0.13.1 Gosu/ImageData.hpp
gosu-0.13.0 Gosu/ImageData.hpp
gosu-0.12.1 Gosu/ImageData.hpp
gosu-0.12.0 Gosu/ImageData.hpp
gosu-0.11.4.pre3 Gosu/ImageData.hpp
gosu-0.11.4.pre2 Gosu/ImageData.hpp
gosu-0.11.4.pre1 Gosu/ImageData.hpp
gosu-0.11.3.1 Gosu/ImageData.hpp
gosu-0.11.3 Gosu/ImageData.hpp
gosu-0.11.3.pre1 Gosu/ImageData.hpp
gosu-0.11.2 Gosu/ImageData.hpp
gosu-0.11.1 Gosu/ImageData.hpp
gosu-0.11.1.pre1 Gosu/ImageData.hpp
gosu-0.11.0 Gosu/ImageData.hpp