PDF-Device

MuPDF库中的fz_device结构定义了一种接口,用于处理不同类型的设备,如调试设备、绘图设备、列表设备、文本设备和bbox设备等。这些设备处理PDF、XPS等格式的页面解释,并执行相应的操作,如渲染、文本提取、边界框计算等。此外,接口还包含了设备标志、混合模式和容器堆栈等特性,支持设备的创建、关闭和引用计数管理。
摘要由CSDN通过智能技术生成

#ifndef MUPDF_FITZ_DEVICE_H
#define MUPDF_FITZ_DEVICE_H

#include “mupdf/fitz/system.h”
#include “mupdf/fitz/context.h”
#include “mupdf/fitz/geometry.h”
#include “mupdf/fitz/image.h”
#include “mupdf/fitz/shade.h”
#include “mupdf/fitz/path.h”
#include “mupdf/fitz/text.h”

/**
The different format handlers (pdf, xps etc) interpret pages to
a device. These devices can then process the stream of calls
they receive in various ways:
The trace device outputs debugging information for the calls.
The draw device will render them.
The list device stores them in a list to play back later.
The text device performs text extraction and searching.
The bbox device calculates the bounding box for the page.
Other devices can (and will) be written in the future.

不同的格式处理程序(pdf、xps 等)将页面解释为
 一个装置。 然后这些设备可以处理呼叫流
他们以各种方式获得:
跟踪设备输出调用的调试信息。
绘图设备将呈现它们。
列表设备将它们存储在列表中以供稍后播放。
文本设备执行文本提取和搜索。
bbox 设备计算页面的边界框。
其他设备可以(并且将会)在未来被写入。

*/
typedef struct fz_device fz_device;

enum
{
/* Flags /
FZ_DEVFLAG_MASK = 1,
FZ_DEVFLAG_COLOR = 2,
FZ_DEVFLAG_UNCACHEABLE = 4,
FZ_DEVFLAG_FILLCOLOR_UNDEFINED = 8,
FZ_DEVFLAG_STROKECOLOR_UNDEFINED = 16,
FZ_DEVFLAG_STARTCAP_UNDEFINED = 32,
FZ_DEVFLAG_DASHCAP_UNDEFINED = 64,
FZ_DEVFLAG_ENDCAP_UNDEFINED = 128,
FZ_DEVFLAG_LINEJOIN_UNDEFINED = 256,
FZ_DEVFLAG_MITERLIMIT_UNDEFINED = 512,
FZ_DEVFLAG_LINEWIDTH_UNDEFINED = 1024,
/
Arguably we should have a bit for the dash pattern itself
* being undefined, but that causes problems; do we assume that
* it should always be set to non-dashing at the start of every
* glyph?
可以说,我们应该对破折号模式本身有所了解
未定义,但这会导致问题; 我们是否假设
它应该始终在每个开始时设置为非破折号
字形?
*/
FZ_DEVFLAG_BBOX_DEFINED = 2048,
FZ_DEVFLAG_GRIDFIT_AS_TILED = 4096,
};

enum
{
/* PDF 1.4 – standard separable */
FZ_BLEND_NORMAL,
FZ_BLEND_MULTIPLY,
FZ_BLEND_SCREEN,
FZ_BLEND_OVERLAY,
FZ_BLEND_DARKEN,
FZ_BLEND_LIGHTEN,
FZ_BLEND_COLOR_DODGE,
FZ_BLEND_COLOR_BURN,
FZ_BLEND_HARD_LIGHT,
FZ_BLEND_SOFT_LIGHT,
FZ_BLEND_DIFFERENCE,
FZ_BLEND_EXCLUSION,

/* PDF 1.4 -- standard non-separable */
FZ_BLEND_HUE,
FZ_BLEND_SATURATION,
FZ_BLEND_COLOR,
FZ_BLEND_LUMINOSITY,

/* For packing purposes */
FZ_BLEND_MODEMASK = 15,
FZ_BLEND_ISOLATED = 16,
FZ_BLEND_KNOCKOUT = 32

};

