Ocular Engine
TextureResourceSaver_BMP.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_SAVER_BMP__H__
19 #define __H__OCULAR_GRAPHICS_TEXTURE_RESOURCE_SAVER_BMP__H__
20 
21 #include "TextureResourceSaver.hpp"
22 #include <fstream>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Graphics
37  {
42  {
43  public:
44 
46  virtual ~TextureResourceSaver_BMP();
47 
48  protected:
49 
59  virtual bool saveFile(Core::File const& file, std::vector<Core::Color> const& pixels, unsigned const width, unsigned const height);
60 
61  private:
62 
63  bool writeHeaders(std::vector<unsigned char>& fileBuffer, long width, long height);
64  bool writePixelArray(std::vector<unsigned char>& fileBuffer, std::vector<Core::Color> const& pixels, unsigned width, unsigned height);
65  };
66  }
70 }
75 //------------------------------------------------------------------------------------------
76 
77 #endif
Definition: TextureResourceSaver_BMP.hpp:41
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual bool saveFile(Core::File const &file, std::vector< Core::Color > const &pixels, unsigned const width, unsigned const height)
Definition: TextureResourceSaver_BMP.cpp:54
Definition: File.hpp:41
Definition: TextureResourceSaver.hpp:51