~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxImage/CairoGraphics.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-02 03:28:11 UTC
  • Revision ID: neil.patel@canonical.com-20100902032811-i2m18tfb6pkasnvt
Remove Win EOL chars

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
 
23
 
#ifndef CAIROGRAPHICS_H
24
 
#define CAIROGRAPHICS_H
25
 
 
26
 
#include "cairo.h"
27
 
#include "BitmapFormats.h"
28
 
#include "ImageSurface.h"
29
 
 
30
 
NAMESPACE_BEGIN
31
 
 
32
 
//! A cairo graphics container
33
 
/*!
34
 
    CairoGraphics encapsulates a cairo surface and context.
35
 
*/
36
 
class CairoGraphics
37
 
{
38
 
public:
39
 
    CairoGraphics(cairo_format_t format, int width, int height);
40
 
    ~CairoGraphics();
41
 
 
42
 
    //! Return a cairo context to the encapsulated surface.
43
 
    /*!
44
 
        @return A cairo context.
45
 
    */
46
 
    cairo_t* GetContext();
47
 
    //! Create a NBitmapData pointer to a 2D texture data.
48
 
    /*!
49
 
        The returned data must be destroyed with delete.
50
 
        @return A pointer to a 2D texture data.
51
 
    */
52
 
    NBitmapData* GetBitmap();
53
 
 
54
 
private:
55
 
    //! Cairo surface format
56
 
    cairo_format_t m_surface_format;
57
 
    //! Cairo surface
58
 
    cairo_surface_t* m_cairo_surface;
59
 
    int m_width; //!< Surface width.
60
 
    int m_height; //!< Surface height.
61
 
};
62
 
 
63
 
NAMESPACE_END
64
 
 
65
 
#endif // CAIROGRAPHICS_H
 
23
#ifndef CAIROGRAPHICS_H
 
24
#define CAIROGRAPHICS_H
 
25
 
 
26
#include "cairo.h"
 
27
#include "BitmapFormats.h"
 
28
#include "ImageSurface.h"
 
29
 
 
30
NAMESPACE_BEGIN
 
31
 
 
32
//! A cairo graphics container
 
33
/*!
 
34
    CairoGraphics encapsulates a cairo surface and context.
 
35
*/
 
36
class CairoGraphics
 
37
{
 
38
public:
 
39
    CairoGraphics(cairo_format_t format, int width, int height);
 
40
    ~CairoGraphics();
 
41
 
 
42
    //! Return a cairo context to the encapsulated surface.
 
43
    /*!
 
44
        @return A cairo context.
 
45
    */
 
46
    cairo_t* GetContext();
 
47
    //! Create a NBitmapData pointer to a 2D texture data.
 
48
    /*!
 
49
        The returned data must be destroyed with delete.
 
50
        @return A pointer to a 2D texture data.
 
51
    */
 
52
    NBitmapData* GetBitmap();
 
53
 
 
54
private:
 
55
    //! Cairo surface format
 
56
    cairo_format_t m_surface_format;
 
57
    //! Cairo surface
 
58
    cairo_surface_t* m_cairo_surface;
 
59
    int m_width; //!< Surface width.
 
60
    int m_height; //!< Surface height.
 
61
};
 
62
 
 
63
NAMESPACE_END
 
64
 
 
65
#endif // CAIROGRAPHICS_H