Files
PDFPatcher/JBig2/include/jbig2_image.h
T
Calcitem 6fb0adc53c 将 jbig2dec 的源码还原为原始代码
并改为使用修改工程配置的方法解决编译问题。
目的是后续升级 jbig2dec 时直接使用上游新代码覆盖即可,无需再合并代码。

jbig2dec 原始代码来源为:
https://github.com/ArtifexSoftware/jbig2dec/tree/a5b9b7cd7b9ed349964eb89883c4b22c410b3398

操作步骤:
将 jbig2dec 原始代码中所有的 .h 覆盖到 JBig2/include/ 目录;
将 .c 文件覆盖到 JBig2/src/ 目录;除了 getopt.c 和 getopt1.c 两个多出来的文件未拷贝。
覆盖后这些文件撤销了之前为解决编译问题而修改的代码。

对于 Visual Studio 的编译错误:
Error C4146 unary minus operator applied to unsigned type, result still unsigned
解决方式为,在 Visual Studio 的
jbig2 Property Pages -> Configuration Properties -> C/C++ -> Command Line -> Additional Options
增加 -w24146 来解决。
Release 和 Debug 都增加。
2022-01-14 14:24:47 +08:00

43 lines
1.5 KiB
C

/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
implied.
This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.
Refer to licensing information at http://www.artifex.com or contact
Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
CA 94945, U.S.A., +1(415)492-9861, for further information.
*/
/*
jbig2dec
*/
#ifndef _JBIG2_IMAGE_H
#define _JBIG2_IMAGE_H
typedef enum {
JBIG2_COMPOSE_OR = 0,
JBIG2_COMPOSE_AND = 1,
JBIG2_COMPOSE_XOR = 2,
JBIG2_COMPOSE_XNOR = 3,
JBIG2_COMPOSE_REPLACE = 4
} Jbig2ComposeOp;
Jbig2Image *jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height);
void jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image);
Jbig2Image *jbig2_image_reference(Jbig2Ctx *ctx, Jbig2Image *image);
void jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image);
void jbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value);
Jbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image, uint32_t width, uint32_t height, int value);
int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op);
int jbig2_image_get_pixel(Jbig2Image *image, int x, int y);
void jbig2_image_set_pixel(Jbig2Image *image, int x, int y, bool value);
#endif /* _JBIG2_IMAGE_H */