/**
Map from (case sensitive) blend mode string to enumeration.
从(区分大小写)混合模式字符串映射到枚举。
*/
int fz_lookup_blendmode(const char *name);

/**
Map from enumeration to blend mode string.

The string is static, with arbitrary lifespan.
从枚举映射到混合模式字符串。
字符串是静态的,具有任意寿命。

*/
const char *fz_blendmode_name(int blendmode);

/**
The device structure is public to allow devices to be
implemented outside of fitz.

Device methods should always be called using e.g.
fz_fill_path(ctx, dev, ...) rather than
dev->fill_path(ctx, dev, ...)
设备结构是公共的,以允许设备
在 fitz 之外实施。

应始终使用例如调用设备方法
fz_fill_path(ctx, dev, ...) 而不是
dev->fill_path(ctx, dev, ...)

*/

/**
Devices can keep track of containers (clips/masks/groups/tiles)
as they go to save callers having to do it.
设备可以跟踪容器(剪辑/蒙版/组/瓷砖)
因为他们去节省呼叫者必须这样做。
*/
typedef struct
{
fz_rect scissor;
int type;
int user;
} fz_device_container_stack;

enum
{
fz_device_container_stack_is_clip,
fz_device_container_stack_is_mask,
fz_device_container_stack_is_group,
fz_device_container_stack_is_tile,
};

struct fz_device
{
int refs;
int hints;
int flags;

void (*close_device)(fz_context *, fz_device *);
void (*drop_device)(fz_context *, fz_device *);

void (*fill_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix, fz_colorspace *, const float *color, float alpha, fz_color_params );
void (*stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix, fz_colorspace *, const float *color, float alpha, fz_color_params );
void (*clip_path)(fz_context *, fz_device *, const fz_path *, int even_odd, fz_matrix, fz_rect scissor);
void (*clip_stroke_path)(fz_context *, fz_device *, const fz_path *, const fz_stroke_state *, fz_matrix, fz_rect scissor);

void (*fill_text)(fz_context *, fz_device *, const fz_text *, fz_matrix, fz_colorspace *, const float *color, float alpha, fz_color_params );
void (*stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix, fz_colorspace *, const float *color, float alpha, fz_color_params );
void (*clip_text)(fz_context *, fz_device *, const fz_text *, fz_matrix, fz_rect scissor);
void (*clip_stroke_text)(fz_context *, fz_device *, const fz_text *, const fz_stroke_state *, fz_matrix, fz_rect scissor);
void (*ignore_text)(fz_context *, fz_device *, const fz_text *, fz_matrix );

void (*fill_shade)(fz_context *, fz_device *, fz_shade *shd, fz_matrix ctm, float alpha, fz_color_params color_params);
void (*fill_image)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, float alpha, fz_color_params color_params);
void (*fill_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_colorspace *, const float *color, float alpha, fz_color_params color_params);
void (*clip_image_mask)(fz_context *, fz_device *, fz_image *img, fz_matrix ctm, fz_rect scissor);

void (*pop_clip)(fz_context *, fz_device *);

