diff --git a/include/hyperion/ImageProcessor.h b/include/hyperion/ImageProcessor.h index 642d0297..4a64bbff 100644 --- a/include/hyperion/ImageProcessor.h +++ b/include/hyperion/ImageProcessor.h @@ -47,6 +47,7 @@ public: /// /// Determines the led colors of the image in the buffer. /// + /// @param[in] image The image to translate to led values /// @param[out] ledColors The color value per led /// void process(const RgbImage& image, std::vector& ledColors); diff --git a/include/hyperion/LedDevice.h b/include/hyperion/LedDevice.h index 7c1dc6a6..083d113b 100644 --- a/include/hyperion/LedDevice.h +++ b/include/hyperion/LedDevice.h @@ -13,18 +13,20 @@ class LedDevice { public: - /** - * Empty virtual destructor for pure virtual base class - */ + /// + /// Empty virtual destructor for pure virtual base class + /// virtual ~LedDevice() { // empty } - /** - * Writes the RGB-Color values to the leds. - * - * @param[in] ledValues The RGB-color per led - */ + /// + /// Writes the RGB-Color values to the leds. + /// + /// @param[in] ledValues The RGB-color per led + /// + /// @return Zero on success else negative + /// virtual int write(const std::vector& ledValues) = 0; }; diff --git a/include/hyperion/LedString.h b/include/hyperion/LedString.h index e5963440..3f7103e0 100644 --- a/include/hyperion/LedString.h +++ b/include/hyperion/LedString.h @@ -15,7 +15,7 @@ namespace Json { class Value; } /// /// The Led structure contains the definition of the image portion used to determine a single led's /// color. -///
+/// @verbatim
 /// |--------------------image--|
 /// | minX  maxX                |
 /// |  |-----|minY              |
@@ -25,7 +25,7 @@ namespace Json { class Value; }
 /// |                           |
 /// |                           |
 /// |---------------------------|
