1 //============================================================================= 2 // MusE Reader 3 // Music Score Reader 4 // 5 // Copyright (C) 2010 Werner Schweer 6 // 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License version 2. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with this program; if not, write to the Free Software 17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 //============================================================================= 19 20 #ifndef __PDF_H__ 21 #define __PDF_H__ 22 23 #include "qt5/poppler-qt5.h" 24 25 class PDFDoc; 26 class QImageOutputDev; 27 28 namespace Ms { 29 30 //--------------------------------------------------------- 31 // Pdf 32 //--------------------------------------------------------- 33 34 class Pdf { 35 static int references; 36 PDFDoc* _doc; 37 QImageOutputDev* imgOut; 38 Poppler::Document* _document; 39 public: 40 Pdf(); 41 bool open(const QString& path); 42 ~Pdf(); 43 44 int numPages() const; 45 QImage page(int); 46 QImage binarization(QImage image); 47 }; 48 } 49 50 #endif 51 52