FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kProfileMsg.h
Go to the documentation of this file.
1 
8 #ifndef K_FIRESYNC_PROFILE_MSG_H
9 #define K_FIRESYNC_PROFILE_MSG_H
10 
11 #include <kFireSync/Data/kMsgSet.h>
12 #include <kFireSync/Data/kProfileMsg.x.h>
13 
20 //typedef kMsgSet kProfileMsg; --forward-declared in kFsDef.x.h
21 
34 kFsFx(kStatus) kProfileMsg_Construct(kProfileMsg* msg, kType pointType, kSize pointCount, kSize profileCount, kBool hasSlices, kAlloc allocator);
35 
46 kFsFx(kStatus) kProfileMsg_BeginAttach(kProfileMsg msg, kType pointType, kSize pointCount, kSize profileCount);
47 
60 kFsFx(kStatus) kProfileMsg_Attach(kProfileMsg msg, kSize itemIndex, kStamp* stamp, void* pointData, void* intensityData, void* sliceData);
61 
71 
80 kInlineFx(kStamp*) kProfileMsg_StampAt(kProfileMsg msg, kSize itemIndex)
81 {
82  return xkProfileMsg_RefAt(msg, itemIndex)->stamp;
83 }
84 
94 kInlineFx(void*) kProfileMsg_PointAt(kProfileMsg msg, kSize itemIndex, kSize pointIndex)
95 {
96  kObj(kProfileMsg, msg);
97  kProfileMsgRef* ref = xkProfileMsg_RefAt(msg, itemIndex);
98 
99  kAssert(pointIndex < obj->pointCount);
100 
101  return kPointer_ItemOffset(ref->pointData, pointIndex, kType_Size(obj->pointType));
102 }
103 
117 #define kProfileMsg_PointAtT(kProfileMsg_msg, kSize_itemIndex, kSize_pointIndex, T) \
118  kCast(T*, xkProfileMsg_PointAtT(kProfileMsg_msg, kSize_itemIndex, kSize_pointIndex, sizeof(T)))
119 
130 {
131  kObj(kProfileMsg, msg);
132  k8u* intensities = xkProfileMsg_RefAt(msg, itemIndex)->intensities;
133 
134  kAssert(pointIndex < obj->pointCount);
135 
136  return &intensities[pointIndex];
137 }
138 
149 {
150  kObj(kProfileMsg, msg);
151  k16u* slices = xkProfileMsg_RefAt(msg, itemIndex)->slices;
152 
153  kAssert(pointIndex < obj->pointCount);
154 
155  return &slices[pointIndex];
156 }
157 
165 kInlineFx(kType) kProfileMsg_PointType(kProfileMsg msg)
166 {
167  kObj(kProfileMsg, msg);
168 
169  return obj->pointType;
170 }
171 
179 kInlineFx(kSize) kProfileMsg_PointCount(kProfileMsg msg)
180 {
181  kObj(kProfileMsg, msg);
182 
183  return obj->pointCount;
184 }
185 
193 kInlineFx(kSize) kProfileMsg_ProfileCount(kProfileMsg msg)
194 {
195  kObj(kProfileMsg, msg);
196 
197  return obj->profileCount;
198 }
199 
207 kInlineFx(kBool) kProfileMsg_HasSlices(kProfileMsg msg)
208 {
209  kObj(kProfileMsg, msg);
210 
211  return obj->hasSlices;
212 }
213 
214 #endif
void * kProfileMsg_PointAt(kProfileMsg msg, kSize itemIndex, kSize pointIndex)
Returns a pointer to a specific point.
Definition: kProfileMsg.h:94
Declares the kMsgSet type.
#define kInlineFx(TYPE)
#define kObj(TypeName_T, T_object)
kStatus kProfileMsg_Attach(kProfileMsg msg, kSize itemIndex, kStamp *stamp, void *pointData, void *intensityData, void *sliceData)
Attaches one of the profiles to external buffer(s).
kStatus kProfileMsg_Assign(kProfileMsg msg, kProfileMsg source)
Copies the source message.
k16u * kProfileMsg_SliceAt(kProfileMsg msg, kSize itemIndex, kSize pointIndex)
Returns a pointer to a specific slice value.
Definition: kProfileMsg.h:148
kStatus kProfileMsg_BeginAttach(kProfileMsg msg, kType pointType, kSize pointCount, kSize profileCount)
Prepare attaching the message content to external buffer(s).
#define kAssert(EXPRESSION)
kStamp * kProfileMsg_StampAt(kProfileMsg msg, kSize itemIndex)
Returns a pointer to the stamp specified by item index.
Definition: kProfileMsg.h:80
Represents acquisition metadata associated with a data message.
Definition: kNodeDef.h:2662
k8u * kProfileMsg_IntensityAt(kProfileMsg msg, kSize itemIndex, kSize pointIndex)
Returns a pointer to a specific intensity value.
Definition: kProfileMsg.h:129
kStatus kProfileMsg_Construct(kProfileMsg *msg, kType pointType, kSize pointCount, kSize profileCount, kBool hasSlices, kAlloc allocator)
Constructs a kProfileMsg object.
Represents a data message (FPGA LUT).