source: flair-src/branches/sanscv/lib/FlairCore/src/Picture.cpp @ 326

Last change on this file since 326 was 324, checked in by Sanahuja Guillaume, 2 years ago

removing opencv dependency

File size: 1.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5//  created:    2012/01/30
6//  filename:   Picture.cpp
7//
8//  author:     Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    Class displaying a Picture on the ground station
14//
15//
16/*********************************************************************/
17
18#include "Picture.h"
19#include "Image.h"
20#include "Layout.h"
21#include "LayoutPosition.h"
22#include <string.h>
23
24using std::string;
25
26namespace flair {
27namespace gui {
28
29using namespace core;
30
31Picture::Picture(const LayoutPosition *position, string name,
32                 const Image *image)
33    : SendData(position, name, "Picture", 200) {
34  this->image = image;
35
36  SetSendSize(image->GetDataType().GetSize());
37
38  SetVolatileXmlProp("width", image->GetDataType().GetWidth());
39  SetVolatileXmlProp("height", image->GetDataType().GetHeight());
40  SendXml();
41}
42
43Picture::~Picture() {}
44
45void Picture::CopyDatas(char *buf) const {
46  if (image != NULL) {
47    image->GetMutex();
48    memcpy(buf, image->buffer, image->GetDataType().GetSize());
49    image->ReleaseMutex();
50  }
51}
52
53} // end namespace gui
54} // end namespace flair
Note: See TracBrowser for help on using the repository browser.