MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Camera.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  Camera.h Capture layer for an SDL_Surface*
3  Copyright (C) 2014 The Regents of the University of New Mexico. All rights reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
28 #ifndef CAMERA_H
29 #define CAMERA_H
30 
31 #include "itype.h"
32 #include "SDL.h"
33 
34 namespace MFM
35 {
36 
47  class Camera
48  {
49  private:
50 
51  static const u32 VIDEO_NAME_MAX_LENGTH = 64;
52 
53  bool m_recording;
54 
55  u32 m_currentFrame;
56 
57  char m_current_vid_dir[VIDEO_NAME_MAX_LENGTH];
58 
59  u32 GetPNGColorType(SDL_Surface* sfc);
60 
61  u32 SavePNG(const char* filename, SDL_Surface* sfc) const;
62 
63  public:
64 
65  Camera();
66 
67  void ToggleRecord();
68 
69  bool IsRecording();
70 
71  void SetRecording(bool recording);
72 
73  bool DrawSurface(SDL_Surface* sfc, const char * pngPath) const;
74  };
75 }
76 
77 #endif /* CAMERA_H */
Definition: Camera.h:47