Fawkes API  Fawkes Development Version
fuse_image_content.h
1 
2 /***************************************************************************
3  * fuse_image_content.h - FUSE image content encapsulation
4  *
5  * Created: Thu Nov 15 15:53:32 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_FVUTILS_NET_FUSE_IMAGE_CONTENT_H_
25 #define __FIREVISION_FVUTILS_NET_FUSE_IMAGE_CONTENT_H_
26 
27 #include <fvutils/net/fuse.h>
28 #include <fvutils/net/fuse_message_content.h>
29 #include <utils/time/time.h>
30 #include <sys/types.h>
31 
32 namespace firevision {
33 #if 0 /* just to make Emacs auto-indent happy */
34 }
35 #endif
36 
37 class SharedMemoryImageBuffer;
38 
40 {
41  public:
43  FuseImageContent(uint32_t type, void *payload, size_t payload_size);
44  FuseImageContent(FUSE_image_format_t image_format, const char *image_id,
45  unsigned char *buffer, size_t buffer_size,
46  colorspace_t colorspace,
47  unsigned int width, unsigned int height,
48  long int capture_time_sec = 0, long int capture_time_usec = 0);
49 
51 
52  unsigned char * buffer() const;
53  size_t buffer_size() const;
54  unsigned int pixel_width() const;
55  unsigned int pixel_height() const;
56  unsigned int colorspace() const;
57  unsigned int format() const;
58  void decompress(unsigned char *yuv422_planar_buffer, size_t buffer_size);
59 
60  fawkes::Time * capture_time() const;
61 
62  virtual void serialize();
63 
64  private:
65  unsigned char *__buffer;
66  size_t __buffer_size;
68 
69  mutable fawkes::Time *__capture_time;
70 };
71 
72 } // end namespace firevision
73 
74 #endif
virtual void serialize()
Serialize message content.
unsigned char * buffer() const
Image buffer.
void decompress(unsigned char *yuv422_planar_buffer, size_t buffer_size)
Decompress image data.
A class for handling time.
Definition: time.h:91
unsigned int pixel_width() const
Get image width.
Image packet header.
Definition: fuse.h:120
virtual void * payload() const
Return pointer to payload.
unsigned int pixel_height() const
Get image height.
size_t buffer_size() const
Get size of buffer.
unsigned int format() const
Get image format.
FuseImageContent(SharedMemoryImageBuffer *b)
Constructor.
virtual size_t payload_size() const
Return payload size.
Shared memory image buffer.
Definition: shm_image.h:181
fawkes::Time * capture_time() const
Get capture time.
unsigned int colorspace() const
Get colorspace.