diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-11 13:47:18 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-11 13:47:18 +0100 |
commit | 1f1184d7a63f94f809fd3a9e807f9f36a3e39dd7 (patch) | |
tree | 89b4d0bcfa9e7cdb76f3c8bac3662f8dadf770b9 /src/kern.h | |
parent | m doc (diff) | |
download | scrotty-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 'src/kern.h')
-rw-r--r-- | src/kern.h | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -16,6 +16,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpadded" +#endif +#include <png.h> +#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); |