blob: f6b9fe4fec1d37df1434929a985eb78b47cf55ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2020 Blender Foundation. All rights reserved. */
#pragma once
/** \file
* \ingroup bgpencil
*/
#include "gpencil_io_export_base.hh"
#include "hpdf.h"
struct GpencilIOParams;
struct bGPDlayer;
struct bGPDstroke;
#define PDF_EXPORTER_NAME "PDF Exporter for Grease Pencil"
#define PDF_EXPORTER_VERSION "v1.0"
namespace blender::io::gpencil {
class GpencilExporterPDF : public GpencilExporter {
public:
GpencilExporterPDF(const char *filename, const struct GpencilIOParams *iparams);
bool new_document();
bool add_newpage();
bool add_body();
bool write();
protected:
private:
/** PDF document. */
HPDF_Doc pdf_;
/** PDF page. */
HPDF_Page page_;
/** Create PDF document. */
bool create_document();
/** Add page. */
bool add_page();
/** Main layer loop. */
void export_gpencil_layers();
/**
* Export a stroke using poly-line or polygon
* \param do_fill: True if the stroke is only fill
*/
void export_stroke_to_polyline(
bGPDlayer *gpl, bGPDstroke *gps, bool is_stroke, bool do_fill, bool normalize);
/**
* Set color.
* \param do_fill: True if the stroke is only fill.
*/
void color_set(bGPDlayer *gpl, bool do_fill);
};
} // namespace blender::io::gpencil
|