JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
NiToolWin.cpp
Go to the documentation of this file.
1
2#include "Gdata.h"
3#include "NiToolWin.h"
4
5
6using namespace jbxl;
7using namespace jbxwl;
8
9
11// Color
12
13void jbxwl::NiSetUserColor(int label, uByte* ptr, BOOL use_image)
14{
15 if (label==1) {
16 if (!use_image) ptr[0] = ptr[1] = 0;
17 ptr[2] = NI_DETECT_COLOR_BRIGHT; // R
18 }
19 else if (label==2) {
20 if (!use_image) ptr[0] = ptr[2] = 0;
21 ptr[1] = NI_DETECT_COLOR_BRIGHT; // G
22 }
23 else if (label==3) {
24 if (!use_image) ptr[1] = ptr[2] = 0;
25 ptr[0] = NI_DETECT_COLOR_BRIGHT; // B
26 }
27 else if (label==4) {
28 if (!use_image) ptr[2] = 0;
29 ptr[0] = ptr[1] = NI_DETECT_COLOR_BRIGHT; // B, G
30 }
31 else if (label==5) {
32 if (!use_image) ptr[1] = 0;
33 ptr[0] = ptr[2] = NI_DETECT_COLOR_BRIGHT; // B, R
34 }
35 else {
36 if (!use_image) ptr[0] = 0;
37 ptr[1] = ptr[2] = NI_DETECT_COLOR_BRIGHT; // G, R
38 }
39
40 return;
41}
42
43
44
45unsigned int jbxwl::NiGetSkeletonColor(int label)
46{
47 unsigned int col;
48
49 if (label==1) {
50 col = BGRA2Int(255, 255, 255-NI_DETECT_COLOR_BRIGHT, 0);
51 }
52 else if (label==2) {
53 col = BGRA2Int(255, 255-NI_DETECT_COLOR_BRIGHT, 255, 0);
54 }
55 else if (label==3) {
56 col = BGRA2Int(255-NI_DETECT_COLOR_BRIGHT, 255, 255, 0);
57 }
58 else if (label==4) {
59 col = BGRA2Int(255-NI_DETECT_COLOR_BRIGHT, 255-NI_DETECT_COLOR_BRIGHT, 255, 0);
60 }
61 else if (label==5) {
62 col = BGRA2Int(255-NI_DETECT_COLOR_BRIGHT, 255, 255-NI_DETECT_COLOR_BRIGHT, 0);
63 }
64 else {
65 col = BGRA2Int(255, 255-NI_DETECT_COLOR_BRIGHT, 255-NI_DETECT_COLOR_BRIGHT, 0);
66 }
67
68/*
69 if (label==1) {
70 col = BGRA2Int(255, 255, 255, 0);
71 }
72 else if (label==2) {
73 col = BGRA2Int(255, 255, 255, 0);
74 }
75 else if (label==3) {
76 col = BGRA2Int(255, 255, 255, 0);
77 }
78 else if (label==4) {
79 col = BGRA2Int(255, 255, 255, 0);
80 }
81 else if (label==5) {
82 col = BGRA2Int(255, 255, 255, 0);
83 }
84 else {
85 col = BGRA2Int(255, 255, 255, 0);
86 }
87 */
88
89 return col;
90}
91
92
#define NI_DETECT_COLOR_BRIGHT
Definition NiToolWin.h:22
void NiSetUserColor(int label, uByte *ptr, BOOL use_image=TRUE)
Definition NiToolWin.cpp:13
unsigned int NiGetSkeletonColor(int label)
Definition NiToolWin.cpp:45