1141cc406Sopenharmony_ci/* scanimage -- command line scanning utility 2141cc406Sopenharmony_ci * Uses the SANE library. 3141cc406Sopenharmony_ci * 4141cc406Sopenharmony_ci * Copyright (C) 2021 Thierry HUCHARD <thierry@ordissimo.com> 5141cc406Sopenharmony_ci * 6141cc406Sopenharmony_ci * For questions and comments contact the sane-devel mailinglist (see 7141cc406Sopenharmony_ci * http://www.sane-project.org/mailing-lists.html). 8141cc406Sopenharmony_ci * 9141cc406Sopenharmony_ci * This program is free software; you can redistribute it and/or 10141cc406Sopenharmony_ci * modify it under the terms of the GNU General Public License as 11141cc406Sopenharmony_ci * published by the Free Software Foundation; either version 2 of the 12141cc406Sopenharmony_ci * License, or (at your option) any later version. 13141cc406Sopenharmony_ci * 14141cc406Sopenharmony_ci * This program is distributed in the hope that it will be useful, but 15141cc406Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of 16141cc406Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17141cc406Sopenharmony_ci * General Public License for more details. 18141cc406Sopenharmony_ci * 19141cc406Sopenharmony_ci * You should have received a copy of the GNU General Public License 20141cc406Sopenharmony_ci * along with this program. If not, see <https://www.gnu.org/licenses/>. 21141cc406Sopenharmony_ci*/ 22141cc406Sopenharmony_ci 23141cc406Sopenharmony_ci#ifndef __JPEG_TO_PDF_H__ 24141cc406Sopenharmony_ci#define __JPEG_TO_PDF_H__ 25141cc406Sopenharmony_ci 26141cc406Sopenharmony_ci#include "../include/_stdint.h" 27141cc406Sopenharmony_ci 28141cc406Sopenharmony_ci#include "../include/sane/sane.h" 29141cc406Sopenharmony_ci#include "../include/sane/sanei.h" 30141cc406Sopenharmony_ci#include "../include/sane/saneopts.h" 31141cc406Sopenharmony_ci 32141cc406Sopenharmony_ci 33141cc406Sopenharmony_ci 34141cc406Sopenharmony_ci#ifndef PATH_MAX 35141cc406Sopenharmony_ci# define PATH_MAX 4096 36141cc406Sopenharmony_ci#endif 37141cc406Sopenharmony_ci 38141cc406Sopenharmony_citypedef long long SANE_Int64; 39141cc406Sopenharmony_ci 40141cc406Sopenharmony_ci/* sane_pdf_StartPage - type */ 41141cc406Sopenharmony_cienum { 42141cc406Sopenharmony_ci SANE_PDF_IMAGE_COLOR = 0, /* RGB24bit */ 43141cc406Sopenharmony_ci SANE_PDF_IMAGE_GRAY, /* Gray8bit */ 44141cc406Sopenharmony_ci SANE_PDF_IMAGE_MONO, /* Gray1bit */ 45141cc406Sopenharmony_ci SANE_PDF_IMAGE_NUM, 46141cc406Sopenharmony_ci}; 47141cc406Sopenharmony_ci 48141cc406Sopenharmony_ci/* sane_pdf_StartPage - rotate */ 49141cc406Sopenharmony_cienum { 50141cc406Sopenharmony_ci SANE_PDF_ROTATE_OFF = 0, /* rotate off */ 51141cc406Sopenharmony_ci SANE_PDF_ROTATE_ON, /* rotate 180 degrees */ 52141cc406Sopenharmony_ci}; 53141cc406Sopenharmony_ci 54141cc406Sopenharmony_ci 55141cc406Sopenharmony_citypedef struct mynode 56141cc406Sopenharmony_ci{ 57141cc406Sopenharmony_ci SANE_Int page; 58141cc406Sopenharmony_ci SANE_Int show_page; 59141cc406Sopenharmony_ci SANE_Int rotate; 60141cc406Sopenharmony_ci struct mynode *prev; 61141cc406Sopenharmony_ci struct mynode *next; 62141cc406Sopenharmony_ci FILE* fd; 63141cc406Sopenharmony_ci SANE_Int file_size; 64141cc406Sopenharmony_ci SANE_Byte file_path[ PATH_MAX ]; 65141cc406Sopenharmony_ci} SANE_PDF_NODE, *LPSANE_PDF_NODE; 66141cc406Sopenharmony_ci 67141cc406Sopenharmony_ci 68141cc406Sopenharmony_ciSANE_Int sane_pdf_open( void **ppw, FILE* fd ); 69141cc406Sopenharmony_civoid sane_pdf_close( void *pw ); 70141cc406Sopenharmony_ci 71141cc406Sopenharmony_ciSANE_Int sane_pdf_start_doc( void *pw ); 72141cc406Sopenharmony_ciSANE_Int sane_pdf_end_doc( void *pw ); 73141cc406Sopenharmony_ci 74141cc406Sopenharmony_ciSANE_Int sane_pdf_start_page( void *pw, SANE_Int w, SANE_Int h, SANE_Int res, SANE_Int type, SANE_Int rotate ); 75141cc406Sopenharmony_ciSANE_Int sane_pdf_end_page( void *pw ); 76141cc406Sopenharmony_ci 77141cc406Sopenharmony_ci#endif /* __JPEG_TO_PDF_H__ */ 78