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