void (*begin_mask)(fz_context *, fz_device *, fz_rect area, int luminosity, fz_colorspace *, const float *bc, fz_color_params );
void (*end_mask)(fz_context *, fz_device *);
void (*begin_group)(fz_context *, fz_device *, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void (*end_group)(fz_context *, fz_device *);

int (*begin_tile)(fz_context *, fz_device *, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void (*end_tile)(fz_context *, fz_device *);

void (*render_flags)(fz_context *, fz_device *, int set, int clear);
void (*set_default_colorspaces)(fz_context *, fz_device *, fz_default_colorspaces *);

void (*begin_layer)(fz_context *, fz_device *, const char *layer_name);
void (*end_layer)(fz_context *, fz_device *);

fz_rect d1_rect;

int container_len;
int container_cap;
fz_device_container_stack *container;

};

/**
Device calls; graphics primitives and containers.
设备调用; 图形原语和容器
*/
void fz_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params);
void fz_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params);
void fz_clip_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor);
void fz_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params);
void fz_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params);
void fz_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor);
void fz_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor);
void fz_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matrix ctm);
void fz_pop_clip(fz_context *ctx, fz_device *dev);
void fz_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, fz_color_params color_params);
void fz_fill_image(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, fz_color_params color_params);
void fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params);
void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor);
void fz_begin_mask(fz_context *ctx, fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, fz_color_params color_params);
void fz_end_mask(fz_context *ctx, fz_device *dev);
void fz_begin_group(fz_context *ctx, fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void fz_end_group(fz_context *ctx, fz_device *dev);
void fz_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
int fz_begin_tile_id(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id);
void fz_end_tile(fz_context *ctx, fz_device *dev);
void fz_render_flags(fz_context *ctx, fz_device *dev, int set, int clear);
void fz_set_default_colorspaces(fz_context *ctx, fz_device *dev, fz_default_colorspaces *default_cs);
void fz_begin_layer(fz_context *ctx, fz_device *dev, const char *layer_name);
void fz_end_layer(fz_context *ctx, fz_device *dev);

/**
Devices are created by calls to device implementations, for
instance: foo_new_device(). These will be implemented by calling
fz_new_derived_device(ctx, foo_device) where foo_device is a
structure “derived from” fz_device, for instance
typedef struct { fz_device base; …extras…} foo_device;

设备是通过调用设备实现创建的,用于
实例:foo_new_device()。 这些将通过调用来实现
fz_new_derived_device(ctx, foo_device) 其中 foo_device 是
结构“派生自”fz_device,例如
typedef struct { fz_device base; ...额外...} foo_device;

*/
fz_device *fz_new_device_of_size(fz_context *ctx, int size);
#define fz_new_derived_device(CTX, TYPE)
((TYPE *)Memento_label(fz_new_device_of_size(ctx,sizeof(TYPE)),#TYPE))

/**
Signal the end of input, and flush any buffered output.
This is NOT called implicitly on fz_drop_device. This
may throw exceptions.
发出输入结束信号,并刷新所有缓冲输出。
这不会在 fz_drop_device 上隐式调用。 这
可能会抛出异常。
*/
void fz_close_device(fz_context *ctx, fz_device *dev);

/**
Reduce the reference count on a device. When the reference count
reaches zero, the device and its resources will be freed.
Don’t forget to call fz_close_device before dropping the device,
or you may get incomplete output!

Never throws exceptions.
减少设备上的引用计数。 当引用计数
达到零,设备及其资源将被释放。
不要忘记在删除设备之前调用 fz_close_device,
否则您可能会得到不完整的输出!

从不抛出异常。
*/
void fz_drop_device(fz_context *ctx, fz_device *dev);

/**
Increment the reference count for a device. Returns the same
pointer.

Never throws exceptions.
增加设备的引用计数。 返回相同
指针。

从不抛出异常。

*/
fz_device *fz_keep_device(fz_context *ctx, fz_device *dev);

/**
Enable (set) hint bits within the hint bitfield for a device.
在设备的提示位域中启用(设置)提示位。
*/
void fz_enable_device_hints(fz_context *ctx, fz_device *dev, int hints);

/**
Disable (clear) hint bits within the hint bitfield for a device.
禁用(清除)设备提示位域中的提示位。
*/
void fz_disable_device_hints(fz_context *ctx, fz_device *dev, int hints);

/**
Find current scissor region as tracked by the device.
查找设备跟踪的当前剪刀区域。
*/
fz_rect fz_device_current_scissor(fz_context *ctx, fz_device *dev);

enum
{
/* Hints */
FZ_DONT_INTERPOLATE_IMAGES = 1,
FZ_NO_CACHE = 2,
};

/**
Cookie support - simple communication channel between app/library.
Cookie 支持 - 应用程序/库之间的简单通信通道。
*/

/**
Provide two-way communication between application and library.
Intended for multi-threaded applications where one thread is
rendering pages and another thread wants to read progress
feedback or abort a job that takes a long time to finish. The
communication is unsynchronized without locking.

abort: The application should set this field to 0 before
calling fz_run_page to render a page. At any point when the
page is being rendered the application my set this field to 1
which will cause the rendering to finish soon. This field is
checked periodically when the page is rendered, but exactly
when is not known, therefore there is no upper bound on
exactly when the rendering will abort. If the application
did not provide a set of locks to fz_new_context, it must also
await the completion of fz_run_page before issuing another
call to fz_run_page. Note that once the application has set
this field to 1 after it called fz_run_page it may not change
the value again.

progress: Communicates rendering progress back to the
application and is read only. Increments as a page is being
rendered. The value starts out at 0 and is limited to less
than or equal to progress_max, unless progress_max is -1.

progress_max: Communicates the known upper bound of rendering
back to the application and is read only. The maximum value
that the progress field may take. If there is no known upper
bound on how long the rendering may take this value is -1 and
progress is not limited. Note that the value of progress_max
may change from -1 to a positive value once an upper bound is
known, so take this into consideration when comparing the
value of progress to that of progress_max.

errors: count of errors during current rendering.

incomplete: Initially should be set to 0. Will be set to
non-zero if a TRYLATER error is thrown during rendering.

提供应用程序和库之间的双向通信。
适用于一个线程的多线程应用程序
渲染页面和另一个线程想要读取进度
反馈或中止需要很长时间才能完成的工作。这
通信是不同步的,没有锁定。

abort:应用程序应在此之前将此字段设置为 0
调用 fz_run_page 来呈现页面。在任何时候当
页面正在呈现应用程序我将此字段设置为 1
这将导致渲染很快完成。这个字段是
页面呈现时定期检查,但准确
何时未知,因此没有上限
渲染将中止的确切时间。如果申请
没有为 fz_new_context 提供一组锁,它也必须
在发出另一个之前等待 fz_run_page 完成
调用 fz_run_page。请注意,一旦应用程序设置
此字段在调用 fz_run_page 后变为 1 它可能不会改变
再次值。

进度:将渲染进度传达回
应用程序并且是只读的。随着页面的增加
呈现。该值从 0 开始并限制为小于
大于或等于progress_max,除非progress_max 为-1。
progress_max:传达已知的渲染上限
返回到应用程序并且是只读的。最大值
进度字段可能需要。如果没有已知的上
渲染可能需要多长时间的界限是 -1 和
进步不受限制。注意progress_max的值
一旦上限为,可能会从 -1 变为正值
已知,因此在比较时要考虑到这一点
 progress 的值到progress_max 的值。

错误:当前渲染期间的错误计数。

不完整:最初应设置为 0。将设置为
如果在渲染期间抛出 TRYLATER 错误,则非零。

/
typedef struct
{
int abort;
int progress;
size_t progress_max; /
(size_t)-1 for unknown */
int errors;
int incomplete;
} fz_cookie;

/**
Create a device to print a debug trace of all device calls.
创建一个设备来打印所有设备调用的调试跟踪。
*/
fz_device *fz_new_trace_device(fz_context *ctx, fz_output *out);

/**
Create a device to output raw information.
创建一个设备来输出原始信息。
*/
fz_device *fz_new_xmltext_device(fz_context *ctx, fz_output *out);

/**
Create a device to compute the bounding
box of all marks on a page.

The returned bounding box will be the union of all bounding
boxes of all objects on a page.

创建一个设备来计算边界页面上所有标记的框。
返回的边界框将是所有边界的并集
页面上所有对象的框。

*/
fz_device *fz_new_bbox_device(fz_context *ctx, fz_rect *rectp);

/**
Create a device to test for features.

Currently only tests for the presence of non-grayscale colors.

is_color: Possible values returned:
	0: Definitely greyscale
	1: Probably color (all colors were grey, but there
	were images or shadings in a non grey colorspace).
	2: Definitely color

threshold: The difference from grayscale that will be tolerated.
Typical values to use are either 0 (be exact) and 0.02 (allow an
imperceptible amount of slop).

options: A set of bitfield options, from the FZ_TEST_OPT set.

passthrough: A device to pass all calls through to, or NULL.
If set, then the test device can both test and pass through to
an underlying device (like, say, the display list device). This
means that a display list can be created and at the end we'll
know if it's colored or not.

In the absence of a passthrough device, the device will throw
an exception to stop page interpretation when color is found.

创建一个设备来测试功能。
目前只测试非灰度颜色的存在。

is_color:返回的可能值:
0:绝对灰度
1:可能是颜色(所有颜色都是灰色,但有
是非灰色色彩空间中的图像或阴影)。
2:绝对颜色

阈值:与灰度的差异将被容忍。
使用的典型值是 0(准确)和 0.02(允许
难以察觉的溢出量)。

选项:一组位域选项,来自 FZ_TEST_OPT 集。

passthrough:将所有调用传递到的设备,或 NULL。
如果设置,则测试设备既可以测试也可以通过
底层设备(例如,显示列表设备)。 这
意味着可以创建一个显示列表,最后我们将
知道它是否有颜色。

在没有直通设备的情况下,设备会抛出
找到颜色时停止页面解释的异常。

*/
fz_device *fz_new_test_device(fz_context *ctx, int *is_color, float threshold, int options, fz_device *passthrough);

enum
{
/* If set, test every pixel of images exhaustively.
* If clear, just look at colorspaces for images.
如果设置,则彻底测试图像的每个像素。 如果清晰,只需查看图像的色彩空间。
*/
FZ_TEST_OPT_IMAGES = 1,

/* If set, test every pixel of shadings. */
/* If clear, just look at colorspaces for shadings.
如果设置,则测试阴影的每个像素。
如果清楚,只需查看颜色空间的阴影。
*/
FZ_TEST_OPT_SHADINGS = 2

};

/**
Create a device to draw on a pixmap.

dest: Target pixmap for the draw device. See fz_new_pixmap*
for how to obtain a pixmap. The pixmap is not cleared by the
draw device, see fz_clear_pixmap* for how to clear it prior to
calling fz_new_draw_device. Free the device by calling
fz_drop_device.

transform: Transform from user space in points to device space
in pixels.
创建一个设备以在像素图上绘制。
dest:绘图设备的目标像素图。 见 fz_new_pixmap*
关于如何获取像素图。 像素图未被清除
绘制设备,请参阅 fz_clear_pixmap* 以了解如何在之前清除它
调用 fz_new_draw_device。 通过调用释放设备
fz_drop_device。
转换:从用户空间以点为单位转换到设备空间
以像素为单位。

*/
fz_device *fz_new_draw_device(fz_context *ctx, fz_matrix transform, fz_pixmap *dest);

/**
Create a device to draw on a pixmap.

dest: Target pixmap for the draw device. See fz_new_pixmap*
for how to obtain a pixmap. The pixmap is not cleared by the
draw device, see fz_clear_pixmap* for how to clear it prior to
calling fz_new_draw_device. Free the device by calling
fz_drop_device.

transform: Transform from user space in points to device space
in pixels.

clip: Bounding box to restrict any marking operations of the
draw device.
创建一个设备以在像素图上绘制。
dest:绘图设备的目标像素图。 见 fz_new_pixmap*
关于如何获取像素图。 像素图未被清除
绘制设备,请参阅 fz_clear_pixmap* 以了解如何在之前清除它
调用 fz_new_draw_device。 通过调用释放设备
fz_drop_device。

转换:从用户空间以点为单位转换到设备空间
以像素为单位。

剪辑:限制任何标记操作的边界框
绘制装置。

*/
fz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip);

/**
Create a device to draw on a pixmap.

dest: Target pixmap for the draw device. See fz_new_pixmap*
for how to obtain a pixmap. The pixmap is not cleared by the
draw device, see fz_clear_pixmap* for how to clear it prior to
calling fz_new_draw_device. Free the device by calling
fz_drop_device.

transform: Transform from user space in points to device space
in pixels.

proof_cs: Intermediate color space to map though when mapping to
color space defined by pixmap.

创建一个设备以在像素图上绘制。
dest:绘图设备的目标像素图。 见 fz_new_pixmap*
关于如何获取像素图。 像素图未被清除
绘制设备,请参阅 fz_clear_pixmap* 以了解如何在之前清除它
调用 fz_new_draw_device。 通过调用释放设备
fz_drop_device。

转换:从用户空间以点为单位转换到设备空间
以像素为单位。

proof_cs:映射到的中间颜色空间
由像素图定义的颜色空间。

*/
fz_device *fz_new_draw_device_with_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, fz_colorspace *proof_cs);

