# HG changeset patch # User František Kučera # Date 1703677847 -3600 # Node ID 711d3d781143987f389b8ce67c16f1b488a575b4 # Parent ed3caeea978abf37651cdad5a7c9916a16c0b4df default PDF document diff -r ed3caeea978a -r 711d3d781143 .hgignore --- a/.hgignore Wed Dec 27 12:11:27 2023 +0100 +++ b/.hgignore Wed Dec 27 12:50:47 2023 +0100 @@ -4,4 +4,4 @@ .kdev4 -data/.*\.(aux|log|nav|out|snm|toc) +documents/.*\.(aux|log|nav|out|snm|toc) diff -r ed3caeea978a -r 711d3d781143 Makefile --- a/Makefile Wed Dec 27 12:11:27 2023 +0100 +++ b/Makefile Wed Dec 27 12:50:47 2023 +0100 @@ -19,6 +19,12 @@ clean: rm -rf build + rm -f documents/*.aux + rm -f documents/*.log + rm -f documents/*.nav + rm -f documents/*.out + rm -f documents/*.snm + rm -f documents/*.toc run: build/ohp3d OHP3D_DATA_DIR=. $(<) @@ -36,3 +42,6 @@ mkdir -p build $(CXX) -std=c++20 -g -o $(@) $(SRC) $$(pkg-config --cflags --libs \ epoxy x11 glu glm poppler-cpp) + +documents/ohp3d.pdf: documents/ohp3d.tex + cd documents; pdflatex $(notdir $(<)) diff -r ed3caeea978a -r 711d3d781143 OHP3D.cpp --- a/OHP3D.cpp Wed Dec 27 12:11:27 2023 +0100 +++ b/OHP3D.cpp Wed Dec 27 12:50:47 2023 +0100 @@ -563,6 +563,9 @@ } void OHP3D::Impl::loadDocuments() { + if (cfg.documents.empty()) + cfg.documents.push_back({getDefaultFile("documents/default.pdf")}); + for (const Configuration::File& document : cfg.documents) { std::cerr << "loading document: " << document.fileName.c_str() << "\n"; @@ -571,8 +574,8 @@ namespace pp = poppler; using Document = pp::document; - std::shared_ptr doc = std::shared_ptr( - Document::load_from_raw_data(buffer.getData(), buffer.getSize())); + std::shared_ptr doc = std::shared_ptr(Document:: + load_from_raw_data(buffer.getData(), buffer.getSize())); log(LogLevel::INFO, std::string("PDF parsed:") + " pages=" + std::to_string(doc->pages())); @@ -588,7 +591,7 @@ PageBuffer img( pageImage.data(), - pageImage.bytes_per_row() * pageImage.height(), + pageImage.width() * pageImage.height() * 3, pageImage.width(), pageImage.height()); textures.push_back(std::make_shared( @@ -610,7 +613,7 @@ << " total = " << timingTotal << " µs (" << doc->pages() << " pages)"; log(LogLevel::INFO, timingMsg.str()); - if (timingTotal < 400000) logOutput << ">>> Doherty threshold met! <<<\n"; + if (timingTotal < 400000) logOutput << ">> Doherty threshold met! <<\n"; } } diff -r ed3caeea978a -r 711d3d781143 documents/default.pdf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/documents/default.pdf Wed Dec 27 12:50:47 2023 +0100 @@ -0,0 +1,1 @@ +ohp3d.pdf \ No newline at end of file diff -r ed3caeea978a -r 711d3d781143 documents/ohp3d.pdf Binary file documents/ohp3d.pdf has changed diff -r ed3caeea978a -r 711d3d781143 documents/ohp3d.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/documents/ohp3d.tex Wed Dec 27 12:50:47 2023 +0100 @@ -0,0 +1,80 @@ +\documentclass{beamer} + +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage[czech]{babel} +\usepackage[utf8x]{inputenc} +%\usepackage[pdfauthor={Frantovo.cz}, bookmarks=true,unicode,colorlinks=true,linkcolor=black,urlcolor=blue,citecolor=blue]{hyperref} + +%\usepackage{ucs} +%\usepackage[czech]{babel} % aby tam nebylo "chapter 1" ale "kapitola 1" a další věci +%\usepackage[utf8x]{inputenc} % abychom mohli psát v UTF-8 +\PrerenderUnicode{ěščřžýáíéůúóťď–→„“} + +\usepackage{palatino} +\usepackage{graphicx} + +\mode { + \usetheme{Warsaw} + \setbeamercovered{transparent} +} + +\bibliographystyle{apacite} + + +\title{OHP3D: OpenGL PDF viewer} +\author{Ing.~František~Kučera} +\institute{Frantovo.cz / GlobalCode.info} +\date{28.~12.~2023} + +%------------------------------------------------------------------------------------------------------------------------- +\begin{document} + +\begin{frame} + \titlepage +\end{frame} +%------------------------------------------------------------------------------------------------------------------------- + + + +%------------------------------------------------------------------------------------------------------------------------- +\section{What is OHP3D} +\begin{frame} + \frametitle{What is OHP3D} + \begin{itemize} + \item OpenGL PDF viewer + \item for X11 and GNU/Linux + \item keyboard and mouse control + \item filters: GLSL shaders + \end{itemize} +\end{frame} +%------------------------------------------------------------------------------------------------------------------------- + + +%------------------------------------------------------------------------------------------------------------------------- +\section{Current status} +\begin{frame} + \frametitle{Current status} + \begin{itemize} + \item first public version + \item based on ShaderShark and previous private prototype + \item still bit raw, lots of missing features + \item but displays PDF and applies shaders + \end{itemize} +\end{frame} +%------------------------------------------------------------------------------------------------------------------------- + + +%------------------------------------------------------------------------------------------------------------------------- +\begin{frame} + \frametitle{Contact and support} + \begin{itemize} + \item + Author: Ing. František Kučera \\ + \url{https://blog.frantovo.cz/} \\ + \url{https://office.globalcode.info/} + \end{itemize} +\end{frame} +%------------------------------------------------------------------------------------------------------------------------- + +\end{document} diff -r ed3caeea978a -r 711d3d781143 textures/default.png Binary file textures/default.png has changed diff -r ed3caeea978a -r 711d3d781143 textures/jazz.png Binary file textures/jazz.png has changed