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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
|
/**
@page modules_node_capabilities Support Capabilities
If you want your new node implementation to support any capabilities, it
should both declare that and implement their interfaces.
Declaring the node implementation supported capabilities is done by
implementing the @ref xn::ModuleProductionNode::IsCapabilitySupported
"IsCapabilitySupported()" method. This method only declares if a certain
capability is supported or not.
The actual implementation of the capability is done by implementing this
capability interface. This implementation can be done in a different
class, or in your node implementation class. In any case, your node
implementation must implement the proper 'get' mechanism for this
interface.
The following table summarizes all capabilities:
<table>
<tr>
<th>Capability</th>
<th>Capability Name</th>
<th>Capability Interface</th>
<th>Get Interface Method</th>
</tr>
<tr>
<td>Extended Serialization</td>
<td>XN_CAPABILITY_EXTENDED_SERIALIZATION</td>
<td>xn::ModuleExtendedSerializationInterface</td>
<td>xn::ModuleProductionNode::GetExtendedSerializationInterface</td>
</tr>
<tr>
<td>Lock Aware</td>
<td>XN_CAPABILITY_LOCK_AWARE</td>
<td>xn::ModuleLockAwareInterface</td>
<td>xn::ModuleProductionNode::GetLockAwareInterface</td>
</tr>
<tr>
<td>Error State</td>
<td>XN_CAPABILITY_ERROR_STATE</td>
<td>xn::ModuleErrorStateInterface</td>
<td>xn::ModuleProductionNode::GetErrorStateInterface</td>
</tr>
<tr>
<td>Brightness</td>
<td>XN_CAPABILITY_BRIGHTNESS</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Contrast</td>
<td>XN_CAPABILITY_CONTRAST</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Hue</td>
<td>XN_CAPABILITY_HUE</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Saturation</td>
<td>XN_CAPABILITY_SATURATION</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Sharpness</td>
<td>XN_CAPABILITY_SHARPNESS</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Gamma</td>
<td>XN_CAPABILITY_GAMMA</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Color Temperature</td>
<td>XN_CAPABILITY_COLOR_TEMPERATURE</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Backlight Compensation</td>
<td>XN_CAPABILITY_BACKLIGHT_COMPENSATION</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Gain</td>
<td>XN_CAPABILITY_GAIN</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Pan</td>
<td>XN_CAPABILITY_PAN</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Tilt</td>
<td>XN_CAPABILITY_TILT</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Roll</td>
<td>XN_CAPABILITY_ROLL</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Zoom</td>
<td>XN_CAPABILITY_ZOOM</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Exposure</td>
<td>XN_CAPABILITY_EXPOSURE</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Iris</td>
<td>XN_CAPABILITY_IRIS</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Focus</td>
<td>XN_CAPABILITY_FOCUS</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Lowlight Compensation</td>
<td>XN_CAPABILITY_LOW_LIGHT_COMPENSATION</td>
<td>xn::ModuleGeneralIntInterface</td>
<td>xn::ModuleProductionNode::GetGeneralIntInterface</td>
</tr>
<tr>
<td>Device Identification</td>
<td>XN_CAPABILITY_DEVICE_IDENTIFICATION</td>
<td>xn::ModuleDeviceIdentificationInterface</td>
<td>xn::ModuleDevice::GetIdentificationInterface</td>
</tr>
<tr>
<td>Alternative Viewpoint</td>
<td>XN_CAPABILITY_ALTERNATIVE_VIEW_POINT</td>
<td>xn::ModuleAlternativeViewPointInterface</td>
<td>xn::ModuleGenerator::GetAlternativeViewPointInterface</td>
</tr>
<tr>
<td>Frame Sync</td>
<td>XN_CAPABILITY_FRAME_SYNC</td>
<td>xn::ModuleFrameSyncInterface</td>
<td>xn::ModuleGenerator::GetFrameSyncInterface</td>
</tr>
<tr>
<td>Mirror</td>
<td>XN_CAPABILITY_MIRROR</td>
<td>xn::ModuleMirrorInterface</td>
<td>xn::ModuleGenerator::GetMirrorInterface</td>
</tr>
<tr>
<td>Cropping</td>
<td>XN_CAPABILITY_CROPPING</td>
<td>xn::ModuleCroppingInterface</td>
<td>xn::ModuleMapGenerator::GetCroppingInterface</td>
</tr>
<tr>
<td>Anti Flicker</td>
<td>XN_CAPABILITY_ANTI_FLICKER</td>
<td>xn::ModuleAntiFlickerInterface</td>
<td>xn::ModuleMapGenerator::GetAntiFlickerInterface</td>
</tr>
<tr>
<td>User Position</td>
<td>XN_CAPABILITY_USER_POSITION</td>
<td>xn::ModuleUserPositionInterface</td>
<td>xn::ModuleDepthGenerator::GetUserPositionInterface</td>
</tr>
<tr>
<td>Hand Touching Field-of-View</td>
<td>XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE</td>
<td>xn::ModuleHandTouchingFOVEdgeInterface</td>
<td>xn::ModuleHandsGenerator::GetHandTouchingFOVEdgeInterface</td>
</tr>
<tr>
<td>Skeleton</td>
<td>XN_CAPABILITY_SKELETON</td>
<td>xn::ModuleSkeletonInterface</td>
<td>xn::ModuleUserGenerator::GetSkeletonInterface</td>
</tr>
<tr>
<td>Pose Detection</td>
<td>XN_CAPABILITY_POSE_DETECTION</td>
<td>xn::ModulePoseDetectionInteface</td>
<td>xn::ModuleUserGenerator::GetPoseDetectionInteface</td>
</tr>
</table>
For example, let's say your hands generator supports the mirror
capability as well as the error state capability. The HandsGenerator can
implement the error state capability in the same class and the mirror
capability in a different class.
Thus, in the class implementation below, the
<code>GetErrorStateInterface()</code> method returns <code>this</code>,
since the 'Error State Interface' is also implemented by this class. On
the other hand, the <code>GetMirrorInterface()</code> method has to
return a reference to <code>m_mirrorCap</code>, which is an instance of
the helper class, <code>MyHandsGeneratorMirror</code>.
@code
class MyHandsGeneratorMirror : public virtual xn::ModuleMirrorInterface
{
...
};
class MyHandGenerator:
public virtual xn::ModuleHandsGenerator,
public virtual xn::ModuleErrorStateInterface
{
public:
...
virtual XnBool IsCapabilitySupported(const XnChar* strCapabilityName)
{
return (
strcmp(strCapabilityName, XN_CAPABILITY_MIRROR) == 0 ||
strcmp(strCapabilityName, XN_CAPABILITY_ERROR_STATE) == 0
);
}
...
virtual ModuleErrorStateInterface* GetErrorStateInterface() { return this; }
...
virtual ModuleMirrorInterface* GetMirrorInterface() { return &m_mirrorCap; }
private:
MyHandsGeneratorMirror m_mirrorCap;
};
@endcode
*/
|