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