summaryrefslogtreecommitdiffhomepage
path: root/Tobii-EyeX/include/eyex-cpp/Mask.inl
blob: 3e7ed2d5d11dfd743d945d4653b6dd605e47d5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*********************************************************************************************************************
 * Copyright 2013-2014 Tobii Technology AB. All rights reserved.
 * Mask.inl
 *********************************************************************************************************************/

#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_MASK__INL__)
#define __TOBII_TX_CLIENT_CPPBINDINGS_MASK__INL__

/*********************************************************************************************************************/

TX_NAMESPACE_BEGIN

/*********************************************************************************************************************/

inline Mask::Mask(const std::shared_ptr<const Context>& spContext, TX_HANDLE hMask) 
: InteractionObject(spContext, hMask)
{ }

/*********************************************************************************************************************/

inline int Mask::GetColumnCount() const
{
    int columnCount, rowCount;
    TX_VALIDATE(txGetMaskData(_hObject, &columnCount, &rowCount, nullptr, nullptr));
    return columnCount;
}

/*********************************************************************************************************************/

inline int Mask::GetRowCount() const
{    
    int columnCount, rowCount;
    TX_VALIDATE(txGetMaskData(_hObject, &columnCount, &rowCount, nullptr, nullptr));
    return rowCount;
}

/*********************************************************************************************************************/

inline void Mask::GetData(std::vector<TX_BYTE>& data) const
{
    int columnCount, rowCount, dataSize = 0;
    if(TX_VALIDATE(txGetMaskData(_hObject, &columnCount, &rowCount, nullptr, &dataSize)))
        return;

    data.resize(dataSize);
    TX_VALIDATE(txGetMaskData(_hObject, &columnCount, &rowCount, &data[0], &dataSize));
}

/*********************************************************************************************************************/

TX_NAMESPACE_END

/*********************************************************************************************************************/


#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_MASK__INL__)

/*********************************************************************************************************************/