Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/source/fitz/glyph-imp.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 // Copyright (C) 2004-2025 Artifex Software, Inc. | |
| 2 // | |
| 3 // This file is part of MuPDF. | |
| 4 // | |
| 5 // MuPDF is free software: you can redistribute it and/or modify it under the | |
| 6 // terms of the GNU Affero General Public License as published by the Free | |
| 7 // Software Foundation, either version 3 of the License, or (at your option) | |
| 8 // any later version. | |
| 9 // | |
| 10 // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY | |
| 11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| 12 // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | |
| 13 // details. | |
| 14 // | |
| 15 // You should have received a copy of the GNU Affero General Public License | |
| 16 // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html> | |
| 17 // | |
| 18 // Alternative licensing terms are available from the licensor. | |
| 19 // For commercial licensing, see <https://www.artifex.com/> or contact | |
| 20 // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, | |
| 21 // CA 94129, USA, for further information. | |
| 22 | |
| 23 #ifndef FITZ_GLYPH_IMP_H | |
| 24 #define FITZ_GLYPH_IMP_H | |
| 25 | |
| 26 | |
| 27 /* | |
| 28 Glyphs represent a run length encoded set of pixels for a 2 | |
| 29 dimensional region of a plane. | |
| 30 | |
| 31 x, y: The minimum x and y coord of the region in pixels. | |
| 32 | |
| 33 w, h: The width and height of the region in pixels. | |
| 34 | |
| 35 samples: The sample data. The sample data is in a compressed | |
| 36 format designed to give reasonable compression, and to be fast | |
| 37 to plot from. | |
| 38 | |
| 39 The first sizeof(int) * h bytes of the table, when interpreted | |
| 40 as ints gives the offset within the data block of that lines | |
| 41 data. An offset of 0 indicates that that line is completely | |
| 42 blank. | |
| 43 | |
| 44 The data for individual lines is a sequence of bytes: | |
| 45 00000000 = end of lines data | |
| 46 LLLLLL00 = extend the length given in the next run by the 6 L | |
| 47 bits given here. | |
| 48 LLLLLL01 = A run of length L+1 transparent pixels. | |
| 49 LLLLLE10 = A run of length L+1 solid pixels. If E then this is | |
| 50 the last run on this line. | |
| 51 LLLLLE11 = A run of length L+1 intermediate pixels followed by | |
| 52 L+1 bytes of literal pixel data. If E then this is the | |
| 53 last run on this line. | |
| 54 */ | |
| 55 struct fz_glyph | |
| 56 { | |
| 57 fz_storable storable; | |
| 58 int x, y, w, h; | |
| 59 fz_pixmap *pixmap; | |
| 60 size_t size; | |
| 61 unsigned char data[FZ_FLEXIBLE_ARRAY]; | |
| 62 }; | |
| 63 | |
| 64 /* | |
| 65 Create a new glyph from a pixmap | |
| 66 | |
| 67 Returns a pointer to the new glyph. Throws exception on failure | |
| 68 to allocate. | |
| 69 */ | |
| 70 fz_glyph *fz_new_glyph_from_pixmap(fz_context *ctx, fz_pixmap *pix); | |
| 71 | |
| 72 /* | |
| 73 Create a new glyph from 8bpp data | |
| 74 | |
| 75 x, y: X and Y position for the glyph | |
| 76 | |
| 77 w, h: Width and Height for the glyph | |
| 78 | |
| 79 sp: Source Pointer to data | |
| 80 | |
| 81 span: Increment from line to line of data | |
| 82 | |
| 83 Returns a pointer to the new glyph. Throws exception on failure | |
| 84 to allocate. | |
| 85 */ | |
| 86 fz_glyph *fz_new_glyph_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span); | |
| 87 | |
| 88 /* | |
| 89 Create a new glyph from 1bpp data | |
| 90 | |
| 91 x, y: X and Y position for the glyph | |
| 92 | |
| 93 w, h: Width and Height for the glyph | |
| 94 | |
| 95 sp: Source Pointer to data | |
| 96 | |
| 97 span: Increment from line to line of data | |
| 98 | |
| 99 Returns a pointer to the new glyph. Throws exception on failure | |
| 100 to allocate. | |
| 101 */ | |
| 102 fz_glyph *fz_new_glyph_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span); | |
| 103 | |
| 104 fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm); | |
| 105 fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); | |
| 106 fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); | |
| 107 fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa); | |
| 108 fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model, const fz_irect *scissor, int aa); | |
| 109 fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, const fz_stroke_state *state, int aa); | |
| 110 fz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int gid, fz_matrix *, fz_colorspace *model, const fz_irect *scissor, int alpha, int aa); | |
| 111 fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_matrix, fz_colorspace *model, const fz_stroke_state *stroke, const fz_irect *scissor, int aa); | |
| 112 | |
| 113 #endif |
