--- 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)
--- 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 $(<))
--- 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<Document> doc = std::shared_ptr<Document>(
- Document::load_from_raw_data(buffer.getData(), buffer.getSize()));
+ std::shared_ptr<Document> doc = std::shared_ptr<Document>(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<Texture>(
@@ -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";
}
}
--- /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
Binary file documents/ohp3d.pdf has changed
--- /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<presentation> {
+ \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}
Binary file textures/default.png has changed
Binary file textures/jazz.png has changed