[GRASS-SVN] r61751 - grass/trunk/lib/pngdriver
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 26 15:32:15 PDT 2014
Author: neteler
Date: 2014-08-26 15:32:15 -0700 (Tue, 26 Aug 2014)
New Revision: 61751
Modified:
grass/trunk/lib/pngdriver/Box.c
grass/trunk/lib/pngdriver/Color.c
grass/trunk/lib/pngdriver/Draw_bitmap.c
grass/trunk/lib/pngdriver/Driver.c
grass/trunk/lib/pngdriver/Erase.c
grass/trunk/lib/pngdriver/Graph_close.c
grass/trunk/lib/pngdriver/Graph_set.c
grass/trunk/lib/pngdriver/Line_width.c
grass/trunk/lib/pngdriver/Point.c
grass/trunk/lib/pngdriver/Polygon.c
grass/trunk/lib/pngdriver/Raster.c
grass/trunk/lib/pngdriver/Set_window.c
grass/trunk/lib/pngdriver/pngdriver.h
grass/trunk/lib/pngdriver/read.c
grass/trunk/lib/pngdriver/read_bmp.c
grass/trunk/lib/pngdriver/read_png.c
grass/trunk/lib/pngdriver/write.c
grass/trunk/lib/pngdriver/write_bmp.c
grass/trunk/lib/pngdriver/write_ppm.c
Log:
pngdriver: added minimalistic doxygen documentation
Modified: grass/trunk/lib/pngdriver/Box.c
===================================================================
--- grass/trunk/lib/pngdriver/Box.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Box.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,7 +1,26 @@
+/*!
+ \file pngdriver/Box.c
+ \brief GRASS png display driver - draw box
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <math.h>
#include "pngdriver.h"
+/*!
+ \brief Draw a (filled) rectangle
+
+ \param fx1,fy1,fx2,fy2 rectangle coordinates
+*/
+
void PNG_Box(double fx1, double fy1, double fx2, double fy2)
{
int x1 = (int) floor(fx1 + 0.5);
Modified: grass/trunk/lib/pngdriver/Color.c
===================================================================
--- grass/trunk/lib/pngdriver/Color.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Color.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,14 +1,34 @@
-/*
- * Identify a color that has been set in the reset_color() (found in Reset_clr.c
- * file in this directory). Subsequent graphics calls will use this color.
- *
- * Called by:
- * Color() in ../lib/Color.c
- */
+/*!
+ \file pngdriver/Color.c
+ \brief GRASS png display driver - PNG_color_rgb
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <grass/gis.h>
#include "pngdriver.h"
+/*!
+ \brief Identify a color
+
+ Identify a color that has been set in the reset_color() (found in Reset_clr.c
+ file in this directory). Subsequent graphics calls will use this color.
+
+ Called by:
+ Color() in ../lib/Color.c
+
+ \param r red color value
+ \param g green color value
+ \param b blue color value
+*/
+
void PNG_color_rgb(int r, int g, int b)
{
png.current_color = png_get_color(r, g, b, 0);
Modified: grass/trunk/lib/pngdriver/Draw_bitmap.c
===================================================================
--- grass/trunk/lib/pngdriver/Draw_bitmap.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Draw_bitmap.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,13 +1,18 @@
+/*!
+ \file pngdriver/Draw_bitmap.c
-/*
- * draw a line between two given points in the current color.
- *
- * Called by:
- * Cont_abs() in ../lib/Cont_abs.c
- */
+ \brief GRASS png display driver - draw bitmap
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <math.h>
-
#include "pngdriver.h"
#ifndef min
@@ -17,6 +22,14 @@
#define max(a,b) ((a)>(b)?(a):(b))
#endif
+/*!
+ \brief Draw bitmap
+
+ \param ncols,nrows number of columns and rows
+ \param threshold threshold value
+ \param buf data buffer
+*/
+
void PNG_draw_bitmap(int ncols, int nrows, int threshold,
const unsigned char *buf)
{
Modified: grass/trunk/lib/pngdriver/Driver.c
===================================================================
--- grass/trunk/lib/pngdriver/Driver.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Driver.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,24 +1,23 @@
+/*!
+ \file pngdriver/Driver.c
-/****************************************************************************
- *
- * MODULE: PNG driver
- * AUTHOR(S): Glynn Clements <glynn at gclements.plus.com>
- * COPYRIGHT: (C) 2007 Glynn Clements
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *****************************************************************************/
+ \brief GRASS png display driver - driver initialization
+ (C) 2007 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include "pngdriver.h"
+/*!
+ \brief Initialize display driver
+
+ \return pointer driver structure
+*/
const struct driver *PNG_Driver(void)
{
static struct driver drv;
Modified: grass/trunk/lib/pngdriver/Erase.c
===================================================================
--- grass/trunk/lib/pngdriver/Erase.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Erase.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,5 +1,22 @@
+/*!
+ \file pngdriver/Erase.c
+
+ \brief GRASS png display driver - erase screen
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include "pngdriver.h"
+/*!
+ \brief Erase screen
+*/
void PNG_Erase(void)
{
int n = png.width * png.height;
Modified: grass/trunk/lib/pngdriver/Graph_close.c
===================================================================
--- grass/trunk/lib/pngdriver/Graph_close.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Graph_close.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,8 +1,17 @@
-/*
- * Close down the graphics processing. This gets called only at driver
- * termination time.
- */
+/*!
+ \file pngdriver/Graph_close.c
+ \brief GRASS png display driver - close graphics processing
+
+ (C) 2003-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
@@ -34,6 +43,10 @@
png.mapped = 0;
}
+/*!
+ \brief Close down the graphics processing. This gets called only at driver
+ termination time.
+*/
void PNG_Graph_close(void)
{
write_image();
Modified: grass/trunk/lib/pngdriver/Graph_set.c
===================================================================
--- grass/trunk/lib/pngdriver/Graph_set.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Graph_set.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,15 +1,17 @@
-/*
- * Start up graphics processing. Anything that needs to be assigned, set up,
- * started-up, or otherwise initialized happens here. This is called only at
- * the startup of the graphics driver.
- *
- * The external variables define the pixle limits of the graphics surface. The
- * coordinate system used by the applications programs has the (0,0) origin
- * in the upper left-hand corner. Hence,
- * screen_left < screen_right
- * screen_top < screen_bottom
- */
+/*!
+ \file pngdriver/Graph_set.c
+ \brief GRASS png display driver - set graphics processing
+
+ (C) 2003-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@@ -63,6 +65,20 @@
png.mapped = 1;
}
+/*!
+ \brief Start up graphics processing
+
+ Anything that needs to be assigned, set up,
+ started-up, or otherwise initialized happens here. This is called only at
+ the startup of the graphics driver.
+
+ The external variables define the pixle limits of the graphics surface. The
+ coordinate system used by the applications programs has the (0,0) origin
+ in the upper left-hand corner. Hence,
+ screen_left < screen_right
+ screen_top < screen_bottom
+*/
+
int PNG_Graph_set(void)
{
unsigned int red, grn, blu;
Modified: grass/trunk/lib/pngdriver/Line_width.c
===================================================================
--- grass/trunk/lib/pngdriver/Line_width.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Line_width.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,6 +1,25 @@
+/*!
+ \file pngdriver/Line_width.c
+
+ \brief GRASS png display driver - set line width
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <math.h>
#include "pngdriver.h"
+/*!
+ \brief Set line width
+
+ \param width line width (double precision)
+*/
void PNG_Line_width(double width)
{
png.linewidth = (width < 0 ? 0 : (int) floor(width + 0.5));
Modified: grass/trunk/lib/pngdriver/Point.c
===================================================================
--- grass/trunk/lib/pngdriver/Point.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Point.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,6 +1,22 @@
+/*!
+ \file pngdriver/Point.c
+
+ \brief GRASS png display driver - draw point
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <grass/gis.h>
#include "pngdriver.h"
+/*!
+ \brief Draw point
+*/
void PNG_Point(double x, double y)
{
static double point_size = 1.0;
Modified: grass/trunk/lib/pngdriver/Polygon.c
===================================================================
--- grass/trunk/lib/pngdriver/Polygon.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Polygon.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,17 @@
+/*!
+ \file pngdriver/Polygon.c
+ \brief GRASS png display driver - draw polygon
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
@@ -119,6 +132,9 @@
line(p, n, y);
}
+/*!
+ \brief Draw polygon
+*/
void png_polygon(struct path *p)
{
if (p->vertices[p->count - 1].mode != P_CLOSE)
Modified: grass/trunk/lib/pngdriver/Raster.c
===================================================================
--- grass/trunk/lib/pngdriver/Raster.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Raster.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,17 @@
+/*!
+ \file pngdriver/Raster.c
+ \brief GRASS png display driver - draw raster
+
+ (C) 2003-2014 by Per Henrik Johansen and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <string.h>
#include <math.h>
#include <grass/gis.h>
@@ -57,6 +70,13 @@
trans = G_realloc(trans, nalloc * sizeof(int));
}
+/*!
+ \brief Start drawing raster
+
+ \param mask
+ \param s
+ \param d
+*/
void PNG_begin_raster(int mask, int s[2][2], double fd[2][2])
{
int d[2][2];
@@ -79,6 +99,15 @@
trans[i] = scale_rev_x(d[0][0] + i);
}
+/*!
+ \brief Draw raster row
+
+ \param n number of cell
+ \param row raster row
+ \param red,grn,blu,nul red,green,blue and null value
+
+ \return next row
+*/
int PNG_raster(int n, int row,
const unsigned char *red, const unsigned char *grn,
const unsigned char *blu, const unsigned char *nul)
Modified: grass/trunk/lib/pngdriver/Set_window.c
===================================================================
--- grass/trunk/lib/pngdriver/Set_window.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/Set_window.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,25 +1,25 @@
+/*!
+ \file pngdriver/Set_window.c
-/****************************************************************************
- *
- * MODULE: PNG driver
- * AUTHOR(S): Glynn Clements <glynn at gclements.plus.com>
- * COPYRIGHT: (C) 2007 Glynn Clements
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *****************************************************************************/
+ \brief GRASS png display driver - set window
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Per Henrik Johansen (original contributor)
+ \author Glynn Clements
+*/
+
#include <math.h>
#include "pngdriver.h"
+/*!
+ \brief Set window
+
+ \param t,b,l,r top, bottom, left, right
+*/
void PNG_Set_window(double t, double b, double l, double r)
{
png.clip_top = t > 0 ? t : 0;
@@ -27,4 +27,3 @@
png.clip_left = l > 0 ? l : 0;
png.clip_rite = r < png.width ? r : png.width;
}
-
Modified: grass/trunk/lib/pngdriver/pngdriver.h
===================================================================
--- grass/trunk/lib/pngdriver/pngdriver.h 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/pngdriver.h 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,3 +1,16 @@
+/*!
+ \file pngdriver/pngdriver.h
+
+ \brief GRASS png display driver - header file
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#ifndef __PNGDRIVER_H__
#define __PNGDRIVER_H__
Modified: grass/trunk/lib/pngdriver/read.c
===================================================================
--- grass/trunk/lib/pngdriver/read.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/read.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/read.c
+ \brief GRASS png display driver - read image (lower level functions)
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: grass/trunk/lib/pngdriver/read_bmp.c
===================================================================
--- grass/trunk/lib/pngdriver/read_bmp.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/read_bmp.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/read_bmp.c
+ \brief GRASS png display driver - read bitmap (lower level functions)
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: grass/trunk/lib/pngdriver/read_png.c
===================================================================
--- grass/trunk/lib/pngdriver/read_png.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/read_png.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/read_png.c
+ \brief GRASS png display driver - read png
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <png.h>
Modified: grass/trunk/lib/pngdriver/write.c
===================================================================
--- grass/trunk/lib/pngdriver/write.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/write.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/write.c
+ \brief GRASS png display driver - write image (lower level functions)
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: grass/trunk/lib/pngdriver/write_bmp.c
===================================================================
--- grass/trunk/lib/pngdriver/write_bmp.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/write_bmp.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/write_bmp.c
+ \brief GRASS png display driver - write bitmap (lower level functions)
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: grass/trunk/lib/pngdriver/write_ppm.c
===================================================================
--- grass/trunk/lib/pngdriver/write_ppm.c 2014-08-26 18:03:56 UTC (rev 61750)
+++ grass/trunk/lib/pngdriver/write_ppm.c 2014-08-26 22:32:15 UTC (rev 61751)
@@ -1,4 +1,16 @@
+/*!
+ \file pngdriver/write_ppm.c
+ \brief GRASS png display driver - write PPM image (lower level functions)
+
+ (C) 2007-2014 by Glynn Clements and the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Glynn Clements
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
More information about the grass-commit
mailing list