From 1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 11 Dec 2015 13:47:18 +0100 Subject: png conversion is no longer done in a separate process. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/kern.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/kern.h') diff --git a/src/kern.h b/src/kern.h index 45f692a..8c2adf0 100644 --- a/src/kern.h +++ b/src/kern.h @@ -16,6 +16,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpadded" +#endif +#include +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + /** @@ -65,6 +74,24 @@ int measure (int fbno, char *restrict fbpath, long *restrict width, long *restri * pixel is encoded. * @return Zero on success, -1 on error. */ -int convert_fb (FILE *restrict file, const char *restrict buf, - size_t n, size_t *restrict adjustment); +int convert_fb_to_pnm (FILE *restrict file, const char *restrict buf, + size_t n, size_t *restrict adjustment); + +/** + * Convert read data from a framebuffer to PNG pixel data. + * + * @param file The output image file. + * @param buf Buffer with read data. + * @param n The number of read characters. + * @param width3 The width of the image multipled by 3. + * @param adjustment Set to zero if all bytes were converted + * (a whole number of pixels where available,) + * otherwise, set to the number of bytes a + * pixel is encoded. + * @param state Use this to keep track of where in the you + * stopped. It will be 0 on the first call. + * @return Zero on success, -1 on error. + */ +int convert_fb_to_png (png_struct *pngbuf, png_byte *restrict pixbuf, const char *restrict buf, + size_t n, long width3, size_t *restrict adjustment, long *restrict state); -- cgit v1.2.3-70-g09d2