PDF-pixmap

#ifndef MUPDF_FITZ_PIXMAP_H
#define MUPDF_FITZ_PIXMAP_H

#include “mupdf/fitz/system.h”
#include “mupdf/fitz/context.h”
#include “mupdf/fitz/geometry.h”
#include “mupdf/fitz/store.h”
#include “mupdf/fitz/separation.h”

/**
Pixmaps represent a set of pixels for a 2 dimensional region of
a plane. Each pixel has n components per pixel. The components
are in the order process-components, spot-colors, alpha, where
there can be 0 of any of those types. The data is in
premultiplied alpha when rendering, but non-premultiplied for
colorspace conversions and rescaling.
像素图表示二维区域的一组像素
一架飞机。 每个像素每个像素有 n 个分量。 组件
顺序是流程组件、专色、alpha,其中
这些类型中的任何一种都可以是 0。 数据在
渲染时预乘 alpha,但未预乘
色彩空间转换和重新缩放。
*/

typedef struct fz_overprint fz_overprint;

/**
Return the bounding box for a pixmap.
返回像素图的边界框。
*/
fz_irect fz_pixmap_bbox(fz_context *ctx, const fz_pixmap *pix);

/**
Return the width of the pixmap in pixels.
以像素为单位返回像素图的宽度。
*/
int fz_pixmap_width(fz_context *ctx, const fz_pixmap *pix);

/**
Return the height of the pixmap in pixels.
以像素为单位返回像素图的高度。
*/
int fz_pixmap_height(fz_context *ctx, const fz_pixmap *pix);

/**
Return the x value of the pixmap in pixels.
以像素为单位返回像素图的 x 值。
*/
int fz_pixmap_x(fz_context *ctx, const fz_pixmap *pix);

/**
Return the y value of the pixmap in pixels.
以像素为单位返回像素图的 y 值。
*/
int fz_pixmap_y(fz_context *ctx, const fz_pixmap *pix);

/**
Create a new pixmap, with its origin at (0,0)

cs: The colorspace to use for the pixmap, or NULL for an alpha
plane/mask.

w: The width of the pixmap (in pixels)

h: The height of the pixmap (in pixels)

seps: Details of separations.

alpha: 0 for no alpha, 1 for alpha.

Returns a pointer to the new pixmap. Throws exception on failure
to allocate.

创建一个新的像素图,其原点为 (0,0)

cs:用于像素图的色彩空间,或 NULL 用于 alpha
飞机/面具。

w:像素图的宽度(以像素为单位)

h:像素图的高度(以像素为单位)

seps:分离细节。

alpha:0 表示没有 alpha,1 表示 alpha。

返回指向新像素图的指针。 失败时抛出异常
分配。

*/
fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h, fz_separations *seps, int alpha);

/**
Create a pixmap of a given size, location and pixel format.

The bounding box specifies the size of the created pixmap and
where it will be located. The colorspace determines the number
of components per pixel. Alpha is always present. Pixmaps are
reference counted, so drop references using fz_drop_pixmap.

colorspace: Colorspace format used for the created pixmap. The
pixmap will keep a reference to the colorspace.

bbox: Bounding box specifying location/size of created pixmap.

seps: Details of separations.

alpha: 0 for no alpha, 1 for alpha.

Returns a pointer to the new pixmap. Throws exception on failure
to allocate.

创建给定大小、位置和像素格式的像素图。

边界框指定创建的像素图的大小和
它将位于何处。 色彩空间决定数量
每个像素的组件数。 阿尔法永远存在。 像素图是
引用计数,因此使用 fz_drop_pixmap 删除引用。

颜色空间:用于创建的像素图的颜色空间格式。 这
pixmap 将保留对颜色空间的引用。

bbox:指定创建像素图的位置/大小的边界框。

seps:分离细节。

alpha:0 表示没有 alpha,1 表示 alpha。

返回指向新像素图的指针。 失败时抛出异常
分配。

*/
fz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, fz_irect bbox, fz_separations *seps, int alpha);

/**
Create a new pixmap, with its origin at
(0,0) using the supplied data block.

cs: The colorspace to use for the pixmap, or NULL for an alpha
plane/mask.

w: The width of the 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值