TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Image4.h
Go to the documentation of this file.
1 
11 #ifndef G3D_Image4_h
12 #define G3D_Image4_h
13 
14 #include "G3D/platform.h"
15 #include "G3D/Map2D.h"
16 #include "G3D/Color4.h"
17 
18 namespace G3D {
19 
20 typedef shared_ptr<class Image4> Image4Ref;
21 
33 class Image4 : public Map2D<Color4, Color4> {
34 public:
35 
36  typedef Image4 Type;
37  typedef shared_ptr<class Image4> Ref;
38 
39 protected:
40 
41  Image4(int w, int h, WrapMode wrap);
42 
43  void copyArray(const Color1* src, int w, int h);
44  void copyArray(const Color3* src, int w, int h);
45  void copyArray(const Color4* src, int w, int h);
46  void copyArray(const Color1unorm8* src, int w, int h);
47  void copyArray(const Color3unorm8* src, int w, int h);
48  void copyArray(const Color4unorm8* src, int w, int h);
49 
50 public:
51 
52  const class ImageFormat* format() const;
53 
55  static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR);
56 
59 
60  static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR);
61 
62  static Ref fromArray(const class Color1unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
63  static Ref fromArray(const class Color3unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
64  static Ref fromArray(const class Color4unorm8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
65  static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
66  static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
67  static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR);
68 
69  static Ref fromImage4unorm8(const shared_ptr<class Image4unorm8>& im);
70 
72  void load(const std::string& filename);
73 
75  void save(const std::string& filename);
76 };
77 
78 } // G3D
79 
80 #endif
const class ImageFormat * format() const
Definition: Image4.cpp:212
int32 height() const
Definition: Map2D.h:645
static Ref createEmpty(int width, int height, WrapMode wrap=WrapMode::ERROR)
Definition: Image4.cpp:43
Image4(int w, int h, WrapMode wrap)
Definition: Image4.cpp:24
shared_ptr< class Image4 > Image4Ref
Definition: Image4.h:20
static Ref fromArray(const class Color1unorm8 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR)
Definition: Image4.cpp:109
shared_ptr< class Image4 > Ref
Definition: Image4.h:37
Definition: AABox.h:25
Definition: WrapMode.h:63
Definition: Map2D.h:171
void load(const std::string &filename)
Definition: Image4.cpp:60
float wrap(float t, float lo, float hi)
Definition: g3dmath.h:495
uint32 h
Definition: Map2D.h:194
Definition: Image4.h:33
int32 width() const
Definition: Map2D.h:639
static Ref fromFile(const std::string &filename, WrapMode wrap=WrapMode::ERROR)
Definition: Image4.cpp:53
uint32 w
Definition: Map2D.h:191
static Ref fromImage4unorm8(const shared_ptr< class Image4unorm8 > &im)
Definition: Image4.cpp:29
Image4 Type
Definition: Image4.h:36
Definition: Color1.h:28
Definition: Color3.h:33
Definition: ImageFormat.h:30
void copyArray(const Color1 *src, int w, int h)
Definition: Image4.cpp:193
void save(const std::string &filename)
Definition: Image4.cpp:206
Definition: Color4.h:33
Definition: WrapMode.h:55