/**
Create a device to draw on a pixmap.

dest: Target pixmap for the draw device. See fz_new_pixmap*
for how to obtain a pixmap. The pixmap is not cleared by the
draw device, see fz_clear_pixmap* for how to clear it prior to
calling fz_new_draw_device. Free the device by calling
fz_drop_device.

transform: Transform from user space in points to device space
in pixels.

clip: Bounding box to restrict any marking operations of the
draw device.

proof_cs: Color space to render to prior to mapping to color
space defined by pixmap.

创建一个设备以在像素图上绘制。

dest:绘图设备的目标像素图。 见 fz_new_pixmap*
关于如何获取像素图。 像素图未被清除
绘制设备,请参阅 fz_clear_pixmap* 以了解如何在之前清除它
调用 fz_new_draw_device。 通过调用释放设备
fz_drop_device。

转换:从用户空间以点为单位转换到设备空间
以像素为单位。

剪辑:限制任何标记操作的边界框
绘制装置。

proof_cs:在映射到颜色之前要渲染的颜色空间
由像素图定义的空间。

*/
fz_device *fz_new_draw_device_with_bbox_proof(fz_context *ctx, fz_matrix transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs);

fz_device *fz_new_draw_device_type3(fz_context *ctx, fz_matrix transform, fz_pixmap *dest);

/**
struct fz_draw_options: Options for creating a pixmap and draw
device.
struct fz_draw_options:用于创建像素图和绘制的选项设备。
*/
typedef struct
{
int rotate;
int x_resolution;
int y_resolution;
int width;
int height;
fz_colorspace *colorspace;
int alpha;
int graphics;
int text;
} fz_draw_options;

extern const char *fz_draw_options_usage;

/**
Parse draw device options from a comma separated key-value string.
从逗号分隔的键值字符串中解析绘制设备选项。
*/
fz_draw_options *fz_parse_draw_options(fz_context *ctx, fz_draw_options *options, const char *string);

/**
Create a new pixmap and draw device, using the specified options.

options: Options to configure the draw device, and choose the
resolution and colorspace.

mediabox: The bounds of the page in points.

pixmap: An out parameter containing the newly created pixmap.
使用指定的选项创建一个新的像素图和绘图设备。

 选项:配置绘图设备的选项,并选择
 分辨率和色彩空间。

  mediabox:页面的边界,以磅为单位。

  像素图:包含新创建的像素图的输出参数。

*/
fz_device *fz_new_draw_device_with_options(fz_context *ctx, const fz_draw_options *options, fz_rect mediabox, fz_pixmap **pixmap);

#endif

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值