Last change
on this file since 197 was 137, checked in by Sanahuja Guillaume, 8 years ago |
singleton manager
|
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 "cvimage.h"
|
---|
20 | #include "Layout.h"
|
---|
21 | #include "LayoutPosition.h"
|
---|
22 |
|
---|
23 | using std::string;
|
---|
24 |
|
---|
25 | namespace flair {
|
---|
26 | namespace gui {
|
---|
27 |
|
---|
28 | using namespace core;
|
---|
29 |
|
---|
30 | Picture::Picture(const LayoutPosition *position, string name,
|
---|
31 | const cvimage *image)
|
---|
32 | : SendData(position, name, "Picture", 200) {
|
---|
33 | this->image = image;
|
---|
34 |
|
---|
35 | SetSendSize(image->GetDataType().GetSize());
|
---|
36 |
|
---|
37 | SetVolatileXmlProp("width", image->GetDataType().GetWidth());
|
---|
38 | SetVolatileXmlProp("height", image->GetDataType().GetHeight());
|
---|
39 | SendXml();
|
---|
40 | }
|
---|
41 |
|
---|
42 | Picture::~Picture() {}
|
---|
43 |
|
---|
44 | void Picture::CopyDatas(char *buf) const {
|
---|
45 | if (image != NULL) {
|
---|
46 | image->GetMutex();
|
---|
47 | memcpy(buf, image->img->imageData, image->GetDataType().GetSize());
|
---|
48 | image->ReleaseMutex();
|
---|
49 | }
|
---|
50 | }
|
---|
51 |
|
---|
52 | } // end namespace gui
|
---|
53 | } // end namespace flair
|
---|
Note:
See
TracBrowser
for help on using the repository browser.