Fixed doxygen warnings

This commit is contained in:
T. van der Zwan
2013-09-09 20:35:28 +00:00
parent a6c0f06b44
commit ecdd7775c5
14 changed files with 205 additions and 35 deletions

View File

@@ -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;
};

View File

@@ -20,6 +20,15 @@ typedef vlofgren::PODParameter<QImage> ImageParameter;
typedef vlofgren::PODParameter<ColorTransformValues> 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)
{

View File

@@ -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
///

View File

@@ -6,6 +6,7 @@ if(PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR})
add_executable(viewpng
FbWriter.h
ViewPng.cpp)
target_link_libraries(viewpng

View File

@@ -12,14 +12,27 @@
#include <utils/RgbImage.h>
///
/// 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<image.height(); ++iY)
{
memcpy(fbp + iY*finfo.line_length, &(image(0, iY)), image.width()*3);
// for (unsigned iX=0; iX<image.width(); ++iX)
// {
// const unsigned pixOffset = iX*3 + iY*finfo.line_length;
// fbp[pixOffset ] = image(iX, iY).red;
// fbp[pixOffset+1] = image(iX, iY).green;
// fbp[pixOffset+2] = image(iX, iY).blue;
// }
}
std::cout << "FINISHED COPYING IMAGE TO FRAMEBUFFER" << std::endl;
// cleanup
munmap(fbp, screensize);
}
// The identifier of the FrameBuffer File-Device
/// The identifier of the FrameBuffer File-Device
int fbfd;
// The 'Fixed' screen information
/// The 'Fixed' screen information
fb_fix_screeninfo finfo;
// The original 'Variable' screen information
/// The original 'Variable' screen information
fb_var_screeninfo orig_vinfo;
};