diff --git a/include/puara/descriptors/brushRub.h b/include/puara/descriptors/brushRub.h index 99812ba..a3518fc 100644 --- a/include/puara/descriptors/brushRub.h +++ b/include/puara/descriptors/brushRub.h @@ -15,7 +15,6 @@ namespace puara_gestures class ValueIntegrator { public: - //TODO VB: we need at least this default constructor because of the non-default constructor for the tied value ValueIntegrator() = default; ValueIntegrator(const ValueIntegrator&) noexcept = default; ValueIntegrator(ValueIntegrator&&) noexcept = default; @@ -44,7 +43,7 @@ class ValueIntegrator { const auto delta = newValue - prevValue; prevValue = newValue; - //TODO VB: floating point comparison + // No delta since the last update -> potentially reset the value if(delta == 0.0) { diff --git a/include/puara/descriptors/touchArrayGestureDetector.h b/include/puara/descriptors/touchArrayGestureDetector.h index 9a7a51c..bee2e7d 100644 --- a/include/puara/descriptors/touchArrayGestureDetector.h +++ b/include/puara/descriptors/touchArrayGestureDetector.h @@ -9,6 +9,18 @@ namespace puara_gestures // touchSizeEdge: number of stripes for top and bottom portions (arbitrary) //maxNumBlobs: maximum number of "blobs" that the blob detector can detect at once on the touch array + +/** + * @class TouchArrayGestureDetector + * @brief A class to detect gestures on a touch-array device. + * + * This class is designed to detect various gestures on a touch-array device by analyzing touch data. + * It detects blobs (contiguous touched stripes in the touch array), and for each blob, it calculates + * the amount of "brushing" and "rubbing" gestures using a BrushRubDetector. + * + * @tparam maxNumBlobs The maximum number of blobs that the blob detector can detect at once on the touch array. + * @tparam touchSizeEdge The number of stripes for the top and bottom portions of the touch array. + */ template class TouchArrayGestureDetector { @@ -44,14 +56,15 @@ class TouchArrayGestureDetector for(int i = 0; i < maxNumBlobs; ++i) brushRubDetector[i].update(blobDetector.blobStartPos[i]); - updateBrushAndRub(); + //and finally update the total brush and rub values + updateTotalBrushAndRub(); } private: BlobDetector blobDetector; BrushRubDetector brushRubDetector[maxNumBlobs]; - void updateBrushAndRub() + void updateTotalBrushAndRub() { // Calculate total brush and rub values double brushes[maxNumBlobs]; diff --git a/include/puara/utils/blobDetector.h b/include/puara/utils/blobDetector.h index 7ce87ac..da29560 100644 --- a/include/puara/utils/blobDetector.h +++ b/include/puara/utils/blobDetector.h @@ -16,13 +16,14 @@ namespace puara_gestures * - The size in terms of consecutive `1`s (`blobSize`) * - The center index (`blobCenter`) * + * @tparam maxNumBlobs The maximum number of blobs that the blob detector can detect at once. + * * @warning Most of these values are reset when a detection function, e.g., detect1D(), is called, * and calculated during the detection funtion calls -- so their value is only really valid right * after such a call. There is no locking mechanism on any of these values so it is on the client * to ensure there is no race conditions. * * @note - * - The number of blobs processed is set by the template parameter `maxNumBlobs`. * - If the input contains more blobs than `maxNumBlobs`, the additional blobs are ignored. */ template