summaryrefslogtreecommitdiff
path: root/platform/java
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2017-03-14 18:37:25 +0000
committerRobin Watts <robin.watts@artifex.com>2017-06-22 14:59:43 +0100
commitdd58ea5e2ff7e6b61cc5a5b6fd950fb62e92b8be (patch)
treeb22a2dddaae41961f74a88cfafc52a3adb24e263 /platform/java
parent5ab2a7dad585400caef7703e0761264bb03e81b0 (diff)
downloadmupdf-dd58ea5e2ff7e6b61cc5a5b6fd950fb62e92b8be.tar.xz
Add Color Management interface to MuPDF, with LCMS implementation.
This commit adds an interface for a color management engine to MuPDF, together with the internal changes required to use it. We also add an implementation of this interface using the LCMS2 library. This commit is the "lcms" development branch squashed to a single commit. The individual commits that make it up are as follows: ------ Add LCMS2 submodule. Add required source files to MSVC libthirdparty project. Plus changes to the Makefile. ------ Change name of libfont to libresources The library can hold things other than fonts including ICC profiles and eventually halftone screens etc. ------ Generate and include icc profiles on windows solution Makefile for linux needs to be updated ------ Initial cut at interface to little cms Methods for getting profile handles, link handles and transform buffers as well as individual colors. ------ Install ICC profiles from source When the source color space is an ICC profile install the ICC space. Use alternative color space if ICC is invalid. ------ Rename ICC resources The way that fontdump generates the names was causing some redundant prefix/suffix combinations. ------ Make resource ICC profiles usable This brings in the resource profiles for use with the target device. When mudraw is invoked with the icc color type, it will set up the target pixmap to have an icc based color space. ------ Make Default ICC color spaces not storable The ICC color spaces in the color context should not be put into the store. ICC color spaces that are contained in the source document are however storable. ------ Add in support for single color conversion This adds in the selection of the icc single color converter. Note that we may want to look at using the float conversion in lcms here since we are going from and to float. The down side is that the creation of such converters may be expensive. ------ Pixmap ICC conversion Also clean up and further simplify some of the code. Use common dst, src in function parameters instead of src, dst. ------ Add md5 calculation for profiles Compare md5 of source and destination. If they are the same set link as identity and do not bother creating link from cmm. ------ Initial attempt at adding links to store Next need to make sure I have all the dropping set up correctly and that the links are getting freed when we are all done with them. ------ Add drop for link Make sure that we drop the links when we are done with them. ------ Fix icc link store ref. counting + rendering intent The key allocations, rc and removal was wrong for the icc links. Also added in support on the graphic state for rendering intent. ------ Add ICC profiles to Makefile. ------ Move ICC profile loading to colorspace.c ------ Fix build on linux. ------ Use hexdump in creating icc profiles ------ First cut at CalRGB CalGray handling These color spaces are converted to equivalent ICC profiles when the drawing operation occurs. ToDo still is avoid creating brand new CalGray, CalRGB or ICC color spaces when we encounter the same object in the source file. Instead we should make use of the store. ------ Adding fz_color_params into device API Stroke and fill of paths and text which will have color rendering related settings including overprint, overprint mode, rendering intent and black point settings. Images have a fz_color_params member added to them. ------ Rendering intent support for graphic and text Graphic fills and strokes as well as text fill and strokes handle the rendering intent settings. This works through the display list. The parameters related to color rendering, ri, bp, op, opm are packed in the flags bits through the display list. To do: Add support for images and shadings. ------ Add support for rendering intent with images Required change to fill_image api, hence the large number of files touched. ------ Add support for shadings rendering intent and DeviceN This adds support for the rendering intent in shading fills. Also, adds in support for color management of DeviceN and Separation color spaces where the base space is defined to be ICC. ------ Add clamping proc to colorspace-imp.h In the head of mupdf, the index color values were not being clamped properly. I moved the clamping operation to be performed by a procedure in of the color space. The a*, b* values in LAB will need to include a range value for proper clamping as well as the ICC color space at some point. ------ Fix assert test with index images ------ Support for DeviceN images color managed The base space for DeviceN and separation images is now color managed when the ICC work flow is used. ------ Add DefaultGray etc to names.txt The DefaultGray, DefaultRGB, and DefaultCMYK settings in the pdf page resource dictionary need to be parsed and handled if present. ------ Remove methods for setting color space in context The methods that existed for setting the color spaces in the color space context were broken and we will not be changing them from their initial setting at startup. ------ Add front end support for default color spaces PDF can specify in the resource dictionary color spaces that should be used for DeviceGray, DeviceRGB and DeviceCMYK. This commit handles the extraction of these color spaces and passes them through the display list and gets them into a structure on a draw device (if one is used). Next step is to have the draw device make use of them. ------ Backend of default color spaces This handles the use of page level definitions for DefaultGray, DefaultRGB, DefaultCMYK in the draw device. The interface for the pixmap color conversion had to be expanded a bit to pass the default_cs object. This was needed due to the fact that the image could be DeviceN or Separation and have a base space that needs to be replaced by a page level Default color space. Tested this with a file that had two pages each with an common reference image object but different DefaultCMYK definitions in the page resource dictionary. Proper rendering was obtained. ------ Add icc support to band-writer and png output For image viewers that support icc profiles, it is important that we include the icc profile into those formats that support. Currently the only output format we have that supports it is PNG. But if we decide to do tiff, jpeg or psd those also support the embedding of icc profiles. ------ Work toward multithreading Each cloned context creates a new cmm context to reduce contention. This may not be optimal though as it may create conflicts in any shared store. ------ Add missing files. Failed to check in icc-imp.h and icc34.h ------ Fix default device color calls copy and paste errors. ------ Fixes ------ Fix clamping of lab colors The lab colors when used with the lab resource profile need to be properly clamped and scaled. ------ Turn off ICC create debug define ------ Fix memory leak issues ------ Set clamp proc in color context color spaces When NO_ICC is enabled there was an issue as the default spaces did not have the clamp proc (which was added in the lcms branch). ------ Fix several issues after rebase During rebase of the branch there were several issues that came up. In addition there was a fix related to the use of the lcms2 context branch that did not make it in for some reason. ------ Fix for fz_store_type structure changes ------ Fixes for multithreaded This fixes a few issues. One issue is that we can not be changing the input and output formatter for the links if they are being shared among threads. This adds the format as part of the link definition. Next step is to create a link clone operation in lcms so that we can readily create a different one with everything the same except the formatter. Also, this shares the profiles that exist in the color context among the threads. When a context is cloned, it will use the profiles in the current context but it will create a new cmm context.c ------ Fix NO_ICC issues There were a few issues that occurred when we compiled and ran with the NO_ICC setting. ------ Change CMM to use lower resolution tables in links The table resolution greatly affects the performance for some files. I don't see any significant color rendering issues going with a lower resolution. Selecting cmsFLAGS_LOWRESPRECALC uses a MLUT resolution of 17. This is going to be sufficient color wise and gives a large improvement performance wise especially for files where the color link creation is significant compared to the rendering. ------ Fix link key creation to populate alpha and bit depth. The store key for icc links needs to include the bit depth and if the transform has to handle an alpha value. This is needed due to the fact that we can't change the formatter when we are sharing links among different threads. ------ Pull in some MSVC 2005 fixes for lcms2 ------ Fix non-prototype prototype. ------ Miscellaneous typos, whitespace fixes. ------ Tidy colorspace creation API. Rather than pass a magic implementation reference count value (-1 for static, 1 for normal), pass a boolean "is_static" flag. This gives a nicer API (IMAO etc). ------ Make all colorspaces use an fz_buffer. ------ Fix internal naming of MSVC project file. ------ Fix some error handling. ------ Add some consts. ------ Tweak fz_color_params and fz_store_hash. Use uint8_t for fz_color_param entries - no need to use larger. Same change in fz_store_hash. This limits the size required for the hash table too. ------ Throw on errors, rather than returning NULL. fz_cmm_transform_pixmap should throw if it's fed pixmaps incompatible with its transforms. fz_cmm_new_ctx should throw if the cmm fails to initialise. ------ Ensure LCMS2_OBJs are built/linked using Makefile. Also ensure that ICC_OBJs are included. ------ Fix some unused variable warnings. ------ cs_params fixes. Use the ones that are passed. ------ fz_color_params tweaks. Make them const in many places. Cope with cs_params == NULL meaning default (i.e. fz_cs_param(ctx)). Minimise the places we call fz_cs_params(ctx). Consistently use cs_params rather than a mix of cs_param and cs_params. ------ Improve PDF color params handling. PDF allows different OP settings for strokes and fills. This means that either we need to keep separate entries in each fz_color_param structure for the stroke one or the fill one, OR we need to duplicate the fz_color_param structure. It seems neatest to do the latter (not least because this means we don't pass more information to each device function than it actually needs). Accordingly, we put an fz_color_param in each pdf_material. We update the code that reads ExtGStates to set the values appropriately. We take the opportunity to add support for the PDF 2.0 UseBlackPtComp option too. ------ Fix colorspace ref count problems. 1) Don't drop colorspace until we've finished using it. 2) Don't drop it twice. ------ Convert NULL deref into a thrown error. Seen with: mutool draw -D -o out.png ../tests_private/comparefiles/Bug689760.pdf We seem to have a pdf-cal space with no profile. Talk to Michael about this. ------ Avoid using colorspace names to distinguish colorspaces. Using strcmp is slow. ------ Cope with failure to parse default colorspaces during PDF page load. ------ Avoid SEGV due to to pdf_cal space with no profile. As seen in: tests_private/pdf/PDFIA1.7_SUBSET/CATX4879.pdf ------ Handle cases where base space of sep is pdf-cal We handled this for images, but not for solid fills. ------ Accelerate ICC color conversion. ------ Cope with indexed images in the color management. Some images (JPX images) come to the cm code still in the indexed color space. Their base space could be DevN so we need to cope with multiple base decodes. This continues the decode until we get to a space for which we can create an ICC link. ------ Ignore alpha presence in component count check ------ Eliminate recursion in fz_source_colorspace_cm. ------ Cope with bare ICCBased colorspace defs. Bug692137.pdf has ICCBased colorspaced definitions given directly as a stream, rather than as [ /ICCBased <stream reference> ] Acrobat copes with these, as does gs. We therefore update our code to cope too. Also, the PDF spec says that any problems found when reading the Default spaces should be ignored (or at least not to abort rendering). Update our code to do that too. ------ Tweak color converter logic for speed. When we are using an icc profile based conversion, avoid ever having to lookup the color converter for each conversion call; do it at the lookup stage. ------ Harden us against failures during ICC link creation. Seen with corrupted profiles. ------ Fix for handling alpha with lcms. Note that this currently maintains an alpha when it is present. We may need to do some work for the gray scale conversion to alpha mask. ------ Delay pdf-cal profile creation Put the creation of the pdf cal profile into the link creation function (rather than have it scattered). Also be robust in the condition of failure to create the profile. ------ Proper clamping with embedded CIELAB ICC profile If the ICC profiles alternate color space is LAB then use the LAB clamping proc. ------ Use the color space clamp when converting to base color spaces In many of the Ghent test files, we have a DeviceN image whose alternate color space is CIELAB. We need to make sure to use the CIELAB clamping operation in this case. ------ Make ICC runtime configurable. Add fz_icc_flowflow, fz_set_icc_workflow functions to read ICC workflow state, and set the ICC workflow state. The latter will throw an error if trying to enable ICC workflow in a NO_ICC build. Add -N flag to mutool to disable ICC. Incorporates build fixes from Michael. ------ Ensure fz_draw_fill_image uses the pixmap colorspace It appears that the image colorspace historically has been able to differ from the pixmap colorspace. While we've fixed the cases that we know about for this (see the previous commits), tweak fz_draw_fill_image to work the way it always has in the past. ------ Add support for output intent PDF documents can have an ICC profile defined in their Catalog which defines the output color space and the color space to use for one of the Device color spaces (e.g. DeviceGray, DeviceRGB or DeviceCMYK). ------ Catch errors in default color spaces Before setting the default color space contained in the file, make sure it is the correct type. Bug692213.pdf ------ Clamp to base space during sep color conversion This was the source of a problem when the base space was CIELAB. ------ Rename some functions to be more MuPDFy drop rather than free etc. ------ Fix "casting away const" warning. srcv is a const *. Do the clamping operation on src_map (the same value) before it is assigned into the const variable. ------ Rejig top level color management interface slightly. Same code, just change the encapsulation. ------ Remove pre-multiplied alpha prior to color management The pixmaps in mupdf use a premultiplied alpha format. Prior to doing any color management we need to undo the alpha and then reapply after color management. ------ Remove global output intent as unused. ------ Move fz_color_params to be the final arg in dev calls. Frequently this will be NULL, and it doesn't form part of the colorspace/color/alpha triple. ------ Rename fz_default_xxx static variables. Remove fz prefix, to prepare for a later renaming that would conflict. ------ Rename cs_params to color_params. ------ Rename lcms branch identifiers. ------ Return device colorspaces if the default colorspace is NULL. ------ Clean up device call function for set_default_colorspaces. ------ Add missing rethrow. ------ Load page default colorspaces lazily. ------ murun: Add color params device argument. Stubbed to always be NULL at the moment. ------ Rename extgstate processor ops. ------ Fix a few minor issues from Tor Removes icc-imp.h Rename color-icccreate.c Add context to some methods ------ Fix javalib with recent lcms dev changes. ------ Update lcms2 with sub project fixes. ------ Fix build failure. ------ Add icc profile into other PNG output methods ------ Fix some ints that should be size_t's. ------ Tweak fz_new_icc_data_from_icc_colorspace. Ensure that the colorspace is const, and that we set size to 0 if we don't find any data. ------ Combine band writer methods for header and ICC writing For many formats (like PSD), we need to delay writing some of the header until we know whether we are getting an ICC profile to write or not. Makes more sense to just write them at the same time. ------ Miscellaneous tweaks in colorspace.c Mainly to avoid pointer aliasing, "nicer" whitespace, and a leak on error. ------ Avoid rightward drift in get_base_icc. ------ Ensure that pdf_load_output_intent copes with exceptions. If load_icc_based throws and exception, warn and continue. Don't not render a file just because the inbuilt default profiles are broken. ------ Revert change in pdf-page.c The page resources load had been moved so we could get the default colorspaces, but this has been moved into run_contents, so putting stuff back as it was before. ------ Revert changes in mudraw. We had added some colorspages in mudraw, and then later removed them. Revert the changes to accomodate this to make the overall branch diffs smaller. ------ Use fz_buffer in color-icc-create.c ------ Force mapping through proof icc profile always. ------ Fix behaviour on fz_cmm_new_profile failure. If the profile fails to be made, return an error code, and have the callers take sane steps. ------ Tweak load_icc_based Cope better with errors in reading the ICC space not stopping us loading the alternate. ------ Remove unused variable. ------ Get page resource for DefaultCS look-up res = pdf_dict_get(ctx, PDF_NAME_Resources, page->obj); was not returning resource. Replaced with res = pdf_page_resources(ctx, page); ------ Move default color space set up to pdf_run_page_contents_with_usage ------ Review fixes for lcms branch. ------ Fixes for calibrated colorspace loading. ------ Add fz_document_output_intent wrapper. Lazy load intent for PDF. ------ Copy DefaultCS logic into pdf_run_annot_with_usage. Same code as from pdf_run_page_contents_with_usage. ------ More review fixes. ------ Avoid rightward drift in pdf_load_cal_common ------ Rename color_converter functions to be find/drop. Better than than lookup/discard. lookup suggests something that doesn't need dropping, and we use drop rather than discard by convention. ------ Move cmm from context into colorspace context. ------ Review fixes: Remove recursion and rename functions. ------ Don't access doc->oi directly in pdf_load_default_colorspaces. ------ Rename fz_colorspace_is_pdf_cal to fz_colorspace_is_cal and make it public. ------ Tweak function naming to be more consistent. ------ fz_md5_icc can be implemented using fz_md5_buffer. ------ Print full md5 checksums in link key debug prints. ------ Make fz_md5_buffer NULL safe. ------ Simplify debug saving of ICC profiles. ------ Rename fz_cmm_new/drop_profile to init/fin. ------ Indentation cleanups. ------ Move CMM static inline functions from private header to C file. ------ Tweak fz_icc_data_from_icc_colorspace to return a buffer. Also, remove the _new_ from the name to reflect the fact that we are passed a borrowed handle, not given a new reference. ------ java: Add ColorParams.pack() function. ------ Generate one C file for the embedded ICC profiles. ------ Return const pointer from fz_default_color_params. ------ Change misleading argument names to fz_new_colorspace. ------ Rename fz_cmm_new/drop_link to fz_cmm_init/fin_link. ------ Change definition of fz_cmm_instance. Rather than void, use an undefined struct in keeping with the rest of the code. ------ Add support for color managed bgr color space ------ Return unsigned char array from fz_lookup_icc. ------ Make default_color_params immutable. Changing the defaults used by the draw device should happen via a device call, should we need the functionality in the future. ------ Clean up error handling in color-lcms.c ------ Fix signed/unsigned warning.
Diffstat (limited to 'platform/java')
-rw-r--r--platform/java/mupdf_native.c96
-rw-r--r--platform/java/mupdf_native.h676
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/ColorParams.java51
-rw-r--r--platform/java/src/com/artifex/mupdf/fitz/NativeDevice.java17
4 files changed, 477 insertions, 363 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 137a1c1a..7e88822c 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -1154,6 +1154,14 @@ static inline jobject to_Annotation_safe(fz_context *ctx, JNIEnv *env, fz_annot
return jannot;
}
+static inline jint to_ColorParams_safe(fz_context *ctx, JNIEnv *env, const fz_color_params *cp)
+{
+ if (!ctx || !cp)
+ return 0;
+
+ return (((!!cp->bp)<<5) | ((!!cp->op)<<6) || ((!!cp->opm)<<7) || (cp->ri & 31));
+}
+
static inline jobject to_ColorSpace_safe(fz_context *ctx, JNIEnv *env, fz_colorspace *cs)
{
jobject jcs;
@@ -1700,6 +1708,18 @@ static inline fz_buffer *from_Buffer_safe(JNIEnv *env, jobject jobj)
return CAST(fz_buffer *, (*env)->GetLongField(env, jobj, fid_Buffer_pointer));
}
+static inline fz_color_params from_ColorParams_safe(JNIEnv *env, jint params)
+{
+ fz_color_params p;
+
+ p.bp = (params>>5) & 1;
+ p.op = (params>>6) & 1;
+ p.opm = (params>>7) & 1;
+ p.ri = (params & 31);
+
+ return p;
+}
+
static inline fz_colorspace *from_ColorSpace_safe(JNIEnv *env, jobject jobj)
{
if (!jobj) return NULL;
@@ -1837,7 +1857,7 @@ typedef struct
fz_java_device;
static void
-fz_java_device_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha)
+fz_java_device_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1845,14 +1865,15 @@ fz_java_device_fill_path(fz_context *ctx, fz_device *dev, const fz_path *path, i
jobject jcs = to_ColorSpace(ctx, env, cs);
jobject jctm = to_Matrix(ctx, env, ctm);
jfloatArray jcolor = to_jfloatArray(ctx, env, color, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillPath, jpath, (jboolean)even_odd, jctm, jcs, jcolor, alpha);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillPath, jpath, (jboolean)even_odd, jctm, jcs, jcolor, alpha, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
static void
-fz_java_device_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *state, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha)
+fz_java_device_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path, const fz_stroke_state *state, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1861,8 +1882,9 @@ fz_java_device_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *path,
jobject jcs = to_ColorSpace(ctx, env, cs);
jobject jctm = to_Matrix(ctx, env, ctm);
jfloatArray jcolor = to_jfloatArray(ctx, env, color, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_strokePath, jpath, jstate, jctm, jcs, jcolor, alpha);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_strokePath, jpath, jstate, jctm, jcs, jcolor, alpha, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
@@ -1895,7 +1917,7 @@ fz_java_device_clip_stroke_path(fz_context *ctx, fz_device *dev, const fz_path *
}
static void
-fz_java_device_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha)
+fz_java_device_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1903,14 +1925,15 @@ fz_java_device_fill_text(fz_context *ctx, fz_device *dev, const fz_text *text, c
jobject jctm = to_Matrix(ctx, env, ctm);
jobject jcs = to_ColorSpace(ctx, env, cs);
jfloatArray jcolor = to_jfloatArray(ctx, env, color, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillText, jtext, jctm, jcs, jcolor, alpha);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillText, jtext, jctm, jcs, jcolor, alpha, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
static void
-fz_java_device_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *state, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha)
+fz_java_device_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, const fz_stroke_state *state, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1919,8 +1942,9 @@ fz_java_device_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text,
jobject jctm = to_Matrix(ctx, env, ctm);
jobject jcs = to_ColorSpace(ctx, env, cs);
jfloatArray jcolor = to_jfloatArray(ctx, env, color, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_strokeText, jtext, jstate, jctm, jcs, jcolor, alpha);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_strokeText, jtext, jstate, jctm, jcs, jcolor, alpha, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
@@ -1966,7 +1990,7 @@ fz_java_device_ignore_text(fz_context *ctx, fz_device *dev, const fz_text *text,
}
static void
-fz_java_device_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shd, const fz_matrix *ctm, float alpha)
+fz_java_device_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shd, const fz_matrix *ctm, float alpha, const fz_color_params *color_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1979,7 +2003,7 @@ fz_java_device_fill_shade(fz_context *ctx, fz_device *dev, fz_shade *shd, const
}
static void
-fz_java_device_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, float alpha)
+fz_java_device_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, float alpha, const fz_color_params *color_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -1992,7 +2016,7 @@ fz_java_device_fill_image(fz_context *ctx, fz_device *dev, fz_image *img, const
}
static void
-fz_java_device_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha)
+fz_java_device_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, const fz_matrix *ctm, fz_colorspace *cs, const float *color, float alpha, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
@@ -2000,8 +2024,9 @@ fz_java_device_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *img, c
jobject jctm = to_Matrix(ctx, env, ctm);
jobject jcs = to_ColorSpace(ctx, env, cs);
jfloatArray jcolor = to_jfloatArray(ctx, env, color, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillImageMask, jimg, jctm, jcs, jcolor, alpha);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_fillImageMask, jimg, jctm, jcs, jcolor, alpha, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
@@ -2031,15 +2056,16 @@ fz_java_device_pop_clip(fz_context *ctx, fz_device *dev)
}
static void
-fz_java_device_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *cs, const float *bc)
+fz_java_device_begin_mask(fz_context *ctx, fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *cs, const float *bc, const fz_color_params *cs_params)
{
fz_java_device *jdev = (fz_java_device *)dev;
JNIEnv *env = jdev->env;
jobject jrect = to_Rect(ctx, env, rect);
jobject jcs = to_ColorSpace(ctx, env, cs);
jfloatArray jbc = to_jfloatArray(ctx, env, bc, cs ? fz_colorspace_n(ctx, cs) : FZ_MAX_COLORS);
+ int jcp = to_ColorParams_safe(ctx, env, cs_params);
- (*env)->CallVoidMethod(env, jdev->self, mid_Device_beginMask, jrect, (jint)luminosity, jcs, jbc);
+ (*env)->CallVoidMethod(env, jdev->self, mid_Device_beginMask, jrect, (jint)luminosity, jcs, jbc, jcp);
if ((*env)->ExceptionCheck(env))
fz_throw_java(ctx, env);
}
@@ -2290,7 +2316,7 @@ FUN(NativeDevice_close)(JNIEnv *env, jobject self)
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_fillPath)(JNIEnv *env, jobject self, jobject jpath, jboolean even_odd, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha)
+FUN(NativeDevice_fillPath)(JNIEnv *env, jobject self, jobject jpath, jboolean even_odd, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
@@ -2299,6 +2325,7 @@ FUN(NativeDevice_fillPath)(JNIEnv *env, jobject self, jobject jpath, jboolean ev
fz_colorspace *cs = from_ColorSpace(env, jcs);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
if (!ctx || !dev) return;
if (!path) { jni_throw_arg(env, "path must not be null"); return; }
@@ -2306,7 +2333,7 @@ FUN(NativeDevice_fillPath)(JNIEnv *env, jobject self, jobject jpath, jboolean ev
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_fill_path(ctx, dev, path, even_odd, &ctm, cs, color, alpha);
+ fz_fill_path(ctx, dev, path, even_odd, &ctm, cs, color, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2314,7 +2341,7 @@ FUN(NativeDevice_fillPath)(JNIEnv *env, jobject self, jobject jpath, jboolean ev
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_strokePath)(JNIEnv *env, jobject self, jobject jpath, jobject jstroke, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha)
+FUN(NativeDevice_strokePath)(JNIEnv *env, jobject self, jobject jpath, jobject jstroke, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
@@ -2322,6 +2349,7 @@ FUN(NativeDevice_strokePath)(JNIEnv *env, jobject self, jobject jpath, jobject j
fz_stroke_state *stroke = from_StrokeState(env, jstroke);
fz_matrix ctm = from_Matrix(env, jctm);
fz_colorspace *cs = from_ColorSpace(env, jcs);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
@@ -2332,7 +2360,7 @@ FUN(NativeDevice_strokePath)(JNIEnv *env, jobject self, jobject jpath, jobject j
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_stroke_path(ctx, dev, path, stroke, &ctm, cs, color, alpha);
+ fz_stroke_path(ctx, dev, path, stroke, &ctm, cs, color, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2384,13 +2412,14 @@ FUN(NativeDevice_clipStrokePath)(JNIEnv *env, jobject self, jobject jpath, jobje
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_fillText)(JNIEnv *env, jobject self, jobject jtext, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha)
+FUN(NativeDevice_fillText)(JNIEnv *env, jobject self, jobject jtext, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
fz_text *text = from_Text(env, jtext);
fz_matrix ctm = from_Matrix(env, jctm);
fz_colorspace *cs = from_ColorSpace(env, jcs);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
@@ -2400,7 +2429,7 @@ FUN(NativeDevice_fillText)(JNIEnv *env, jobject self, jobject jtext, jobject jct
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_fill_text(ctx, dev, text, &ctm, cs, color, alpha);
+ fz_fill_text(ctx, dev, text, &ctm, cs, color, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2408,7 +2437,7 @@ FUN(NativeDevice_fillText)(JNIEnv *env, jobject self, jobject jtext, jobject jct
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_strokeText)(JNIEnv *env, jobject self, jobject jtext, jobject jstroke, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha)
+FUN(NativeDevice_strokeText)(JNIEnv *env, jobject self, jobject jtext, jobject jstroke, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
@@ -2416,6 +2445,7 @@ FUN(NativeDevice_strokeText)(JNIEnv *env, jobject self, jobject jtext, jobject j
fz_stroke_state *stroke = from_StrokeState(env, jstroke);
fz_matrix ctm = from_Matrix(env, jctm);
fz_colorspace *cs = from_ColorSpace(env, jcs);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
@@ -2426,7 +2456,7 @@ FUN(NativeDevice_strokeText)(JNIEnv *env, jobject self, jobject jtext, jobject j
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_stroke_text(ctx, dev, text, stroke, &ctm, cs, color, alpha);
+ fz_stroke_text(ctx, dev, text, stroke, &ctm, cs, color, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2499,12 +2529,13 @@ FUN(NativeDevice_ignoreText)(JNIEnv *env, jobject self, jobject jtext, jobject j
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_fillShade)(JNIEnv *env, jobject self, jobject jshd, jobject jctm, jfloat alpha)
+FUN(NativeDevice_fillShade)(JNIEnv *env, jobject self, jobject jshd, jobject jctm, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
fz_shade *shd = from_Shade(env, jshd);
fz_matrix ctm = from_Matrix(env, jctm);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
NativeDeviceInfo *info;
if (!ctx || !dev) return;
@@ -2512,7 +2543,7 @@ FUN(NativeDevice_fillShade)(JNIEnv *env, jobject self, jobject jshd, jobject jct
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_fill_shade(ctx, dev, shd, &ctm, alpha);
+ fz_fill_shade(ctx, dev, shd, &ctm, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2520,12 +2551,13 @@ FUN(NativeDevice_fillShade)(JNIEnv *env, jobject self, jobject jshd, jobject jct
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_fillImage)(JNIEnv *env, jobject self, jobject jimg, jobject jctm, jfloat alpha)
+FUN(NativeDevice_fillImage)(JNIEnv *env, jobject self, jobject jimg, jobject jctm, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
fz_image *img = from_Image(env, jimg);
fz_matrix ctm = from_Matrix(env, jctm);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
NativeDeviceInfo *info;
if (!ctx || !dev) return;
@@ -2533,7 +2565,7 @@ FUN(NativeDevice_fillImage)(JNIEnv *env, jobject self, jobject jimg, jobject jct
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_fill_image(ctx, dev, img, &ctm, alpha);
+ fz_fill_image(ctx, dev, img, &ctm, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2541,13 +2573,14 @@ FUN(NativeDevice_fillImage)(JNIEnv *env, jobject self, jobject jimg, jobject jct
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_fillImageMask)(JNIEnv *env, jobject self, jobject jimg, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha)
+FUN(NativeDevice_fillImageMask)(JNIEnv *env, jobject self, jobject jimg, jobject jctm, jobject jcs, jfloatArray jcolor, jfloat alpha, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
fz_image *img = from_Image(env, jimg);
fz_matrix ctm = from_Matrix(env, jctm);
fz_colorspace *cs = from_ColorSpace(env, jcs);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
@@ -2557,7 +2590,7 @@ FUN(NativeDevice_fillImageMask)(JNIEnv *env, jobject self, jobject jimg, jobject
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_fill_image_mask(ctx, dev, img, &ctm, cs, color, alpha);
+ fz_fill_image_mask(ctx, dev, img, &ctm, cs, color, alpha, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -2604,12 +2637,13 @@ FUN(NativeDevice_popClip)(JNIEnv *env, jobject self)
}
JNIEXPORT void JNICALL
-FUN(NativeDevice_beginMask)(JNIEnv *env, jobject self, jobject jrect, jboolean luminosity, jobject jcs, jfloatArray jcolor)
+FUN(NativeDevice_beginMask)(JNIEnv *env, jobject self, jobject jrect, jboolean luminosity, jobject jcs, jfloatArray jcolor, jint jcp)
{
fz_context *ctx = get_context(env);
fz_device *dev = from_Device(env, self);
fz_rect rect = from_Rect(env, jrect);
fz_colorspace *cs = from_ColorSpace(env, jcs);
+ fz_color_params cp = from_ColorParams_safe(env, jcp);
float color[FZ_MAX_COLORS];
NativeDeviceInfo *info;
@@ -2618,7 +2652,7 @@ FUN(NativeDevice_beginMask)(JNIEnv *env, jobject self, jobject jrect, jboolean l
info = lockNativeDevice(env, self);
fz_try(ctx)
- fz_begin_mask(ctx, dev, &rect, luminosity, cs, color);
+ fz_begin_mask(ctx, dev, &rect, luminosity, cs, color, &cp);
fz_always(ctx)
unlockNativeDevice(env, info);
fz_catch(ctx)
@@ -8123,7 +8157,7 @@ FUN(PDFGraftMap_graftObject)(JNIEnv *env, jobject self, jobject jobj)
/* PDFPage interface */
JNIEXPORT jobject JNICALL
-FUN(PDFPage_createAnnotation)(JNIEnv *env, jobject self, int subtype)
+FUN(PDFPage_createAnnotation)(JNIEnv *env, jobject self, jint subtype)
{
fz_context *ctx = get_context(env);
pdf_page *page = from_PDFPage(env, self);
diff --git a/platform/java/mupdf_native.h b/platform/java/mupdf_native.h
index cdcebc50..d7355376 100644
--- a/platform/java/mupdf_native.h
+++ b/platform/java/mupdf_native.h
@@ -208,6 +208,34 @@ extern "C" {
}
#endif
#endif
+/* Header for class com_artifex_mupdf_fitz_ColorParams_RenderingIntent */
+
+#ifndef _Included_com_artifex_mupdf_fitz_ColorParams_RenderingIntent
+#define _Included_com_artifex_mupdf_fitz_ColorParams_RenderingIntent
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_ColorParams */
+
+#ifndef _Included_com_artifex_mupdf_fitz_ColorParams
+#define _Included_com_artifex_mupdf_fitz_ColorParams
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef com_artifex_mupdf_fitz_ColorParams_BP
+#define com_artifex_mupdf_fitz_ColorParams_BP 32L
+#undef com_artifex_mupdf_fitz_ColorParams_OP
+#define com_artifex_mupdf_fitz_ColorParams_OP 64L
+#undef com_artifex_mupdf_fitz_ColorParams_OPM
+#define com_artifex_mupdf_fitz_ColorParams_OPM 128L
+#ifdef __cplusplus
+}
+#endif
+#endif
/* Header for class com_artifex_mupdf_fitz_ColorSpace */
#ifndef _Included_com_artifex_mupdf_fitz_ColorSpace
@@ -1121,18 +1149,18 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_close
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: fillPath
- * Signature: (Lcom/artifex/mupdf/fitz/Path;ZLcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FF)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Path;ZLcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FFI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_fillPath
- (JNIEnv *, jobject, jobject, jboolean, jobject, jobject, jfloatArray, jfloat);
+ (JNIEnv *, jobject, jobject, jboolean, jobject, jobject, jfloatArray, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: strokePath
- * Signature: (Lcom/artifex/mupdf/fitz/Path;Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FF)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Path;Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FFI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_strokePath
- (JNIEnv *, jobject, jobject, jobject, jobject, jobject, jfloatArray, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jobject, jobject, jfloatArray, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
@@ -1153,18 +1181,18 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_clipStrokePath
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: fillText
- * Signature: (Lcom/artifex/mupdf/fitz/Text;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FF)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Text;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FFI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_fillText
- (JNIEnv *, jobject, jobject, jobject, jobject, jfloatArray, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jobject, jfloatArray, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: strokeText
- * Signature: (Lcom/artifex/mupdf/fitz/Text;Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FF)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Text;Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FFI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_strokeText
- (JNIEnv *, jobject, jobject, jobject, jobject, jobject, jfloatArray, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jobject, jobject, jfloatArray, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
@@ -1193,26 +1221,26 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_ignoreText
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: fillShade
- * Signature: (Lcom/artifex/mupdf/fitz/Shade;Lcom/artifex/mupdf/fitz/Matrix;F)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Shade;Lcom/artifex/mupdf/fitz/Matrix;FI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_fillShade
- (JNIEnv *, jobject, jobject, jobject, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: fillImage
- * Signature: (Lcom/artifex/mupdf/fitz/Image;Lcom/artifex/mupdf/fitz/Matrix;F)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Image;Lcom/artifex/mupdf/fitz/Matrix;FI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_fillImage
- (JNIEnv *, jobject, jobject, jobject, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: fillImageMask
- * Signature: (Lcom/artifex/mupdf/fitz/Image;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FF)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Image;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;[FFI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_fillImageMask
- (JNIEnv *, jobject, jobject, jobject, jobject, jfloatArray, jfloat);
+ (JNIEnv *, jobject, jobject, jobject, jobject, jfloatArray, jfloat, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
@@ -1233,10 +1261,10 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_popClip
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
* Method: beginMask
- * Signature: (Lcom/artifex/mupdf/fitz/Rect;ZLcom/artifex/mupdf/fitz/ColorSpace;[F)V
+ * Signature: (Lcom/artifex/mupdf/fitz/Rect;ZLcom/artifex/mupdf/fitz/ColorSpace;[FI)V
*/
JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_NativeDevice_beginMask
- (JNIEnv *, jobject, jobject, jboolean, jobject, jfloatArray);
+ (JNIEnv *, jobject, jobject, jboolean, jobject, jfloatArray, jint);
/*
* Class: com_artifex_mupdf_fitz_NativeDevice
@@ -1293,6 +1321,263 @@ extern "C" {
}
#endif
#endif
+/* Header for class com_artifex_mupdf_fitz_Page */
+
+#ifndef _Included_com_artifex_mupdf_fitz_Page
+#define _Included_com_artifex_mupdf_fitz_Page
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: finalize
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_finalize
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: getBounds
+ * Signature: ()Lcom/artifex/mupdf/fitz/Rect;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_getBounds
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: toPixmap
+ * Signature: (Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;Z)Lcom/artifex/mupdf/fitz/Pixmap;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toPixmap
+ (JNIEnv *, jobject, jobject, jobject, jboolean);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: run
+ * Signature: (Lcom/artifex/mupdf/fitz/Device;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/Cookie;)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_run
+ (JNIEnv *, jobject, jobject, jobject, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: runPageContents
+ * Signature: (Lcom/artifex/mupdf/fitz/Device;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/Cookie;)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_runPageContents
+ (JNIEnv *, jobject, jobject, jobject, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: getAnnotations
+ * Signature: ()[Lcom/artifex/mupdf/fitz/Annotation;
+ */
+JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_getAnnotations
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: getLinks
+ * Signature: ()[Lcom/artifex/mupdf/fitz/Link;
+ */
+JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_getLinks
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: toDisplayList
+ * Signature: (Z)Lcom/artifex/mupdf/fitz/DisplayList;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toDisplayList
+ (JNIEnv *, jobject, jboolean);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: toStructuredText
+ * Signature: (Ljava/lang/String;)Lcom/artifex/mupdf/fitz/StructuredText;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toStructuredText
+ (JNIEnv *, jobject, jstring);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: search
+ * Signature: (Ljava/lang/String;)[Lcom/artifex/mupdf/fitz/Rect;
+ */
+JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_search
+ (JNIEnv *, jobject, jstring);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: textAsHtml
+ * Signature: ()[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_com_artifex_mupdf_fitz_Page_textAsHtml
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: countSeparations
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_artifex_mupdf_fitz_Page_countSeparations
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: getSeparation
+ * Signature: (I)Lcom/artifex/mupdf/fitz/Separation;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_getSeparation
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Page
+ * Method: enableSeparation
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_enableSeparation
+ (JNIEnv *, jobject, jint, jboolean);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_Path */
+
+#ifndef _Included_com_artifex_mupdf_fitz_Path
+#define _Included_com_artifex_mupdf_fitz_Path
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: finalize
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_finalize
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: newNative
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_artifex_mupdf_fitz_Path_newNative
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: cloneNative
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_com_artifex_mupdf_fitz_Path_cloneNative
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: currentPoint
+ * Signature: ()Lcom/artifex/mupdf/fitz/Point;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Path_currentPoint
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: moveTo
+ * Signature: (FF)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_moveTo
+ (JNIEnv *, jobject, jfloat, jfloat);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: lineTo
+ * Signature: (FF)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_lineTo
+ (JNIEnv *, jobject, jfloat, jfloat);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: curveTo
+ * Signature: (FFFFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveTo
+ (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: curveToV
+ * Signature: (FFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveToV
+ (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: curveToY
+ * Signature: (FFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveToY
+ (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: rect
+ * Signature: (IIII)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_rect
+ (JNIEnv *, jobject, jint, jint, jint, jint);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: closePath
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_closePath
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: transform
+ * Signature: (Lcom/artifex/mupdf/fitz/Matrix;)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_transform
+ (JNIEnv *, jobject, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: getBounds
+ * Signature: (Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;)Lcom/artifex/mupdf/fitz/Rect;
+ */
+JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Path_getBounds
+ (JNIEnv *, jobject, jobject, jobject);
+
+/*
+ * Class: com_artifex_mupdf_fitz_Path
+ * Method: walk
+ * Signature: (Lcom/artifex/mupdf/fitz/PathWalker;)V
+ */
+JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_walk
+ (JNIEnv *, jobject, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_PathWalker */
+
+#ifndef _Included_com_artifex_mupdf_fitz_PathWalker
+#define _Included_com_artifex_mupdf_fitz_PathWalker
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
/* Header for class com_artifex_mupdf_fitz_PDFAnnotation */
#ifndef _Included_com_artifex_mupdf_fitz_PDFAnnotation
@@ -1722,7 +2007,7 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_PDFDocument_deleteObject
/*
* Class: com_artifex_mupdf_fitz_PDFDocument
* Method: newPDFGraftMap
- * Signature: (Lcom/artifex/mupdf/fitz/PDFDocument)Lcom/artifex/mupdf/fitz/PDFGraftMap;
+ * Signature: ()Lcom/artifex/mupdf/fitz/PDFGraftMap;
*/
JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_PDFDocument_newPDFGraftMap
(JNIEnv *, jobject);
@@ -1730,7 +2015,7 @@ JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_PDFDocument_newPDFGraftMap
/*
* Class: com_artifex_mupdf_fitz_PDFDocument
* Method: graftObject
- * Signature: (Lcom/artifex/mupdf/fitz/PDFDocument;Lcom/artifex/mupdf/fitz/PDFObject)Lcom/artifex/mupdf/fitz/PDFObject;
+ * Signature: (Lcom/artifex/mupdf/fitz/PDFObject;)Lcom/artifex/mupdf/fitz/PDFObject;
*/
JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_PDFDocument_graftObject
(JNIEnv *, jobject, jobject);
@@ -1853,10 +2138,10 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_PDFGraftMap_finalize
/*
* Class: com_artifex_mupdf_fitz_PDFGraftMap
* Method: graftObject
- * Signature: (Lcom/artifex/mupdf/fitz/PDFGraftMap;Lcom/artifex/mupdf/fitz/PDFObject;)Lcom/artifex/mupdf/fitz/PDFObject;
+ * Signature: (Lcom/artifex/mupdf/fitz/PDFObject;)Lcom/artifex/mupdf/fitz/PDFObject;
*/
JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_PDFGraftMap_graftObject
- (JNIEnv *, jobject, jobject, jobject);
+ (JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
@@ -2348,263 +2633,6 @@ JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_PDFPage_deleteAnnotation
}
#endif
#endif
-/* Header for class com_artifex_mupdf_fitz_Page */
-
-#ifndef _Included_com_artifex_mupdf_fitz_Page
-#define _Included_com_artifex_mupdf_fitz_Page
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: finalize
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_finalize
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: getBounds
- * Signature: ()Lcom/artifex/mupdf/fitz/Rect;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_getBounds
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: toPixmap
- * Signature: (Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/ColorSpace;Z)Lcom/artifex/mupdf/fitz/Pixmap;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toPixmap
- (JNIEnv *, jobject, jobject, jobject, jboolean);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: run
- * Signature: (Lcom/artifex/mupdf/fitz/Device;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/Cookie;)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_run
- (JNIEnv *, jobject, jobject, jobject, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: runPageContents
- * Signature: (Lcom/artifex/mupdf/fitz/Device;Lcom/artifex/mupdf/fitz/Matrix;Lcom/artifex/mupdf/fitz/Cookie;)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_runPageContents
- (JNIEnv *, jobject, jobject, jobject, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: getAnnotations
- * Signature: ()[Lcom/artifex/mupdf/fitz/Annotation;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_getAnnotations
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: getLinks
- * Signature: ()[Lcom/artifex/mupdf/fitz/Link;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_getLinks
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: toDisplayList
- * Signature: (Z)Lcom/artifex/mupdf/fitz/DisplayList;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toDisplayList
- (JNIEnv *, jobject, jboolean);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: toStructuredText
- * Signature: (Ljava/lang/String;)Lcom/artifex/mupdf/fitz/StructuredText;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_toStructuredText
- (JNIEnv *, jobject, jstring);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: search
- * Signature: (Ljava/lang/String;)[Lcom/artifex/mupdf/fitz/Rect;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_Page_search
- (JNIEnv *, jobject, jstring);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: textAsHtml
- * Signature: ()[B
- */
-JNIEXPORT jbyteArray JNICALL Java_com_artifex_mupdf_fitz_Page_textAsHtml
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: countSeparations
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_com_artifex_mupdf_fitz_Page_countSeparations
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: getSeparation
- * Signature: (I)Lcom/artifex/mupdf/fitz/Separation;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Page_getSeparation
- (JNIEnv *, jobject, jint);
-
-/*
- * Class: com_artifex_mupdf_fitz_Page
- * Method: enableSeparation
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Page_enableSeparation
- (JNIEnv *, jobject, jint, jboolean);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-/* Header for class com_artifex_mupdf_fitz_Path */
-
-#ifndef _Included_com_artifex_mupdf_fitz_Path
-#define _Included_com_artifex_mupdf_fitz_Path
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: finalize
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_finalize
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: newNative
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_com_artifex_mupdf_fitz_Path_newNative
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: cloneNative
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_com_artifex_mupdf_fitz_Path_cloneNative
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: currentPoint
- * Signature: ()Lcom/artifex/mupdf/fitz/Point;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Path_currentPoint
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: moveTo
- * Signature: (FF)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_moveTo
- (JNIEnv *, jobject, jfloat, jfloat);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: lineTo
- * Signature: (FF)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_lineTo
- (JNIEnv *, jobject, jfloat, jfloat);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: curveTo
- * Signature: (FFFFFF)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveTo
- (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: curveToV
- * Signature: (FFFF)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveToV
- (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: curveToY
- * Signature: (FFFF)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_curveToY
- (JNIEnv *, jobject, jfloat, jfloat, jfloat, jfloat);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: rect
- * Signature: (IIII)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_rect
- (JNIEnv *, jobject, jint, jint, jint, jint);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: closePath
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_closePath
- (JNIEnv *, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: transform
- * Signature: (Lcom/artifex/mupdf/fitz/Matrix;)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_transform
- (JNIEnv *, jobject, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: getBounds
- * Signature: (Lcom/artifex/mupdf/fitz/StrokeState;Lcom/artifex/mupdf/fitz/Matrix;)Lcom/artifex/mupdf/fitz/Rect;
- */
-JNIEXPORT jobject JNICALL Java_com_artifex_mupdf_fitz_Path_getBounds
- (JNIEnv *, jobject, jobject, jobject);
-
-/*
- * Class: com_artifex_mupdf_fitz_Path
- * Method: walk
- * Signature: (Lcom/artifex/mupdf/fitz/PathWalker;)V
- */
-JNIEXPORT void JNICALL Java_com_artifex_mupdf_fitz_Path_walk
- (JNIEnv *, jobject, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-/* Header for class com_artifex_mupdf_fitz_PathWalker */
-
-#ifndef _Included_com_artifex_mupdf_fitz_PathWalker
-#define _Included_com_artifex_mupdf_fitz_PathWalker
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
/* Header for class com_artifex_mupdf_fitz_Pixmap */
#ifndef _Included_com_artifex_mupdf_fitz_Pixmap
@@ -2938,6 +2966,50 @@ JNIEXPORT jfloatArray JNICALL Java_com_artifex_mupdf_fitz_StrokeState_getDashes
}
#endif
#endif
+/* Header for class com_artifex_mupdf_fitz_StructuredText_TextBlock */
+
+#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextBlock
+#define _Included_com_artifex_mupdf_fitz_StructuredText_TextBlock
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_StructuredText_TextChar */
+
+#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextChar
+#define _Included_com_artifex_mupdf_fitz_StructuredText_TextChar
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_StructuredText_TextLine */
+
+#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextLine
+#define _Included_com_artifex_mupdf_fitz_StructuredText_TextLine
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* Header for class com_artifex_mupdf_fitz_StructuredText_TextSpan */
+
+#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextSpan
+#define _Included_com_artifex_mupdf_fitz_StructuredText_TextSpan
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
/* Header for class com_artifex_mupdf_fitz_StructuredText */
#ifndef _Included_com_artifex_mupdf_fitz_StructuredText
@@ -2989,50 +3061,6 @@ JNIEXPORT jobjectArray JNICALL Java_com_artifex_mupdf_fitz_StructuredText_getBlo
}
#endif
#endif
-/* Header for class com_artifex_mupdf_fitz_StructuredText_TextChar */
-
-#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextChar
-#define _Included_com_artifex_mupdf_fitz_StructuredText_TextChar
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-/* Header for class com_artifex_mupdf_fitz_StructuredText_TextSpan */
-
-#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextSpan
-#define _Included_com_artifex_mupdf_fitz_StructuredText_TextSpan
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-/* Header for class com_artifex_mupdf_fitz_StructuredText_TextLine */
-
-#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextLine
-#define _Included_com_artifex_mupdf_fitz_StructuredText_TextLine
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
-/* Header for class com_artifex_mupdf_fitz_StructuredText_TextBlock */
-
-#ifndef _Included_com_artifex_mupdf_fitz_StructuredText_TextBlock
-#define _Included_com_artifex_mupdf_fitz_StructuredText_TextBlock
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
/* Header for class com_artifex_mupdf_fitz_Text */
#ifndef _Included_com_artifex_mupdf_fitz_Text
@@ -3119,11 +3147,11 @@ extern "C" {
extern "C" {
#endif
#undef com_artifex_mupdf_fitz_TryLaterException_serialVersionUID
-#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -3042686055658047285LL
+#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -3042686055658047285i64
#undef com_artifex_mupdf_fitz_TryLaterException_serialVersionUID
-#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -3387516993124229948LL
+#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -3387516993124229948i64
#undef com_artifex_mupdf_fitz_TryLaterException_serialVersionUID
-#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -7034897190745766939LL
+#define com_artifex_mupdf_fitz_TryLaterException_serialVersionUID -7034897190745766939i64
#ifdef __cplusplus
}
#endif
diff --git a/platform/java/src/com/artifex/mupdf/fitz/ColorParams.java b/platform/java/src/com/artifex/mupdf/fitz/ColorParams.java
new file mode 100644
index 00000000..2a8d781b
--- /dev/null
+++ b/platform/java/src/com/artifex/mupdf/fitz/ColorParams.java
@@ -0,0 +1,51 @@
+package com.artifex.mupdf.fitz;
+
+public final class ColorParams
+{
+ public enum RenderingIntent {
+ PERCEPTUAL,
+ RELATIVE_COLORIMETRIC,
+ SATURATION,
+ ABSOLUTE_COLORIMETRIC
+ }
+ public static final int BP = 32;
+ public static final int OP = 64;
+ public static final int OPM = 128;
+
+ public static RenderingIntent RI(int flags) {
+ switch (flags>>3) {
+ default:
+ case 0: return RenderingIntent.PERCEPTUAL;
+ case 1: return RenderingIntent.RELATIVE_COLORIMETRIC;
+ case 2: return RenderingIntent.SATURATION;
+ case 3: return RenderingIntent.ABSOLUTE_COLORIMETRIC;
+ }
+ }
+
+ public static boolean BP(int flags) {
+ return (flags & BP) != 0;
+ }
+
+ public static boolean OP(int flags) {
+ return (flags & OP) != 0;
+ }
+
+ public static boolean OPM(int flags) {
+ return (flags & OPM) != 0;
+ }
+
+ public static int pack(RenderingIntent ri, boolean bp, boolean op, boolean opm) {
+ int flags;
+ switch (ri) {
+ default:
+ case PERCEPTUAL: flags = 0; break;
+ case RELATIVE_COLORIMETRIC: flags = 1; break;
+ case SATURATION: flags = 2; break;
+ case ABSOLUTE_COLORIMETRIC: flags = 3; break;
+ }
+ if (bp) flags |= BP;
+ if (op) flags |= OP;
+ if (opm) flags |= OPM;
+ return flags;
+ }
+}
diff --git a/platform/java/src/com/artifex/mupdf/fitz/NativeDevice.java b/platform/java/src/com/artifex/mupdf/fitz/NativeDevice.java
index 0d2b9159..910b8ec8 100644
--- a/platform/java/src/com/artifex/mupdf/fitz/NativeDevice.java
+++ b/platform/java/src/com/artifex/mupdf/fitz/NativeDevice.java
@@ -19,25 +19,26 @@ public class NativeDevice extends Device
public native final void close();
- public native final void fillPath(Path path, boolean evenOdd, Matrix ctm, ColorSpace cs, float color[], float alpha);
- public native final void strokePath(Path path, StrokeState stroke, Matrix ctm, ColorSpace cs, float color[], float alpha);
+ public native final void fillPath(Path path, boolean evenOdd, Matrix ctm, ColorSpace cs, float color[], float alpha, int cp);
+ public native final void strokePath(Path path, StrokeState stroke, Matrix ctm, ColorSpace cs, float color[], float alpha, int cp);
public native final void clipPath(Path path, boolean evenOdd, Matrix ctm);
public native final void clipStrokePath(Path path, StrokeState stroke, Matrix ctm);
- public native final void fillText(Text text, Matrix ctm, ColorSpace cs, float color[], float alpha);
- public native final void strokeText(Text text, StrokeState stroke, Matrix ctm, ColorSpace cs, float color[], float alpha);
+ public native final void fillText(Text text, Matrix ctm, ColorSpace cs, float color[], float alpha, int cp);
+ public native final void strokeText(Text text, StrokeState stroke, Matrix ctm, ColorSpace cs, float color[], float alpha, int cp);
public native final void clipText(Text text, Matrix ctm);
public native final void clipStrokeText(Text text, StrokeState stroke, Matrix ctm);
public native final void ignoreText(Text text, Matrix ctm);
- public native final void fillShade(Shade shd, Matrix ctm, float alpha);
- public native final void fillImage(Image img, Matrix ctm, float alpha);
- public native final void fillImageMask(Image img, Matrix ctm, ColorSpace cs, float color[], float alpha);
+ public native final void fillShade(Shade shd, Matrix ctm, float alpha, int cp);
+ public native final void fillImage(Image img, Matrix ctm, float alpha, int cp);
+ public native final void fillImageMask(Image img, Matrix ctm, ColorSpace cs, float color[], float alpha, int cp);
+ /* FIXME: Why no scissor? */
public native final void clipImageMask(Image img, Matrix ctm);
public native final void popClip();
- public native final void beginMask(Rect rect, boolean luminosity, ColorSpace cs, float bc[]);
+ public native final void beginMask(Rect rect, boolean luminosity, ColorSpace cs, float bc[], int cp);
public native final void endMask();
public native final void beginGroup(Rect rect, boolean isolated, boolean knockout, int blendmode, float alpha);
public native final void endGroup();