| 1 |
/* Copyright (C) 2019-2023 Artifex Software, Inc. |
| 2 |
All Rights Reserved. |
| 3 |
|
| 4 |
This software is provided AS-IS with no warranty, either express or |
| 5 |
implied. |
| 6 |
|
| 7 |
This software is distributed under license and may not be copied, |
| 8 |
modified or distributed except as expressly authorized under the terms |
| 9 |
of the license contained in the file LICENSE in this distribution. |
| 10 |
|
| 11 |
Refer to licensing information at http://www.artifex.com or contact |
| 12 |
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, |
| 13 |
CA 94129, USA, for further information. |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef PDF_TRANSPARENCY_OPERATORS |
| 17 |
#define PDF_TRANSPARENCY_OPERATORS |
| 18 |
|
| 19 |
/* these names are to match the PS code (pdf_ops.ps/OPSaveDstack, setup_trans, teardown_trans) */ |
| 20 |
typedef struct { |
| 21 |
bool GroupPushed; |
| 22 |
bool ChangeBM; |
| 23 |
float saveStrokeAlpha; |
| 24 |
float saveFillAlpha; |
| 25 |
gs_blend_mode_t saveBM; |
| 26 |
} pdfi_trans_state_t; |
| 27 |
|
| 28 |
typedef enum { |
| 29 |
TRANSPARENCY_Caller_Other, |
| 30 |
TRANSPARENCY_Caller_Image, |
| 31 |
TRANSPARENCY_Caller_Stroke, |
| 32 |
TRANSPARENCY_Caller_Fill, /* Also includes EOFill */ |
| 33 |
TRANSPARENCY_Caller_FillStroke /* Also includes EOFillStroke */ |
| 34 |
} pdfi_transparency_caller_t; |
| 35 |
|
| 36 |
bool pdfi_trans_okOPcs(pdf_context* ctx); |
| 37 |
int pdfi_trans_required(pdf_context *ctx); |
| 38 |
int pdfi_trans_setup_text(pdf_context *ctx, pdfi_trans_state_t *state, bool is_show); |
| 39 |
int pdfi_trans_teardown_text(pdf_context *ctx, pdfi_trans_state_t *state); |
| 40 |
int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state, gs_rect *bbox, pdfi_transparency_caller_t caller); |
| 41 |
|
| 42 |
int pdfi_trans_teardown(pdf_context *ctx, pdfi_trans_state_t *state); |
| 43 |
|
| 44 |
int pdfi_trans_begin_simple_group(pdf_context *ctx, gs_rect *bbox, bool stroked_bbox, bool isolated, bool knockout); |
| 45 |
int pdfi_trans_begin_page_group(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *group_dict); |
| 46 |
int pdfi_trans_begin_form_group(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *form_dict); |
| 47 |
int pdfi_trans_end_group(pdf_context *ctx); |
| 48 |
int pdfi_trans_end_simple_group(pdf_context *ctx); |
| 49 |
int pdfi_trans_set_params(pdf_context *ctx); |
| 50 |
int pdfi_trans_begin_isolated_group(pdf_context *ctx, bool image_with_SMask, gs_color_space *pcs); |
| 51 |
int pdfi_trans_end_isolated_group(pdf_context *ctx); |
| 52 |
int pdfi_trans_end_smask_notify(pdf_context *ctx); |
| 53 |
void pdfi_trans_set_needs_OP(pdf_context *ctx); |
| 54 |
|
| 55 |
#endif |