-/// 
+/// @endverbatim
 ///
 struct Led
 {
diff --git a/include/jsonserver/JsonServer.h b/include/jsonserver/JsonServer.h
index 67609fe3..1ae95854 100644
--- a/include/jsonserver/JsonServer.h
+++ b/include/jsonserver/JsonServer.h
@@ -43,7 +43,7 @@ private slots:
 
 	///
 	/// Slot which is called when a client closes a connection
-	/// @param The Connection object which is being closed
+	/// @param connection The Connection object which is being closed
 	///
 	void closedConnection(JsonClientConnection * connection);
 
diff --git a/include/utils/HsvTransform.h b/include/utils/HsvTransform.h
index f260b8e0..661f3eb1 100644
--- a/include/utils/HsvTransform.h
+++ b/include/utils/HsvTransform.h
@@ -67,11 +67,35 @@ public:
 	void transform(uint8_t & red, uint8_t & green, uint8_t & blue) const;
 
 	///
-	/// integer version of the conversion are faster, but a little less accurate
-	/// all values are unsigned 8 bit values and scaled between 0 and 255 except
-	/// for the hue which is a 16 bit number and scaled between 0 and 360
+	///	Translates an RGB (red, green, blue) color to an HSV (hue, saturation, value) color
+	///
+	/// @param[in] red The red RGB-component
+	/// @param[in] green The green RGB-component
+	/// @param[in] blue The blue RGB-component
+	/// @param[out] hue The hue HSV-component
+	/// @param[out] saturation The saturation HSV-component
+	/// @param[out] value The value HSV-component
+	///
+	/// @note Integer version of the conversion are faster, but a little less accurate all values
+	/// are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit
+	/// number and scaled between 0 and 360
 	///
 	static void rgb2hsv(uint8_t red, uint8_t green, uint8_t blue, uint16_t & hue, uint8_t & saturation, uint8_t & value);
+
+	///
+	///	Translates an HSV (hue, saturation, value) color to an RGB (red, green, blue) color
+	///
+	/// @param[in] hue The hue HSV-component
+	/// @param[in] saturation The saturation HSV-component
+	/// @param[in] value The value HSV-component
+	/// @param[out] red The red RGB-component
+	/// @param[out] green The green RGB-component
+	/// @param[out] blue The blue RGB-component
+	///
+	/// @note Integer version of the conversion are faster, but a little less accurate all values
+	/// are unsigned 8 bit values and scaled between 0 and 255 except for the hue which is a 16 bit
+	/// number and scaled between 0 and 360
+	///
 	static void hsv2rgb(uint16_t hue, uint8_t saturation, uint8_t value, uint8_t & red, uint8_t & green, uint8_t & blue);
 
 private:
diff --git a/include/utils/jsonschema/JsonSchemaChecker.h b/include/utils/jsonschema/JsonSchemaChecker.h
index 4f02bcf5..768b57db 100644
--- a/include/utils/jsonschema/JsonSchemaChecker.h
+++ b/include/utils/jsonschema/JsonSchemaChecker.h
@@ -33,14 +33,14 @@ public:
 	virtual ~JsonSchemaChecker();
 
 	///
-	/// @param The schema to use
+	/// @param schema The schema to use
 	/// @return true upon succes
 	///
 	bool setSchema(const Json::Value & schema);
 
 	///
 	/// @brief Validate a JSON structure
-	/// @param The JSON value to check
+	/// @param value The JSON value to check
 	/// @return true when the arguments is valid according to the schema
 	///
 	bool validate(const Json::Value & value);
@@ -51,34 +51,142 @@ public:
 	const std::list & getMessages() const;
 
 private:
-	void collectReferences(const Json::Value & schema);
-
+	///
+	/// Validates a json-value against a given schema. Results are stored in the members of this
+	/// class (_error & _messages)
+	///
+	/// @param[in] value The value to validate
+	/// @param[in] schema The schema against which the value is validated
+	///
 	void validate(const Json::Value &value, const Json::Value & schema);
 
+	///
+	/// Adds the given message to the message-queue (with reference to current line-number)
+	///
+	/// @param[in] message The message to add to the queue
+	///
 	void setMessage(const std::string & message);
 
+	///
+	/// Retrieves all references from the json-value as specified by the schema
+	///
+	/// @param[in] value The json-value
+	/// @param[in] schema The schema
+	///
 	void collectDependencies(const Json::Value & value, const Json::Value &schema);
 
 private:
 	// attribute check functions
+	///
+	/// Checks if the given value is of the specified type. If the type does not match _error is set
+	/// to true and an error-message is added to the message-queue
+	///
+	/// @param[in] value The given value
+	/// @param[in] schema The specified type (as json-value)
+	///
 	void checkType(const Json::Value & value, const Json::Value & schema);
+	///
+	/// Checks is required properties of an json-object exist and if all properties are of the
+	/// correct format. If this is not the case _error is set to true and an error-message is added
+	/// to the message-queue.
+	///
+	/// @param[in] value The given json-object
+	/// @param[in] schema The schema of the json-object
+	///
 	void checkProperties(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Verifies the additional configured properties of an json-object. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param value The given json-object
+	/// @param schema The schema for the json-object
+	/// @param ignoredProperties The properties that were ignored
+	///
 	void checkAdditionalProperties(const Json::Value & value, const Json::Value & schema, const Json::Value::Members & ignoredProperties);
+
+	///
+	/// Checks if references are configued and used correctly. If this is not the case _error is set
+	/// to true and an error-message is added to the message-queue.
+	///
+	/// @param value The given json-object
+	/// @param schemaLink The schema of the json-object
+	///
 	void checkDependencies(const Json::Value & value, const Json::Value & schemaLink);
+
+	///
+	/// Checks if the given value is larger or equal to the specified value. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param[in] value The given value
+	/// @param[in] schema The minimum value (as json-value)
+	///
 	void checkMinimum(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Checks if the given value is smaller or equal to the specified value. If this is not the
+	/// case _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param[in] value The given value
+	/// @param[in] schema The maximum value (as json-value)
+	///
 	void checkMaximum(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Validates all the items of an array.
+	///
+	/// @param value The json-array
+	/// @param schema The schema for the items in the array
+	///
 	void checkItems(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Checks if a given array has at least a minimum number of items. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param value The json-array
+	/// @param schema The minimum size specification (as json-value)
+	///
 	void checkMinItems(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Checks if a given array has at most a maximum number of items. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param value The json-array
+	/// @param schema The maximum size specification (as json-value)
+	///
 	void checkMaxItems(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Checks if a given array contains only unique items. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param value The json-array
+	/// @param schema Bool to enable the check (as json-value)
+	///
 	void checkUniqueItems(const Json::Value & value, const Json::Value & schema);
+
+	///
+	/// Checks if an enum value is actually a valid value for that enum. If this is not the case
+	/// _error is set to true and an error-message is added to the message-queue.
+	///
+	/// @param value The enum value
+	/// @param schema The enum schema definition
+	///
 	void checkEnum(const Json::Value & value, const Json::Value & schema);
 
 private:
+	/// The schema of the entire json-configuration
 	Json::Value _schema;
 
+	/// The current location into a json-configuration structure being checked
 	std::list _currentPath;
+	/// The result messages collected during the schema verification
 	std::list _messages;
+	/// Flag indicating an error occured during validation
 	bool _error;
 
+	/// A list with references (string => json-value)
 	std::map _references; // ref 2 value
 };
diff --git a/libsrc/hyperion/ImageToLedsMap.h b/libsrc/hyperion/ImageToLedsMap.h
index 3605bf78..8cecb94b 100644
--- a/libsrc/hyperion/ImageToLedsMap.h
+++ b/libsrc/hyperion/ImageToLedsMap.h
@@ -59,6 +59,8 @@ namespace hyperion
 		/// Determines the mean-color for each led using the mapping the image given
 		/// at construction.
 		///
+		/// @param[in] image  The image from which to extract the led colors
+		///
 		/// @return ledColors  The vector containing the output
 		///
 		std::vector getMeanLedColor(const RgbImage & image) const;
@@ -67,6 +69,7 @@ namespace hyperion
 		/// Determines the mean color for each led using the mapping the image given
 		/// at construction.
 		///
+		/// @param[in] image  The image from which to extract the led colors
 		/// @param[out] ledColors  The vector containing the output
 		///
 		void getMeanLedColor(const RgbImage & image, std::vector & ledColors) const;
@@ -83,6 +86,7 @@ namespace hyperion
 		/// Calculates the 'mean color' of the given list. This is the mean over each color-channel
 		/// (red, green, blue)
 		///
+		/// @param[in] image The image a section from which an average color must be computed
 		/// @param[in] colors  The list with colors
 		///
 		/// @return The mean of the given list of colors (or black when empty)
diff --git a/libsrc/jsonserver/JsonClientConnection.h b/libsrc/jsonserver/JsonClientConnection.h
index d2ff4366..5381baff 100644
--- a/libsrc/jsonserver/JsonClientConnection.h
+++ b/libsrc/jsonserver/JsonClientConnection.h
@@ -109,8 +109,6 @@ private:
 	///
 	/// Handle an incoming JSON message of unknown type
 	///
-	/// @param message the incoming message
-	///
 	void handleNotImplemented();
 
 	///
diff --git a/libsrc/utils/jsonschema/JsonSchemaChecker.cpp b/libsrc/utils/jsonschema/JsonSchemaChecker.cpp
index 6b69ad0b..2ace25a5 100644
--- a/libsrc/utils/jsonschema/JsonSchemaChecker.cpp
+++ b/libsrc/utils/jsonschema/JsonSchemaChecker.cpp
@@ -413,7 +413,7 @@ void JsonSchemaChecker::checkUniqueItems(const Json::Value & value, const Json::
 	{
 		// only for arrays
 		_error = true;
-		setMessage("maxItems only valid for arrays");
+		setMessage("uniqueItems only valid for arrays");
 		return;
 	}
 
diff --git a/src/hyperion-remote/ColorTransformValues.h b/src/hyperion-remote/ColorTransformValues.h
index d36e2c91..4a8be275 100644
--- a/src/hyperion-remote/ColorTransformValues.h
+++ b/src/hyperion-remote/ColorTransformValues.h
@@ -3,7 +3,10 @@
 /// Simple structure to contain the values of a color transformation
 struct ColorTransformValues
 {
+	/// The value for the red color-channel
 	double valueRed;
+	/// The value for the green color-channel
 	double valueGreen;
+	/// The value for the blue color-channel
 	double valueBlue;
 };
diff --git a/src/hyperion-remote/CustomParameter.h b/src/hyperion-remote/CustomParameter.h
index a9a65242..c1ff96d4 100644
--- a/src/hyperion-remote/CustomParameter.h
+++ b/src/hyperion-remote/CustomParameter.h
@@ -20,6 +20,15 @@ typedef vlofgren::PODParameter ImageParameter;
 typedef vlofgren::PODParameter TransformParameter;
 
 namespace vlofgren {
+	///
+	/// Translates a string (as passed on the commandline) to a color
+	///
+	/// @param[in] s The string (as passed on the commandline)
+	///
+	/// @return The translated color
+	///
+	/// @throws Parameter::ParameterRejected If the string did not result in a color
+	///
 	template<>
 	QColor ColorParameter::validate(const std::string& s) throw (Parameter::ParameterRejected)
 	{
diff --git a/src/hyperion-remote/JsonConnection.h b/src/hyperion-remote/JsonConnection.h
index a6262825..33fc5b4a 100644
--- a/src/hyperion-remote/JsonConnection.h
+++ b/src/hyperion-remote/JsonConnection.h
@@ -79,6 +79,7 @@ public:
 	/// @param saturation The HSV saturation gain
 	/// @param value The HSV value gain
 	/// @param threshold The threshold
+	/// @param gamma The gamma value
 	/// @param blacklevel The blacklevel
 	/// @param whitelevel The whitelevel
 	///
diff --git a/src/viewpng/CMakeLists.txt b/src/viewpng/CMakeLists.txt
index 8ad1defa..6e50bc51 100644
--- a/src/viewpng/CMakeLists.txt
+++ b/src/viewpng/CMakeLists.txt
@@ -6,6 +6,7 @@ if(PNG_FOUND)
 	include_directories(${PNG_INCLUDE_DIR})
 
 	add_executable(viewpng
+			FbWriter.h
 			ViewPng.cpp)
 
 	target_link_libraries(viewpng
diff --git a/src/viewpng/FbWriter.h b/src/viewpng/FbWriter.h
index 9cd4afdc..f6edc6b1 100644
--- a/src/viewpng/FbWriter.h
+++ b/src/viewpng/FbWriter.h
@@ -12,14 +12,27 @@
 
 #include 
 
+///
+/// FbWriter allows direct access tot the FrameBuffer. It writes and image to the framebuffer,
+/// adjusting the resolution as required. When destructed the FrameBuffer is switch to original
+/// configuration.
+///
 class FbWriter
 {
 public:
+	///
+	/// Constructs the FrameBuffer writer opening the FrameBuffer device and storing the current
+	/// configuration.
+	///
 	FbWriter()
 	{
 		initialise();
 	}
 
+	///
+	/// Destructor of the write. Switches the FrameBuffer to its origianl configuration and closes
+	/// the FrameBuffer
+	///
 	~FbWriter()
 	{
 		if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &orig_vinfo))
@@ -30,26 +43,33 @@ public:
 		close(fbfd);
 	}
 
+	///
+	/// Initialises the write, opening the FrameBuffer
+	///
+	/// @return Zero on succes else negative
+	///
 	int initialise()
 	{
 		// Open the file for reading and writing
 		fbfd = open("/dev/fb0", O_RDWR);
 		if (!fbfd)
 		{
-			printf("Error: cannot open framebuffer device.\n");
-			return(-1);
+			std::cerr << "Error: cannot open framebuffer device." << std::endl;
+			return -1;
 		}
 		printf("The framebuffer device was opened successfully.\n");
 
 		// Get fixed screen information
 		if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo))
 		{
-			printf("Error reading fixed information.\n");
+			std::cerr << "Error reading fixed information.\n" << std::endl;
+			return -1;
 		}
 		// Get variable screen information
 		if (ioctl(fbfd, FBIOGET_VSCREENINFO, &orig_vinfo))
 		{
-			printf("Error reading variable information.\n");
+			std::cerr << "Error reading variable information.\n" << std::endl;
+			return -1;
 		}
 		printf("Original %dx%d, %dbpp\n", orig_vinfo.xres, orig_vinfo.yres, orig_vinfo.bits_per_pixel );
 
@@ -57,6 +77,12 @@ public:
 		return 0;
 	}
 
+	///
+	/// Writes the given RGB Image to the FrameBuffer. When required the resolution of the
+	/// FrameBuffer is asjusted to match the given image
+	///
+	/// @param image  The RGB Image
+	///
 	void writeImage(const RgbImage& image)
 	{
 		std::cout << "Writing image [" << image.width() << "x" << image.height() << "]" << std::endl;
@@ -93,23 +119,16 @@ public:
 		for (unsigned iY=0; iY