aboutsummaryrefslogtreecommitdiffstats
path: root/src/pnm.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-11 13:47:18 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-11 13:47:18 +0100
commit1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7 (patch)
tree89b4d0bcfa9e7cdb76f3c8bac3662f8dadf770b9 /src/pnm.h
parentm doc (diff)
downloadscrotty-1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7.tar.gz
scrotty-1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7.tar.bz2
scrotty-1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7.tar.xz
png conversion is no longer done in a separate process.
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/pnm.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/pnm.h b/src/pnm.h
index 172e3cb..9721d4c 100644
--- a/src/pnm.h
+++ b/src/pnm.h
@@ -16,11 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
/**
- * Store a pixel to an PNM image.
+ * Store a pixel to a PNM image.
*
* A pixel in the PNM image is formatted as `%{red} %{green} %{blue} ` in text.
*
@@ -30,7 +29,7 @@
* @param B:int The [0, 255]-value on the blue subpixel.
* @return Positive on success (not zero!), -1 on error.
*/
-#define SAVE_PIXEL(F, R, G, B) \
+#define SAVE_PNM_PIXEL(F, R, G, B) \
fprintf (F, "%s%s%s", inttable[R], inttable[G], inttable[B])
@@ -47,3 +46,15 @@
*/
extern const char* inttable[];
+
+/**
+ * Create an PNM file.
+ *
+ * @param fbfd The file descriptor connected to framebuffer device.
+ * @param width The width of the image.
+ * @param height The height of the image.
+ * @param imgfd The file descriptor connected to conversion process's stdin.
+ * @return Zero on success, -1 on error.
+ */
+int save_pnm (int fbfd, long width, long height, int imgfd);
+