All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
iOSTextureFileLoader.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "ITextureFileLoader.h"
6 #include "IJpegLoader.h"
7 #include "Types.h"
8 #include "MacTypes.h"
9 #include "GLHelpers.h"
10 #include <string>
11 
12 namespace Eegeo
13 {
14  namespace iOS
15  {
16  class iOSFileIO;
17  class iOSPNGDecoder;
18 
19  using namespace Helpers;
20 
22  {
23  iOSFileIO* m_pFileIO;
25  iOSPNGDecoder& m_pngDecoder;
26 
27  bool LoadPvrFromBuffer(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
28  const Byte* resourceBuffer,
29  size_t resourceBufferSizeBytes);
30 
31  bool LoadPngFromBuffer(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
32  const Byte* resourceBuffer,
33  size_t resourceBufferSizeBytes,
34  bool mipmap,
35  bool invertVertically);
36 
37  bool LoadJpgFromBuffer(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
38  const Byte* resourceBuffer,
39  size_t resourceBufferSizeBytes,
40  bool mipmap,
41  bool invertVertically);
42 
43  public:
46  iOSPNGDecoder& pngDecoder);
47 
48  virtual ~iOSTextureFileLoader();
49 
50  bool LoadJPG(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
51  const std::string& filename,
52  bool mipmap,
53  bool invertVertically);
54 
55  bool LoadPVR(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
56  const std::string& filename);
57 
58  bool LoadPNG(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
59  const std::string& filename,
60  bool mipmap,
61  bool invertVertically);
62 
63  virtual Rendering::AsyncTexturing::IAsyncTextureLoad& LoadFromFileAsync(
65  const std::string& fileName,
66  void* pUserData,
67  bool mipmap = false);
68 
69  virtual Rendering::AsyncTexturing::IAsyncTextureLoad& LoadCubeFromFileAsync(
71  const Helpers::CubeTextureName& textureName,
72  void* pUserData);
73 
74  virtual bool LoadFromBuffer(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
75  const std::string& fileExtension,
76  const Byte* resourceBuffer,
77  size_t bufferSizeBytes,
78  bool mipmap=false);
79 
80  virtual bool LoadTexture(Eegeo::Helpers::GLHelpers::TextureInfo& textureInfo,
81  const std::string& fileName,
82  bool mipmap = false);
83 
85  const std::string& fileExtension,
86  const std::vector<Byte>& resourceBuffer,
87  void* pUserData,
88  bool mipmap = false
89  );
90 
92  const std::vector<const std::vector<Byte>*>& cubeFaceBuffers,
93  void* pUserData
94  );
95 
96  virtual bool LoadFromCubeFaces(Eegeo::Helpers::GLHelpers::TextureInfo& out_textureInfo,
97  const CubeFaceFileNames& cubeFaceFileNames);
98 
99  virtual bool LoadFromCubeFaces(Eegeo::Helpers::GLHelpers::TextureInfo& out_textureInfo,
100  const std::vector<const std::vector<Byte>*>& cubeFaceBuffers);
101 
102 
103  virtual bool LoadCubeTexture(Eegeo::Helpers::GLHelpers::TextureInfo& out_textureInfo,
104  const CubeTextureName& textureName);
105  };
106  }
107 }