2 ptouch-print - Print labels with images or text on a Brother P-Touch
4 Copyright (C) 2015-2017 Dominic Radermacher <blip@mockmoon-cybernetics.ch>
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License version 3 as
8 published by the Free Software Foundation
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
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 Foundation,
17 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <libusb-1.0/libusb.h>
23 struct _pt_tape_info {
24 uint8_t mm; /* Tape width in mm */
25 uint8_t px; /* Printing area in px */
29 #define FLAG_UNSUP_RASTER 1
30 #define FLAG_FORCE_TIFF 2
33 int vid; /* USB vendor ID */
34 int pid; /* USB product ID */
36 int max_px; /* Maximum pixel width that can be printed */
39 typedef struct _pt_dev_info *pt_dev_info;
42 libusb_device_handle *h;
44 uint8_t tape_width_mm;
45 uint8_t tape_width_px;
50 typedef struct _ptouch_dev *ptouch_dev;
52 int ptouch_open(ptouch_dev *ptdev);
53 int ptouch_close(ptouch_dev ptdev);
54 int ptouch_send(ptouch_dev ptdev, uint8_t *data, int len);
55 int ptouch_init(ptouch_dev ptdev);
56 int ptouch_lf(ptouch_dev ptdev);
57 int ptouch_ff(ptouch_dev ptdev);
58 int ptouch_cutmark(ptouch_dev ptdev);
59 int ptouch_eject(ptouch_dev ptdev);
60 int ptouch_getstatus(ptouch_dev ptdev);
61 int ptouch_getmaxwidth(ptouch_dev ptdev);
62 int ptouch_rasterstart(ptouch_dev ptdev);
63 int ptouch_sendraster(ptouch_dev ptdev, uint8_t *data, int len);