Merge lp:~zorba-coders/zorba/update3.0_image-module into lp:zorba/image-module

Proposed by Juan Zacarias on 2013-08-12
Status: Merged
Merged at revision: 62
Proposed branch: lp:~zorba-coders/zorba/update3.0_image-module
Merge into: lp:zorba/image-module
Diff against target: 4286 lines (+1468/-855)
83 files modified
src/CMakeLists.txt (+74/-7)
src/animation.xq (+10/-10)
src/animation.xq.src/animation_module.h (+1/-1)
src/basic.xq (+29/-29)
src/basic.xq.src/basic_module.h (+1/-1)
src/com/CMakeLists.txt (+0/-17)
src/com/zorba-xquery/CMakeLists.txt (+0/-17)
src/com/zorba-xquery/www/CMakeLists.txt (+0/-17)
src/com/zorba-xquery/www/modules/CMakeLists.txt (+0/-15)
src/com/zorba-xquery/www/modules/image/CMakeLists.txt (+0/-86)
src/image.jsd (+360/-0)
src/image.xsd (+3/-3)
src/image_commons/image_function.cpp (+3/-3)
src/image_commons/image_module.h (+1/-1)
src/manipulation.xq (+112/-112)
src/manipulation.xq.src/manipulation_module.h (+1/-1)
src/paint.xq (+116/-83)
src/paint.xq.src/paint.cpp (+218/-274)
src/paint.xq.src/paint.h (+2/-3)
src/paint.xq.src/paint_module.h (+1/-1)
test/Queries/image/animation.xq (+3/-3)
test/Queries/image/animation_create.xq (+1/-1)
test/Queries/image/animation_create_morphed.xq (+1/-1)
test/Queries/image/basic.xq (+1/-1)
test/Queries/image/basic_compress.xq (+1/-1)
test/Queries/image/basic_convert.xq (+1/-1)
test/Queries/image/basic_create.xq (+1/-1)
test/Queries/image/basic_equals.xq (+1/-1)
test/Queries/image/basic_exif.xq (+1/-1)
test/Queries/image/basic_height.xq (+1/-1)
test/Queries/image/basic_svg.xq (+1/-1)
test/Queries/image/basic_type.xq (+1/-1)
test/Queries/image/basic_width.xq (+1/-1)
test/Queries/image/manipulation_1.xq (+3/-3)
test/Queries/image/manipulation_2.xq (+3/-3)
test/Queries/image/manipulation_3.xq (+3/-3)
test/Queries/image/manipulation_4.xq (+3/-3)
test/Queries/image/manipulation_5.xq (+3/-3)
test/Queries/image/manipulation_add_noise.xq (+1/-1)
test/Queries/image/manipulation_blur.xq (+1/-1)
test/Queries/image/manipulation_charcoal.xq (+1/-1)
test/Queries/image/manipulation_chop.xq (+1/-1)
test/Queries/image/manipulation_contrast.xq (+1/-1)
test/Queries/image/manipulation_crop.xq (+1/-1)
test/Queries/image/manipulation_despeckle.xq (+1/-1)
test/Queries/image/manipulation_edge.xq (+1/-1)
test/Queries/image/manipulation_emboss.xq (+1/-1)
test/Queries/image/manipulation_enhance.xq (+1/-1)
test/Queries/image/manipulation_equalize.xq (+1/-1)
test/Queries/image/manipulation_erase.xq (+1/-1)
test/Queries/image/manipulation_flip.xq (+1/-1)
test/Queries/image/manipulation_flop.xq (+1/-1)
test/Queries/image/manipulation_gamma.xq (+1/-1)
test/Queries/image/manipulation_gamma2.xq (+1/-1)
test/Queries/image/manipulation_implode.xq (+1/-1)
test/Queries/image/manipulation_oil_paint.xq (+1/-1)
test/Queries/image/manipulation_overlay.xq (+2/-2)
test/Queries/image/manipulation_reduce_noise.xq (+1/-1)
test/Queries/image/manipulation_resize.xq (+1/-1)
test/Queries/image/manipulation_rotate.xq (+1/-1)
test/Queries/image/manipulation_solarize.xq (+1/-1)
test/Queries/image/manipulation_stereo.xq (+1/-1)
test/Queries/image/manipulation_sub_image.xq (+2/-2)
test/Queries/image/manipulation_swirl.xq (+1/-1)
test/Queries/image/manipulation_transparent.xq (+1/-1)
test/Queries/image/manipulation_trim.xq (+1/-1)
test/Queries/image/manipulation_watermark.xq (+1/-1)
test/Queries/image/manipulation_zoom.xq (+1/-1)
test/Queries/image/manipulation_zoom_height.xq (+2/-2)
test/Queries/image/manipulation_zoom_width.xq (+2/-2)
test/Queries/image/paint_1.xq (+53/-12)
test/Queries/image/paint_2.xq (+40/-16)
test/Queries/image/paint_3.xq (+39/-8)
test/Queries/image/paint_4.xq (+81/-12)
test/Queries/image/paint_5.xq (+72/-11)
test/Queries/image/paint_6.xq (+43/-8)
test/Queries/image/paint_circles.xq (+37/-13)
test/Queries/image/paint_different_lines.xq (+37/-7)
test/Queries/image/paint_polygon.xq (+9/-4)
test/Queries/image/paint_polyline.xq (+9/-4)
test/Queries/image/paint_rectangles.xq (+28/-6)
test/Queries/image/paint_stroked_polyline.xq (+11/-4)
test/Queries/image/paint_text.xq (+11/-3)
To merge this branch: bzr merge lp:~zorba-coders/zorba/update3.0_image-module
Reviewer Review Type Date Requested Status
Juan Zacarias Approve on 2013-10-23
Chris Hillery 2013-08-12 Approve on 2013-10-23
Review via email: mp+179826@code.launchpad.net

Commit message

Updated image module to zorba 3.0 format

JSONification of module parameters

Description of the change

Updated image module to zorba 3.0 format

JSONification of module parameters

To post a comment you must log in.
Juan Zacarias (juan457) wrote :

Misses JSON validation

Zorba Build Bot (zorba-buildbot) wrote :
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826

Stage "BuildZorbaUbuntu" failed.

Check compiler output at http://jenkins.lambda.nu/job/BuildZorbaUbuntu/446/parsed_console to view the results.

61. By Chris Hillery on 2013-10-23

Fixed a few build/doc errors.

Chris Hillery (ceejatec) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826

Stage "ZorbaVQ" failed.

Check console output at http://jenkins.lambda.nu/job/ZorbaVQ/495/console to view the results.

62. By Chris Hillery on 2013-10-23

Merge from trunk (?).

Zorba Build Bot (zorba-buildbot) wrote :
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826 :
Votes: {'Approve': 1}

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/update3.0_image-module/+merge/179826

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/241/console to view the results.

Juan Zacarias (juan457) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2011-07-26 10:43:30 +0000
3+++ src/CMakeLists.txt 2013-10-23 04:15:35 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2006-2008 The FLWOR Foundation.
6+# Copyright 2006-2010 The FLWOR Foundation.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10@@ -11,9 +11,76 @@
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14-
15-# all external module libraries are generated in the directory
16-# of the corresponding .xq file
17-MESSAGE(STATUS "Add com")
18-ADD_SUBDIRECTORY(com)
19-MESSAGE(STATUS "End modules")
20+#
21+
22+########################################################################
23+# ImageMagick
24+########################################################################
25+IF(ZORBA_SUPPRESS_ImageMagick)
26+ MESSAGE(STATUS "ZORBA_SUPPRESS_ImageMagick is true - not searching for ImageMagick.")
27+ELSE(ZORBA_SUPPRESS_ImageMagick)
28+ MESSAGE (STATUS "Looking for ImageMagick")
29+ FIND_PACKAGE(ImageMagick COMPONENTS Magick++ MagickCore MagickWand)
30+
31+ IF(ImageMagick_FOUND)
32+ MESSAGE(STATUS "Found ImageMagick include dirs ${ImageMagick_INCLUDE_DIRS}")
33+ MESSAGE(STATUS "Found ImageMagick libraries ${ImageMagick_LIBRARIES}")
34+ INCLUDE_DIRECTORIES("${ImageMagick_INCLUDE_DIRS}")
35+
36+ INCLUDE_DIRECTORIES("image_commons")
37+ INCLUDE_DIRECTORIES("image_draw")
38+ DECLARE_ZORBA_SCHEMA(FILE image.xsd
39+ URI "http://zorba.io/modules/image/image")
40+ DECLARE_ZORBA_MODULE(URI "http://zorba.io/modules/image/basic"
41+ VERSION 2.0 FILE "basic.xq"
42+ EXTRA_SOURCES image_commons image_draw
43+ LINK_LIBRARIES ${ImageMagick_LIBRARIES})
44+ DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "manipulation.xq"
45+ URI "http://zorba.io/modules/image/manipulation"
46+ EXTRA_SOURCES image_commons
47+ LINK_LIBRARIES ${ImageMagick_LIBRARIES})
48+ DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "paint.xq"
49+ URI "http://zorba.io/modules/image/paint"
50+ EXTRA_SOURCES image_draw image_commons
51+ LINK_LIBRARIES ${ImageMagick_LIBRARIES})
52+ DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "animation.xq"
53+ URI "http://zorba.io/modules/image/animation"
54+ EXTRA_SOURCES image_commons
55+ LINK_LIBRARIES ${ImageMagick_LIBRARIES})
56+
57+ # this could crash because of the ImageMagick version
58+ # must be compiled in debug mode
59+ SET (KNOWN_CRASHES)
60+ IF (WIN32)
61+ IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
62+ LIST (APPEND KNOWN_CRASHES
63+ zorba_image_module/image/basic.xq 867693
64+ zorba_image_module/image/basic_convert.xq 867693
65+ zorba_image_module/image/basic_create.xq 867693
66+ zorba_image_module/image/paint_1.xq 867693
67+ zorba_image_module/image/paint_2.xq 867693
68+ zorba_image_module/image/paint_3.xq 867693
69+ zorba_image_module/image/paint_4.xq 867693
70+ zorba_image_module/image/paint_5.xq 867693
71+ zorba_image_module/image/paint_6.xq 867693
72+ zorba_image_module/image/paint_circles.xq 867693
73+ zorba_image_module/image/paint_different_lines.xq 867693
74+ zorba_image_module/image/paint_polygon.xq 867693
75+ zorba_image_module/image/paint_polyline.xq 867693
76+ zorba_image_module/image/paint_rectangles.xq 867693
77+ zorba_image_module/image/paint_stroked_polyline.xq 867693
78+ zorba_image_module/image/paint_text.xq 867693
79+ )
80+ ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")
81+ ENDIF (WIN32)
82+
83+ ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test" "${KNOWN_CRASHES}")
84+
85+ ELSE (ImageMagick_FOUND)
86+ MESSAGE(STATUS "Magick++ component found: ${ImageMagick_Magick++_FOUND}")
87+ MESSAGE(STATUS "MagickCore component found: ${ImageMagick_MagickCore_FOUND}")
88+ MESSAGE(STATUS "MagickWand component found: ${ImageMagick_MagickWand_FOUND}")
89+ MESSAGE(STATUS "If you want to use image handling functionality please install the ImageMagick library containing these 3 components: Magick++, MagickCore, MagickWand.\n Please note that on some OS\n- ImageMagick and\n- libMagick++ (on OpenSuse) or ImageMagick-c++(on Fedora)\n are 2 different packages and you need to install both of them and additionally their development packages.")
90+ ENDIF (ImageMagick_FOUND)
91+ENDIF(ZORBA_SUPPRESS_ImageMagick)
92+MESSAGE(STATUS "")
93
94=== renamed file 'src/com/zorba-xquery/www/modules/image/animation.xq' => 'src/animation.xq'
95--- src/com/zorba-xquery/www/modules/image/animation.xq 2013-08-09 09:37:05 +0000
96+++ src/animation.xq 2013-10-23 04:15:35 +0000
97@@ -23,38 +23,38 @@
98 : @library <a href="http://www.imagemagick.org/Magick++/">Magick++ C++ Library</a>
99 : @project Zorba/Image/Animation
100 :)
101-module namespace anim = 'http://www.zorba-xquery.com/modules/image/animation';
102+module namespace anim = 'http://zorba.io/modules/image/animation';
103
104-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";
105+declare namespace ierr = "http://zorba.io/modules/image/error";
106 declare namespace ver = "http://zorba.io/options/versioning";
107 declare option ver:module-version "1.0";
108
109 (:~
110- : Creates an animated GIF image.
111- : The resulting animated GIF shows the passed images consecutively.
112- : It has the same width and height as the first passed image.
113+ : <p>Creates an animated GIF image.</p>
114+ : <p>The resulting animated GIF shows the passed images consecutively.</p>
115+ : <p>It has the same width and height as the first passed image.</p>
116 :
117 : @param $images the image sequence
118 : @param $delay the hundredths of seconds an image is shown
119 : @param $iterations the amount of times all images are shown. 0 for infinite.
120 : @return the animated GIF
121- : @error ierr:IM001 one of the passed images is invalid.
122+ : @error ierr:INVALID_IMAGE the passed image is invalid.
123 : @example test/Queries/image/animation_create.xq
124 :)
125 declare function anim:create-animated-gif($images as xs:base64Binary+, $delay as xs:unsignedInt, $iterations as xs:unsignedInt) as xs:base64Binary external;
126
127
128 (:~
129- : Creates an animated GIF image with morph effect.
130- : The resulting animated GIF shows the passed images consecutively with morph effect between the changes.
131- : It has the same width and height as the first passed image.
132+ : <p>Creates an animated GIF image with morph effect.</p>
133+ : <p>The resulting animated GIF shows the passed images consecutively with morph effect between the changes.</p>
134+ : <p>It has the same width and height as the first passed image.</p>
135 :
136 : @param $images the image sequence
137 : @param $delay the hundredths of seconds an image is shown
138 : @param $iterations the amount of times all images are shown. 0 for infinite.
139 : @param $nr-of-morph-images the number of additionally added images to create the morph effect between two passed images.
140 : @return the animated GIF
141- : @error ierr:IM001 one of the passed images is invalid.
142+ : @error ierr:INVALID_IMAGE the passed image is invalid.
143 : @example test/Queries/image/animation_create.xq
144 :)
145 declare function anim:create-morphed-gif($images as xs:base64Binary+, $delay as xs:unsignedInt, $iterations as xs:unsignedInt, $nr-of-morph-images as xs:unsignedInt) as xs:base64Binary external;
146
147=== renamed directory 'src/com/zorba-xquery/www/modules/image/animation.xq.src' => 'src/animation.xq.src'
148=== modified file 'src/animation.xq.src/animation_module.h'
149--- src/com/zorba-xquery/www/modules/image/animation.xq.src/animation_module.h 2011-10-06 08:18:47 +0000
150+++ src/animation.xq.src/animation_module.h 2013-10-23 04:15:35 +0000
151@@ -33,7 +33,7 @@
152
153
154 virtual String
155- getURI() const { return "http://www.zorba-xquery.com/modules/image/animation"; }
156+ getURI() const { return "http://zorba.io/modules/image/animation"; }
157
158 };
159
160
161=== renamed file 'src/com/zorba-xquery/www/modules/image/basic.xq' => 'src/basic.xq'
162--- src/com/zorba-xquery/www/modules/image/basic.xq 2013-08-09 09:37:05 +0000
163+++ src/basic.xq 2013-10-23 04:15:35 +0000
164@@ -17,7 +17,7 @@
165 :)
166
167 (:~
168- : This module provides function to do the following basic image operations:
169+ : <p>This module provides function to do the following basic image operations:</p>
170 : <ul>
171 : <li>create empty images</li>
172 : <li>compare images</li>
173@@ -25,8 +25,8 @@
174 : <li>convert an image one format to another</li>
175 : <li>retrieve with, height, format, and exif information from an image</li>
176 : </ul>
177- :
178- : The following image formats are supported:
179+ : <p/>
180+ : <p>The following image formats are supported:
181 : <ul>
182 : <li>GIF</li>
183 : <li>JPEG</li>
184@@ -34,27 +34,27 @@
185 : <li>TIFF</li>
186 : <li>BMP</li>
187 : </ul>
188- :
189+ : </p>
190 : <p>The errors raised by functions of this module have the namespace
191- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
192+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
193 :
194 : @author Daniel Thomas
195 : @library <a href="http://www.imagemagick.org/Magick++/">Magick++ C++ Library</a>
196 : @project Zorba/Image/Basic
197 :
198 :)
199-module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
200+module namespace basic = 'http://zorba.io/modules/image/basic';
201
202-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
203+import schema namespace image = 'http://zorba.io/modules/image/image';
204
205 declare namespace err = "http://www.w3.org/2005/xqt-errors";
206-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";
207+declare namespace ierr = "http://zorba.io/modules/image/error";
208 declare namespace ver = "http://zorba.io/options/versioning";
209 declare namespace svg = "http://www.w3.org/2000/svg";
210 declare option ver:module-version "2.0";
211
212 (:~
213- : Returns the width of the passed image.
214+ : <p>Returns the width of the passed image.</p>
215 :
216 : @param $image the image
217 : @return the width in pixels
218@@ -64,24 +64,24 @@
219 declare function basic:width($image as xs:base64Binary) as xs:unsignedInt external;
220
221 (:~
222- : Returns the height of the passed image.
223+ : <p>Returns the height of the passed image.</p>
224 :
225 : @param $image the image
226 : @return the height in pixels
227- : @error ierr:IM001 the passed image is invalid.
228+ : @error ierr:INVALID_IMAGE the passed image is invalid.
229 : @example test/Queries/image/basic_height.xq
230 :)
231 declare function basic:height($image as xs:base64Binary) as xs:unsignedInt external;
232
233
234 (:~
235- : Compresses the passed image.
236- : Compressing means lowering the quality and reducing the size.
237+ : <p>Compresses the passed image.</p>
238+ : <p>Compressing means lowering the quality and reducing the size.</p>
239 :
240 : @param $image the image
241 : @param $quality compression level, 0 to 100
242 : @return the compressed image
243- : @error ierr:IM001 the passed image is invalid.
244+ : @error ierr:INVALID_IMAGE the passed image is invalid.
245 : @example test/Queries/image/basic_compress.xq
246 :)
247 declare function basic:compress($image as xs:base64Binary, $quality as xs:unsignedInt) as xs:base64Binary external;
248@@ -89,12 +89,12 @@
249
250
251 (:~
252- : Converts an image to another format.
253+ : <p>Converts an image to another format.</p>
254 :
255 : @param $image the source image
256 : @param $format the format (see supported formats above) of the resulting image.
257 : @return A new image with the same content as the passed image but with the specified file format.
258- : @error ierr:IM001 the passed image is invalid.
259+ : @error ierr:INVALID_IMAGE the passed image is invalid.
260 : @error err:FORG0001 unsupported image format
261 : @example test/Queries/image/basic_convert.xq
262 :)
263@@ -107,17 +107,17 @@
264
265
266 (:~
267- : Returns the format of the passed image.
268+ : <p>Returns the format of the passed image.</p>
269 :
270 : @param $image the image
271 : @return the format
272- : @error ierr:IM001 the passed image is invalid.
273+ : @error ierr:INVALID_IMAGE the passed image is invalid.
274 : @example test/Queries/image/basic_type.xq
275 :)
276 declare function basic:format($image as xs:base64Binary) as xs:string external;
277
278 (:~
279- : Creates an empty image with background color white.
280+ : <p>Creates an empty image with background color white.</p>
281 :
282 : @param $width the width of the new image
283 : @param $height the height of the new image
284@@ -133,37 +133,37 @@
285 declare %private function basic:create-impl($width as xs:unsignedInt, $height as xs:unsignedInt, $format as xs:string) as xs:base64Binary external;
286
287 (:~
288- : Reads exif information from an image.
289- : This function works for JPEG and TIFF images only.
290- : It returns empty sequence if no exif information matching the passed tag is found.
291+ : <p>Reads exif information from an image.</p>
292+ : <p>This function works for JPEG and TIFF images only.</p>
293+ : <p>It returns empty sequence if no exif information matching the passed tag is found.</p>
294 :
295 : @param $image the image
296 : @param $tag the field name we want read (e.g. DateTime).
297 : @return exif field content
298- : @error ierr:IM001 the passed image is invalid.
299+ : @error ierr:INVALID_IMAGE the passed image is invalid.
300 : @example test/Queries/image/basic_exif.xq
301 :)
302 declare function basic:exif($image as xs:base64Binary, $tag as xs:string) as xs:string? external;
303
304 (:~
305- : Compares two images.
306+ : <p>Compares two images.</p>
307 :
308 : @param $image1 first image
309 : @param $image2 second image
310 : @return True if the images are equal.
311- : @error ierr:IM001 one of the passed images is invalid.
312+ : @error ierr:INVALID_IMAGE one of the passed images is invalid.
313 : @example test/Queries/image/basic_equals.xq
314 :)
315 declare function basic:equals($image1 as xs:base64Binary, $image2 as xs:base64Binary) as xs:boolean external;
316
317
318 (:~
319- : Converts an SVG image to a supported image format.
320+ : <p>Converts an SVG image to a supported image format.</p>
321 :
322 : @param $svg the image to convert
323 : @param $format target format
324 : @return the resulting image
325- : @error ierr:IM001 the passed SVG is invalid.
326+ : @error ierr:INVALID_IMAGE the passed SVG is invalid.
327 : @example test/Queries/image/basic_svg.xq
328 :)
329 declare function basic:convert-svg(
330@@ -182,12 +182,12 @@
331 };
332
333 (:~
334- : Converts an SVG image to a supported image format.
335+ : <p>Converts an SVG image to a supported image format.</p>
336 :
337 : @param $svg the image to convert as string
338 : @param $format target format
339 : @return the resulting image
340- : @error ierr:IM001 the passed SVG is invalid.
341+ : @error ierr:INVALID_IMAGE the passed SVG is invalid.
342 : @example test/Queries/image/basic_svg.xq
343 :)
344 declare function basic:convert-svg-string(
345
346=== renamed directory 'src/com/zorba-xquery/www/modules/image/basic.xq.src' => 'src/basic.xq.src'
347=== modified file 'src/basic.xq.src/basic_module.h'
348--- src/com/zorba-xquery/www/modules/image/basic.xq.src/basic_module.h 2011-10-06 08:18:47 +0000
349+++ src/basic.xq.src/basic_module.h 2013-10-23 04:15:35 +0000
350@@ -33,7 +33,7 @@
351
352
353 virtual String
354- getURI() const { return "http://www.zorba-xquery.com/modules/image/basic"; }
355+ getURI() const { return "http://zorba.io/modules/image/basic"; }
356
357 };
358
359
360=== removed directory 'src/com'
361=== removed file 'src/com/CMakeLists.txt'
362--- src/com/CMakeLists.txt 2011-10-06 08:18:47 +0000
363+++ src/com/CMakeLists.txt 1970-01-01 00:00:00 +0000
364@@ -1,17 +0,0 @@
365-# Copyright 2006-2008 The FLWOR Foundation.
366-#
367-# Licensed under the Apache License, Version 2.0 (the "License");
368-# you may not use this file except in compliance with the License.
369-# You may obtain a copy of the License at
370-#
371-# http://www.apache.org/licenses/LICENSE-2.0
372-#
373-# Unless required by applicable law or agreed to in writing, software
374-# distributed under the License is distributed on an "AS IS" BASIS,
375-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
376-# See the License for the specific language governing permissions and
377-# limitations under the License.
378-
379-# all external module libraries are generated in the directory
380-# of the corresponding .xq file
381-ADD_SUBDIRECTORY(zorba-xquery)
382
383=== removed directory 'src/com/zorba-xquery'
384=== removed file 'src/com/zorba-xquery/CMakeLists.txt'
385--- src/com/zorba-xquery/CMakeLists.txt 2011-10-06 08:18:47 +0000
386+++ src/com/zorba-xquery/CMakeLists.txt 1970-01-01 00:00:00 +0000
387@@ -1,17 +0,0 @@
388-# Copyright 2006-2008 The FLWOR Foundation.
389-#
390-# Licensed under the Apache License, Version 2.0 (the "License");
391-# you may not use this file except in compliance with the License.
392-# You may obtain a copy of the License at
393-#
394-# http://www.apache.org/licenses/LICENSE-2.0
395-#
396-# Unless required by applicable law or agreed to in writing, software
397-# distributed under the License is distributed on an "AS IS" BASIS,
398-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
399-# See the License for the specific language governing permissions and
400-# limitations under the License.
401-
402-# all external module libraries are generated in the directory
403-# of the corresponding .xq file
404-ADD_SUBDIRECTORY(www)
405
406=== removed directory 'src/com/zorba-xquery/www'
407=== removed file 'src/com/zorba-xquery/www/CMakeLists.txt'
408--- src/com/zorba-xquery/www/CMakeLists.txt 2011-10-06 08:18:47 +0000
409+++ src/com/zorba-xquery/www/CMakeLists.txt 1970-01-01 00:00:00 +0000
410@@ -1,17 +0,0 @@
411-# Copyright 2006-2008 The FLWOR Foundation.
412-#
413-# Licensed under the Apache License, Version 2.0 (the "License");
414-# you may not use this file except in compliance with the License.
415-# You may obtain a copy of the License at
416-#
417-# http://www.apache.org/licenses/LICENSE-2.0
418-#
419-# Unless required by applicable law or agreed to in writing, software
420-# distributed under the License is distributed on an "AS IS" BASIS,
421-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
422-# See the License for the specific language governing permissions and
423-# limitations under the License.
424-
425-# all external module libraries are generated in the directory
426-# of the corresponding .xq file
427-ADD_SUBDIRECTORY(modules)
428
429=== removed directory 'src/com/zorba-xquery/www/modules'
430=== removed file 'src/com/zorba-xquery/www/modules/CMakeLists.txt'
431--- src/com/zorba-xquery/www/modules/CMakeLists.txt 2011-10-06 08:18:47 +0000
432+++ src/com/zorba-xquery/www/modules/CMakeLists.txt 1970-01-01 00:00:00 +0000
433@@ -1,15 +0,0 @@
434-# Copyright 2006-2008 The FLWOR Foundation.
435-#
436-# Licensed under the Apache License, Version 2.0 (the "License");
437-# you may not use this file except in compliance with the License.
438-# You may obtain a copy of the License at
439-#
440-# http://www.apache.org/licenses/LICENSE-2.0
441-#
442-# Unless required by applicable law or agreed to in writing, software
443-# distributed under the License is distributed on an "AS IS" BASIS,
444-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
445-# See the License for the specific language governing permissions and
446-# limitations under the License.
447-
448-ADD_SUBDIRECTORY(image)
449\ No newline at end of file
450
451=== removed directory 'src/com/zorba-xquery/www/modules/image'
452=== removed file 'src/com/zorba-xquery/www/modules/image/CMakeLists.txt'
453--- src/com/zorba-xquery/www/modules/image/CMakeLists.txt 2012-10-29 20:36:25 +0000
454+++ src/com/zorba-xquery/www/modules/image/CMakeLists.txt 1970-01-01 00:00:00 +0000
455@@ -1,86 +0,0 @@
456-# Copyright 2006-2010 The FLWOR Foundation.
457-#
458-# Licensed under the Apache License, Version 2.0 (the "License");
459-# you may not use this file except in compliance with the License.
460-# You may obtain a copy of the License at
461-#
462-# http://www.apache.org/licenses/LICENSE-2.0
463-#
464-# Unless required by applicable law or agreed to in writing, software
465-# distributed under the License is distributed on an "AS IS" BASIS,
466-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
467-# See the License for the specific language governing permissions and
468-# limitations under the License.
469-#
470-
471-########################################################################
472-# ImageMagick
473-########################################################################
474-IF(ZORBA_SUPPRESS_ImageMagick)
475- MESSAGE(STATUS "ZORBA_SUPPRESS_ImageMagick is true - not searching for ImageMagick.")
476-ELSE(ZORBA_SUPPRESS_ImageMagick)
477- MESSAGE (STATUS "Looking for ImageMagick")
478- FIND_PACKAGE(ImageMagick COMPONENTS Magick++ MagickCore MagickWand)
479-
480- IF(ImageMagick_FOUND)
481- MESSAGE(STATUS "Found ImageMagick include dirs ${ImageMagick_INCLUDE_DIRS}")
482- MESSAGE(STATUS "Found ImageMagick libraries ${ImageMagick_LIBRARIES}")
483- INCLUDE_DIRECTORIES("${ImageMagick_INCLUDE_DIRS}")
484-
485- INCLUDE_DIRECTORIES("image_commons")
486- INCLUDE_DIRECTORIES("image_draw")
487- DECLARE_ZORBA_SCHEMA(FILE image.xsd
488- URI "http://www.zorba-xquery.com/modules/image/image")
489- DECLARE_ZORBA_MODULE(URI "http://www.zorba-xquery.com/modules/image/basic"
490- VERSION 2.0 FILE "basic.xq"
491- EXTRA_SOURCES image_commons image_draw
492- LINK_LIBRARIES ${ImageMagick_LIBRARIES})
493- DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "manipulation.xq"
494- URI "http://www.zorba-xquery.com/modules/image/manipulation"
495- EXTRA_SOURCES image_commons
496- LINK_LIBRARIES ${ImageMagick_LIBRARIES})
497- DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "paint.xq"
498- URI "http://www.zorba-xquery.com/modules/image/paint"
499- EXTRA_SOURCES image_draw image_commons
500- LINK_LIBRARIES ${ImageMagick_LIBRARIES})
501- DECLARE_ZORBA_MODULE(VERSION 1.0 FILE "animation.xq"
502- URI "http://www.zorba-xquery.com/modules/image/animation"
503- EXTRA_SOURCES image_commons
504- LINK_LIBRARIES ${ImageMagick_LIBRARIES})
505-
506- # this could crash because of the ImageMagick version
507- # must be compiled in debug mode
508- SET (KNOWN_CRASHES)
509- IF (WIN32)
510- IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
511- LIST (APPEND KNOWN_CRASHES
512- zorba_image_module/image/basic.xq 867693
513- zorba_image_module/image/basic_convert.xq 867693
514- zorba_image_module/image/basic_create.xq 867693
515- zorba_image_module/image/paint_1.xq 867693
516- zorba_image_module/image/paint_2.xq 867693
517- zorba_image_module/image/paint_3.xq 867693
518- zorba_image_module/image/paint_4.xq 867693
519- zorba_image_module/image/paint_5.xq 867693
520- zorba_image_module/image/paint_6.xq 867693
521- zorba_image_module/image/paint_circles.xq 867693
522- zorba_image_module/image/paint_different_lines.xq 867693
523- zorba_image_module/image/paint_polygon.xq 867693
524- zorba_image_module/image/paint_polyline.xq 867693
525- zorba_image_module/image/paint_rectangles.xq 867693
526- zorba_image_module/image/paint_stroked_polyline.xq 867693
527- zorba_image_module/image/paint_text.xq 867693
528- )
529- ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")
530- ENDIF (WIN32)
531-
532- ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test" "${KNOWN_CRASHES}")
533-
534- ELSE (ImageMagick_FOUND)
535- MESSAGE(STATUS "Magick++ component found: ${ImageMagick_Magick++_FOUND}")
536- MESSAGE(STATUS "MagickCore component found: ${ImageMagick_MagickCore_FOUND}")
537- MESSAGE(STATUS "MagickWand component found: ${ImageMagick_MagickWand_FOUND}")
538- MESSAGE(STATUS "If you want to use image handling functionality please install the ImageMagick library containing these 3 components: Magick++, MagickCore, MagickWand.\n Please note that on some OS\n- ImageMagick and\n- libMagick++ (on OpenSuse) or ImageMagick-c++(on Fedora)\n are 2 different packages and you need to install both of them and additionally their development packages.")
539- ENDIF (ImageMagick_FOUND)
540-ENDIF(ZORBA_SUPPRESS_ImageMagick)
541-MESSAGE(STATUS "")
542
543=== added file 'src/image.jsd'
544--- src/image.jsd 1970-01-01 00:00:00 +0000
545+++ src/image.jsd 2013-10-23 04:15:35 +0000
546@@ -0,0 +1,360 @@
547+{
548+ "$namespace" : "http://zorba.io/modules/images/"
549+ "$types" : [
550+ {
551+ "$name" : "imageFormat",
552+ "$about" : "This schema defines the different types used in the modules under:
553+ http://zorba.io/modules/images/",
554+ "$kind" : "atomic",
555+ "$baseType" : "string",
556+ "$enumarion" : [ "GIF", "PNG", "JPEG", "TIFF", "BMP" ]
557+ },
558+ {
559+ "$name" : "colorType",
560+ "$about" : "This type defines how colors should be formatted.",
561+ "$kind" : "atomic",
562+ "$baseType" : "string",
563+ "$length" : 7,
564+ "$pattern" : "[#]([A-F0-9]{6})"
565+ },
566+ {
567+ "$name" : "noiseType",
568+ "$about" : "This type defines the different names that are allowed as noise identifiers.",
569+ "$kind" : "atomic",
570+ "$baseType" : "string",
571+ "$enumarion" : [ "UniformNoise", "GaussianNoise", "MultiplicativeGaussianNoise", "ImpulseNoise", "LaplacianNoise", "PoissonNoise" ]
572+ },
573+ {
574+ "$name" : "compositeOperatorType",
575+ "$about" : "This type defines the different operators applicable for overlaying images.
576+ OverCompositeOp: The result is the union of the the two image shapes with the composite image obscuring image in the region of overlap.
577+ InCompositeOp: The result is a simply composite image cut by the shape of image. None of the image data of image is included in the result.
578+ OutCompositeOp: The resulting image is composite image with the shape of image cut out.
579+ AtopCompositeOp: The result is the same shape as image image, with composite image obscuring image there the image shapes overlap. Note that this differs from OverCompositeOp because the portion of composite image outside of image's shape does not appear in the result.
580+ XorCompositeOp: The result is the image data from both composite image and image that is outside the overlap region. The overlap region will be blank.
581+ PlusCompositeOp: The result is just the sum of the image data. Output values are cropped to 255 (no overflow). This operation is independent of the matte channels.
582+ MinusCompositeOp: The result of composite image - image, with overflow cropped to zero. The matte chanel is ignored (set to 255, full coverage).
583+ AddCompositeOp: The result of composite image + image, with overflow wrapping around (mod 256).
584+ SubtractCompositeOp: The result of composite image - image, with underflow wrapping around (mod 256). The add and subtract operators can be used to perform reverible transformations.
585+ DifferenceCompositeOp: The result of abs(composite image - image). This is useful for comparing two very similar images.
586+ BumpmapCompositeOp: The result image shaded by composite image."
587+ "$kind" : "atomic",
588+ "$baseType" : "string",
589+ "$enumarion" : [ "OverCompositeOp", "InCompositeOp", "OutCompositeOp", "AtopCompositeOp", "XorCompositeOp", "PlusCompositeOp", "MinusCompositeOp", "AddCompositeOp", "SubtractCompositeOp", "DifferenceCompositeOp", "BumpmapCompositeOp" ]
590+ },
591+ {
592+ "$name" : "pointType",
593+ "$kind" : "array",
594+ "$content" : [ "integer" ],
595+ "$minLength" : 2,
596+ "$maxLength" : 2
597+ },
598+ {
599+ "$name" : "pointsType",
600+ "$kind" : "array",
601+ "$content" : [ "pointType" ],
602+ "$minLength" : 1
603+ },
604+ {
605+ "$name" : "line",
606+ "$kind" : "object",
607+ "$content" : {
608+ "start" : {
609+ "$type" : "pointType"
610+ },
611+ "end" : {
612+ "$type" : "pointType"
613+ },
614+ "strokeWidth" : {
615+ "$type" : "double",
616+ "$optional" : true
617+ },
618+ "strokeColor" : {
619+ "$type" : "colorType",
620+ "optional" : true
621+ },
622+ "fillColor" : {
623+ "$type" : "colorType",
624+ "optional" : true
625+ },
626+ "antiAliasing" : {
627+ "$type" : "boolean",
628+ "optional" : true
629+ }
630+ }
631+ },
632+ {
633+ "$name" : "polyLine",
634+ "$kind" : "object"
635+ "$content" : {
636+ "points" : {
637+ "$type" : "pointsType"
638+ },
639+ "strokeWidth" : {
640+ "$type" : "double",
641+ "$optional" : true
642+ },
643+ "strokeColor" : {
644+ "$type" : "colorType",
645+ "optional" : true
646+ },
647+ "fillColor" : {
648+ "$type" : "colorType",
649+ "optional" : true
650+ },
651+ "antiAliasing" : {
652+ "$type" : "boolean",
653+ "optional" : true
654+ }
655+ }
656+ },
657+ {
658+ "$name" : "strokedPolyLine"
659+ "$kind" : "object"
660+ "$content" : {
661+ "points" : {
662+ "$type" : "pointsType"
663+ },
664+ "strokeLength" : {
665+ "$type" : "double"
666+ },
667+ "gapLength" : {
668+ "$type" : "double"
669+ },
670+ "strokeWidth" : {
671+ "$type" : "double",
672+ "$optional" : true
673+ },
674+ "strokeColor" : {
675+ "$type" : "colorType",
676+ "optional" : true
677+ },
678+ "fillColor" : {
679+ "$type" : "colorType",
680+ "optional" : true
681+ },
682+ "antiAliasing" : {
683+ "$type" : "boolean",
684+ "optional" : true
685+ }
686+ }
687+ },
688+ {
689+ "$name" : "rectangle",
690+ "$kind" : "object",
691+ "$content" : {
692+ "upperLeft" : {
693+ "$type" : "pointType"
694+ },
695+ "lowerRight" : {
696+ "$type" : "pointType"
697+ },
698+ "strokeWidth" : {
699+ "$type" : "double",
700+ "$optional" : true
701+ },
702+ "strokeColor" : {
703+ "$type" : "colorType",
704+ "optional" : true
705+ },
706+ "fillColor" : {
707+ "$type" : "colorType",
708+ "optional" : true
709+ },
710+ "antiAliasing" : {
711+ "$type" : "boolean",
712+ "optional" : true
713+ }
714+ }
715+ },
716+ {
717+ "$name" : "roundedRectangle",
718+ "$kind" : "object",
719+ "$content" : {
720+ "upperLeft" : {
721+ "$type" : "pointType"
722+ },
723+ "lowerRight" : {
724+ "$type" : "pointType"
725+ },
726+ "cornerWidth" : {
727+ "$type" : "double"
728+ },
729+ "cornerHeight" : {
730+ "$type" : "double"
731+ },
732+ "strokeWidth" : {
733+ "$type" : "double",
734+ "$optional" : true
735+ },
736+ "strokeColor" : {
737+ "$type" : "colorType",
738+ "optional" : true
739+ },
740+ "fillColor" : {
741+ "$type" : "colorType",
742+ "optional" : true
743+ },
744+ "antiAliasing" : {
745+ "$type" : "boolean",
746+ "optional" : true
747+ }
748+ }
749+ },
750+ {
751+ "$name" : "circle",
752+ "$kind" : "object",
753+ "$content" : {
754+ "origin" : {
755+ "$type" : "pointType"
756+ },
757+ "radius" : {
758+ "$type" : "double"
759+ },
760+ "strokeWidth" : {
761+ "$type" : "double",
762+ "$optional" : true
763+ },
764+ "strokeColor" : {
765+ "$type" : "colorType",
766+ "optional" : true
767+ },
768+ "fillColor" : {
769+ "$type" : "colorType",
770+ "optional" : true
771+ },
772+ "antiAliasing" : {
773+ "$type" : "boolean",
774+ "optional" : true
775+ }
776+ }
777+ },
778+ {
779+ "$name" : "ellipse",
780+ "$kind" : "object",
781+ "$content" : {
782+ "origin" : {
783+ "$type" : "pointType"
784+ },
785+ "radiusX" : {
786+ "$type" : "double"
787+ },
788+ "radiusY" : {
789+ "$type" : "double"
790+ },
791+ "strokeWidth" : {
792+ "$type" : "double",
793+ "$optional" : true
794+ },
795+ "strokeColor" : {
796+ "$type" : "colorType",
797+ "optional" : true
798+ },
799+ "fillColor" : {
800+ "$type" : "colorType",
801+ "optional" : true
802+ },
803+ "antiAliasing" : {
804+ "$type" : "boolean",
805+ "optional" : true
806+ }
807+ }
808+ },
809+ {
810+ "$name" : "arc",
811+ "$kind" : "object",
812+ "$content" : {
813+ "origin" : {
814+ "$type" : "pointType"
815+ },
816+ "radiusX" : {
817+ "$type" : "double"
818+ },
819+ "radiusY" : {
820+ "$type" : "double"
821+ },
822+ "startDegrees" : {
823+ "$type" : "double"
824+ },
825+ "endDegrees" : {
826+ "$type" : "double"
827+ },
828+ "strokeWidth" : {
829+ "$type" : "double",
830+ "$optional" : true
831+ },
832+ "strokeColor" : {
833+ "$type" : "colorType",
834+ "optional" : true
835+ },
836+ "fillColor" : {
837+ "$type" : "colorType",
838+ "optional" : true
839+ },
840+ "antiAliasing" : {
841+ "$type" : "boolean",
842+ "optional" : true
843+ }
844+ }
845+ },
846+ {
847+ "$name" : "polygon",
848+ "$kind" : "object",
849+ "$content" : {
850+ "points" : {
851+ "$kind" : "pointsType"
852+ },
853+ "strokeWidth" : {
854+ "$type" : "double",
855+ "$optional" : true
856+ },
857+ "strokeColor" : {
858+ "$type" : "colorType",
859+ "optional" : true
860+ },
861+ "fillColor" : {
862+ "$type" : "colorType",
863+ "optional" : true
864+ },
865+ "antiAliasing" : {
866+ "$type" : "boolean",
867+ "optional" : true
868+ }
869+ }
870+ },
871+ {
872+ "$name" : "text",
873+ "$kind" : "object",
874+ "$content" : {
875+ "origin" : {
876+ "$type" : "pointType"
877+ },
878+ "text" : {
879+ "$type" : "string"
880+ },
881+ "font" : {
882+ "$type" : "string"
883+ },
884+ "fontSize" : {
885+ "$type" : "double"
886+ },
887+ "strokeWidth" : {
888+ "$type" : "double",
889+ "$optional" : true
890+ },
891+ "strokeColor" : {
892+ "$type" : "colorType",
893+ "optional" : true
894+ },
895+ "fillColor" : {
896+ "$type" : "colorType",
897+ "optional" : true
898+ },
899+ "antiAliasing" : {
900+ "$type" : "boolean",
901+ "optional" : true
902+ }
903+ }
904+ }
905+ ]
906+}
907\ No newline at end of file
908
909=== renamed file 'src/com/zorba-xquery/www/modules/image/image.xsd' => 'src/image.xsd'
910--- src/com/zorba-xquery/www/modules/image/image.xsd 2011-08-07 00:38:36 +0000
911+++ src/image.xsd 2013-10-23 04:15:35 +0000
912@@ -1,8 +1,8 @@
913 <?xml version="1.0" encoding="UTF-8"?>
914 <schema
915 xmlns="http://www.w3.org/2001/XMLSchema"
916- targetNamespace="http://www.zorba-xquery.com/modules/image/image"
917- xmlns:image="http://www.zorba-xquery.com/modules/image/image"
918+ targetNamespace="http://zorba.io/modules/image/image"
919+ xmlns:image="http://zorba.io/modules/image/image"
920 elementFormDefault="qualified">
921
922 <!--
923@@ -25,7 +25,7 @@
924 <annotation xml:lang="en">
925 <documentation>
926 This schema defines the different types used in the modules under:
927- http://www.zorba-xquery.com/modules/images/
928+ http://zorba.io/modules/images/
929 </documentation>
930 </annotation>
931
932
933=== renamed directory 'src/com/zorba-xquery/www/modules/image/image_commons' => 'src/image_commons'
934=== modified file 'src/image_commons/image_function.cpp'
935--- src/com/zorba-xquery/www/modules/image/image_commons/image_function.cpp 2013-07-31 21:49:56 +0000
936+++ src/image_commons/image_function.cpp 2013-10-23 04:15:35 +0000
937@@ -55,8 +55,8 @@
938 ImageFunction::throwImageError(const DynamicContext* aDynamicContext, const char *aMessage) {
939 std::stringstream lErrorMessage;
940 // constuct error QName
941- String lNamespace = "http://www.zorba-xquery.com/modules/image/error";
942- String lLocalname = "IM001";
943+ String lNamespace = "http://zorba.io/modules/image/error";
944+ String lLocalname = "INVALID_IMAGE";
945 Item lQName = ImageModule::getItemFactory()->createQName(lNamespace, "image", lLocalname);
946 // if we have zero length image, then tell the user so
947 if (std::string(aMessage).find("zero-length") != std::string::npos) {
948@@ -70,7 +70,7 @@
949
950 void
951 ImageFunction::throwErrorWithQName (const DynamicContext* aDynamicContext, const String& aLocalName, const String& aMessage) {
952- String lNamespace = "http://www.zorba-xquery.com/modules/image/error";
953+ String lNamespace = "http://zorba.io/modules/image/error";
954 Item lQName = ImageModule::getItemFactory()->createQName(lNamespace, "image", aLocalName);
955 USER_EXCEPTION(lQName, aMessage);
956 }
957
958=== modified file 'src/image_commons/image_module.h'
959--- src/com/zorba-xquery/www/modules/image/image_commons/image_module.h 2012-08-31 22:09:12 +0000
960+++ src/image_commons/image_module.h 2013-10-23 04:15:35 +0000
961@@ -54,7 +54,7 @@
962
963 public:
964 virtual String
965- getURI() const { return "http://www.zorba-xquery.com/modules/image/"; }
966+ getURI() const { return "http://zorba.io/modules/image/"; }
967
968 ImageModule()
969 {
970
971=== renamed directory 'src/com/zorba-xquery/www/modules/image/image_draw' => 'src/image_draw'
972=== renamed file 'src/com/zorba-xquery/www/modules/image/manipulation.xq' => 'src/manipulation.xq'
973--- src/com/zorba-xquery/www/modules/image/manipulation.xq 2013-10-12 01:08:44 +0000
974+++ src/manipulation.xq 2013-10-23 04:15:35 +0000
975@@ -17,43 +17,43 @@
976
977
978 (:~
979- : This module provides functions to handle image manipulations like resizing, zooming,
980- : special effects etc.
981+ : <p>This module provides functions to handle image manipulations like resizing, zooming,
982+ : special effects etc.</p>
983 :
984 : <p>The errors raised by functions of this module have the namespace
985- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
986+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
987 :
988 : @author Daniel Thomas
989 : @library <a href="http://www.imagemagick.org/Magick++/">Magick++ C++ Library</a>
990 : @project Zorba/Image/Manipulation
991 :
992 :)
993-module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
994+module namespace man = 'http://zorba.io/modules/image/manipulation';
995
996-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
997+import schema namespace image = 'http://zorba.io/modules/image/image';
998
999 declare namespace err = "http://www.w3.org/2005/xqt-errors";
1000-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";
1001+declare namespace ierr = "http://zorba.io/modules/image/error";
1002 declare namespace ver = "http://zorba.io/options/versioning";
1003 declare option ver:module-version "1.0";
1004
1005 (:~
1006- : Get a copy of the passed image with changed width and height (without
1007- : zooming the image's content).
1008- : To change the size of the actual contents of an image, use the zoom function.
1009- :
1010- : More in detail: If the new dimensions are greater than the current dimensions
1011+ : <p>Get a copy of the passed image with changed width and height (without
1012+ : zooming the image's content).</p>
1013+ : <p>To change the size of the actual contents of an image, use the zoom function.</p>
1014+ : <p/>
1015+ : <p>More in detail: If the new dimensions are greater than the current dimensions
1016 : the new image will have the passed image in the upper left corner and the rest
1017- : will be filled with the current background color.
1018- : If the passed dimensions are less than the current dimensions, the new image
1019+ : will be filled with the current background color.</p>
1020+ : <p>If the passed dimensions are less than the current dimensions, the new image
1021 : will contain the specified rectangle of the passed image beginning at the upper
1022- : left corner.
1023+ : left corner.</p>
1024 :
1025 : @param $image image to resize
1026 : @param $width new width
1027 : @param $height new height
1028 : @return resized copy of the source image
1029- : @error ierr:IM001 passed image is invalid.
1030+ : @error ierr:INVALID_IMAGE passed image is invalid.
1031 : @example test/Queries/image/manipulation_resize.xq
1032 :)
1033 declare function man:resize($image as xs:base64Binary,
1034@@ -61,34 +61,34 @@
1035 $height as xs:unsignedInt) as xs:base64Binary external;
1036
1037 (:~
1038- : Zoom the passed image by the specified factor while keeping the ratio between
1039- : width and height.
1040- :
1041- : A ratio of less than 1 will make the image smaller.
1042- : A ratio of less or equal than 0 will not effect the image.
1043- : Important note: this function does not change the size information stored in the
1044- : image (e.g. basic:width will not show a different value).
1045+ : <p>Zoom the passed image by the specified factor while keeping the ratio between
1046+ : width and height.</p>
1047+ : <p/>
1048+ : <p>A ratio of less than 1 will make the image smaller.</p>
1049+ : <p>A ratio of less or equal than 0 will not effect the image.</p>
1050+ : <p>Important note: this function does not change the size information stored in the
1051+ : image (e.g. basic:width will not show a different value).</p>
1052 :
1053 : @param $image image to resize
1054 : @param $ratio ratio to zoom width and height by
1055 : @return A copy of $image with resized content
1056- : @error ierr:IM001 passed image is invalid
1057+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1058 : @example test/Queries/image/manipulation_zoom.xq
1059 :)
1060 declare function man:zoom($image as xs:base64Binary,
1061 $ratio as xs:double) as xs:base64Binary external;
1062
1063 (:~
1064- : Zoom the passed image to a given new width while keeping the ratio between
1065- : width and height.
1066- : So, the height is scaled accordingly.
1067- : Important note: this function does not change the size information stored
1068- : in the image (e.g. basic:width will not show a different value).
1069+ : <p>Zoom the passed image to a given new width while keeping the ratio between
1070+ : width and height.</p>
1071+ : <p>So, the height is scaled accordingly.</p>
1072+ : <p>Important note: this function does not change the size information stored
1073+ : in the image (e.g. basic:width will not show a different value).</p>
1074 :
1075 : @param $image image to resize
1076 : @param $width new width for the image in pixels
1077 : @return A copy of $image with given $width and height changed accordingly
1078- : @error ierr:IM001 passed image is invalid
1079+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1080 : @example test/Queries/image/manipulation_zoom_width.xq
1081 :)
1082 declare function man:zoom-by-width($image as xs:base64Binary,
1083@@ -96,26 +96,26 @@
1084
1085
1086 (:~
1087- : Zoom the passed image to a given new height while keeping the ratio between
1088- : width and height.
1089- : So, the width is scaled accordingly.
1090- : Important note: this function does not change the size information stored
1091- : in the image (e.g. basic:width will not show a different value).
1092+ : <p>Zoom the passed image to a given new height while keeping the ratio between
1093+ : width and height.</p>
1094+ : <p>So, the width is scaled accordingly.</p>
1095+ : <p>Important note: this function does not change the size information stored
1096+ : in the image (e.g. basic:width will not show a different value).</p>
1097 :
1098 : @param $image image to resize
1099 : @param $height new height for the image in pixels
1100 : @return A copy of $image with given $height and width adjusted accordingly
1101- : @error ierr:IM001 passed image is invalid
1102+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1103 : @example test/Queries/image/manipulation_zoom_height.xq
1104 :)
1105 declare function man:zoom-by-height($image as xs:base64Binary,
1106 $height as xs:unsignedInt) as xs:base64Binary external;
1107
1108 (:~
1109- : Copy a part of the source image specified by a rectangle.
1110- : If the passed parameters for the sub-image specify a rectangle that isn't
1111+ : <p>Copy a part of the source image specified by a rectangle.</p>
1112+ : <p>If the passed parameters for the sub-image specify a rectangle that isn't
1113 : entirely within the source image only the area that lies within the image
1114- : boundaries will be returned.
1115+ : boundaries will be returned.</p>
1116 :
1117 : @param $image the image from which to extract a sub-image
1118 : @param $left-upper-x is the x value of the upper left corner of the rectangle
1119@@ -125,7 +125,7 @@
1120 : @param $width width of the rectangle to cut out
1121 : @param $height height of the rectangle to cut out
1122 : @return A new image containing parts of the source image
1123- : @error ierr:IM001 passed image is invalid
1124+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1125 : @example test/Queries/image/manipulation_sub_image.xq
1126 :)
1127 declare function man:sub-image($image as xs:base64Binary,
1128@@ -135,10 +135,10 @@
1129 $height as xs:unsignedInt) as xs:base64Binary external;
1130
1131 (:~
1132- : Overlay $image with $overlay-image at the specfied position.
1133- :
1134- : The $operator defines the details of the overlay and can have one of the
1135- : following values:
1136+ : <p>Overlay $image with $overlay-image at the specfied position.</p>
1137+ : <p/>
1138+ : <p>The $operator defines the details of the overlay and can have one of the
1139+ : following values:</p>
1140 : <ul>
1141 : <li>OverCompositeOp: The result is the union of the two image shapes
1142 : with the overlay image obscuring image in the region of overlap.</li>
1143@@ -178,7 +178,7 @@
1144 : @param $operator defines how the overlay image should be overlayed (see details
1145 : in operator listing above)
1146 : @return A new image consisting of $image overlayed with $overlay-image.
1147- : @error ierr:IM001 passed image is invalid
1148+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1149 : @error err:FORG0001 unsupported operator
1150 : @example test/Queries/image/manipulation_overlay.xq
1151 :)
1152@@ -202,14 +202,14 @@
1153 as xs:base64Binary external;
1154
1155 (:~
1156- : Copy a part of a source image as new image.
1157- : The copied part is all right of $upper-left-x and below $upper-left-y.
1158+ : <p>Copy a part of a source image as new image.</p>
1159+ : <p>The copied part is all right of $upper-left-x and below $upper-left-y.</p>
1160 :
1161 : @param $image source image
1162 : @param $upper-left-x x position of the upper left corner of the part to copy
1163 : @param $upper-left-y y position of the upper left corner of the part to copy
1164 : @return A new image copied from a part of source image
1165- : @error ierr:IM001 passed image is invalid
1166+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1167 : @example test/Queries/image/manipulation_chop.xq
1168 :)
1169 declare function man:chop($image as xs:base64Binary,
1170@@ -217,14 +217,14 @@
1171 $upper-left-y as xs:unsignedInt) as xs:base64Binary external;
1172
1173 (:~
1174- : Copy a part of a source image as new image.
1175- : The copied part is all left of $lower-right-x and above $lower-right-y.
1176+ : <p>Copy a part of a source image as new image.</p>
1177+ : <p>The copied part is all left of $lower-right-x and above $lower-right-y.</p>
1178 :
1179 : @param $image source image
1180 : @param $lower-right-x x position of the lower right corner of the part to copy
1181 : @param $lower-right-y y position of the lower right corner of the part to copy
1182 : @return A new image copied from a part of source image
1183- : @error ierr:IM001 passed image is invalid
1184+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1185 : @example test/Queries/image/manipulation_crop.xq
1186 :)
1187 declare function man:crop($image as xs:base64Binary,
1188@@ -233,16 +233,16 @@
1189
1190
1191 (:~
1192- : Get a new image as rotated copy of a passed source image (rotated by -360 to
1193- : 360 degrees).
1194- : The image is enlarged if this is required for containing the rotated image,
1195- : but never shrunk even if the rotation would make a smaller image possible.
1196+ : <p>Get a new image as rotated copy of a passed source image (rotated by -360 to
1197+ : 360 degrees).</p>
1198+ : <p>The image is enlarged if this is required for containing the rotated image,
1199+ : but never shrunk even if the rotation would make a smaller image possible.</p>
1200 :
1201 : @param $image source image.
1202 : @param $angle between -360 to 360 degrees. Other values will be adjusted by
1203 : modulo 360
1204 : @return A rotated copy of $image
1205- : @error ierr:IM001 passed image is invalid
1206+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1207 : @example test/Queries/image/manipulation_rotate.xq
1208 :)
1209 declare function man:rotate($image as xs:base64Binary,
1210@@ -250,50 +250,50 @@
1211
1212
1213 (:~
1214- : Set all pixels of the image to the current backround color.
1215- : In most cases, this will result in all pixels to be set to white.
1216+ : <p>Set all pixels of the image to the current backround color.</p>
1217+ : <p>In most cases, this will result in all pixels to be set to white.</p>
1218 :
1219 : @param $image image to erase
1220 : @return A copy of image with all pixels set to the current background color
1221- : @error ierr:IM001 passed image is invalid
1222+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1223 : @example test/Queries/image/manipulation_erase.xq
1224 :)
1225 declare function man:erase($image as xs:base64Binary) as xs:base64Binary external;
1226
1227 (:~
1228- : Flop an image (horizontal rotation).
1229+ : <p>Flop an image (horizontal rotation).</p>
1230 :
1231 : @param $image source image
1232 : @return A horizontally rotated copy of $image
1233- : @error ierr:IM001 passed image is invalid
1234+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1235 : @example test/Queries/image/manipulation_flop.xq
1236 :)
1237 declare function man:flop($image as xs:base64Binary) as xs:base64Binary external;
1238
1239 (:~
1240- : Flip an image (vertical rotation).
1241+ : <p>Flip an image (vertical rotation).</p>
1242 :
1243 : @param $image source image
1244 : @return A vertically rotated copy of $image
1245- : @error ierr:IM001 passed image is invalid
1246+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1247 : @example test/Queries/image/manipulation_flip.xq
1248 :)
1249 declare function man:flip($image as xs:base64Binary) as xs:base64Binary external;
1250
1251 (:~
1252- : Trim edges of the image's background color from the image.
1253+ : <p>Trim edges of the image's background color from the image.</p>
1254 :
1255 : @param $image the source image
1256 : @return A trimmed copy of $image
1257- : @error ierr:IM001 passed image is invalid
1258+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1259 : @example test/Queries/image/manipulation_trim.xq
1260 :)
1261 declare function man:trim($image as xs:base64Binary) as xs:base64Binary external;
1262
1263 (:~
1264- : Add noise to an image.
1265- :
1266- : Allowed noise types are:
1267+ : <p>Add noise to an image.</p>
1268+ : <p/>
1269+ : <p>Allowed noise types are:</p>
1270 : <ul>
1271 : <li>UniformNoise</li>
1272 : <li>GaussianNoise</li>
1273@@ -306,7 +306,7 @@
1274 : @param $image the source image
1275 : @param $noise-type specifies the type of noise to add
1276 : @return A copy of $image with added noise
1277- : @error ierr:IM001 passed image is invalid
1278+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1279 : @error err:FORG0001 unsupported noise type
1280 : @example test/Queries/image/manipulation_add_noise.xq
1281 :)
1282@@ -320,13 +320,13 @@
1283 as xs:base64Binary external;
1284
1285 (:~
1286- : Blur an image.
1287+ : <p>Blur an image.</p>
1288 :
1289 : @param $image the source image
1290 : @param $radius is the radius of the Gaussian in pixels.
1291 : @param $sigma is the standard deviation of the Laplacian in pixels.
1292 : @return A blured copy of $image
1293- : @error ierr:IM001 passed image is invalid
1294+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1295 : @example test/Queries/image/manipulation_blur.xq
1296 :)
1297 declare function man:blur($image as xs:base64Binary,
1298@@ -334,55 +334,55 @@
1299 $sigma as xs:int) as xs:base64Binary external;
1300
1301 (:~
1302- : Despeckle an image.
1303+ : <p>Despeckle an image.</p>
1304 :
1305 : @param $image the source image
1306 : @return A despeckled copy of $image
1307- : @error ierr:IM001 passed image is invalid
1308+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1309 : @example test/Queries/image/manipulation_despeckle.xq
1310 :)
1311 declare function man:despeckle($image as xs:base64Binary) as xs:base64Binary external;
1312
1313 (:~
1314- : Enhance an images (minimizes noise).
1315+ : <p>Enhance an images (minimizes noise).</p>
1316 :
1317 : @param $image the source image
1318 : @return An enhanced copy of $image.
1319- : @error ierr:IM001 passed image is invalid
1320+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1321 : @example test/Queries/image/manipulation_enhance.xq
1322 :)
1323 declare function man:enhance($image as xs:base64Binary) as xs:base64Binary external;
1324
1325 (:~
1326- : Equalize an images (histogramm equalization).
1327+ : <p>Equalize an images (histogramm equalization).</p>
1328 :
1329 : @param $image the source image
1330 : @return An equalized copy of $image.
1331- : @error ierr:IM001 passed image is invalid
1332+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1333 : @example test/Queries/image/manipulation_equalize.xq
1334 :)
1335 declare function man:equalize($image as xs:base64Binary) as xs:base64Binary external;
1336
1337 (:~
1338- : Highlight edges in an image.
1339+ : <p>Highlight edges in an image.</p>
1340 :
1341 : @param $image the source image
1342 : @param $radius radius of the pixel neighborhood (0 for automatic selection)
1343 : @return An edged copy of $image
1344- : @error ierr:IM001 passed image is invalid
1345+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1346 : @example test/Queries/image/manipulation_edge.xq
1347 :)
1348 declare function man:edge($image as xs:base64Binary,
1349 $radius as xs:unsignedInt) as xs:base64Binary external;
1350
1351 (:~
1352- : Apply a charcoal effect to the image (looks like a charcoal sketch).
1353+ : <p>Apply a charcoal effect to the image (looks like a charcoal sketch).</p>
1354 :
1355 : @param $image the source image
1356 : @param $radius radius of the Gaussian in pixels
1357 : @param $sigma standard deviation of the Laplacian in pixels
1358 : @return A charcoaled copy of $image
1359- : @error ierr:IM001 passed image is invalid
1360+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1361 : @example test/Queries/image/manipulation_charcoal.xq
1362 :)
1363 declare function man:charcoal($image as xs:base64Binary,
1364@@ -390,13 +390,13 @@
1365 $sigma as xs:double) as xs:base64Binary external;
1366
1367 (:~
1368- : Emboss an images (highlights edges with 3D effect).
1369+ : <p>Emboss an images (highlights edges with 3D effect).</p>
1370 :
1371 : @param $image the source image
1372 : @param $radius radius of the Gaussian in pixels
1373 : @param $sigma standard deviation of the Laplacian in pixels
1374 : @return An embossed copy of $image
1375- : @error ierr:IM001 passed image is invalid
1376+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1377 : @example test/Queries/image/manipulation_emboss.xq
1378 :)
1379 declare function man:emboss($image as xs:base64Binary,
1380@@ -404,23 +404,23 @@
1381 $sigma as xs:double) as xs:base64Binary external;
1382
1383 (:~
1384- : Apply a solarize effect to the image (similar to the effect seen when
1385- : exposing a photographic film to light during the development process).
1386+ : <p>Apply a solarize effect to the image (similar to the effect seen when
1387+ : exposing a photographic film to light during the development process).</p>
1388 :
1389 : @param $image the source image
1390 : @param $factor strength of the solarization (0 to 65535; 65535=100%)
1391 : @return A solarized copy of $image.
1392- : @error ierr:IM001 passed image is invalid
1393+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1394 : @example test/Queries/image/manipulation_solarize.xq
1395 :)
1396 declare function man:solarize($image as xs:base64Binary,
1397 $factor as xs:double) as xs:base64Binary external;
1398
1399 (:~
1400- : Make two passed images appear as stereo image when viewed with red-blue glasses.
1401- : Both images should be same but from a slightly different angle for this to work.
1402- : Both images should have the same size, if not, the size of the left image will
1403- : be taken.
1404+ : <p>Make two passed images appear as stereo image when viewed with red-blue glasses.</p>
1405+ : <p>Both images should be same but from a slightly different angle for this to work.</p>
1406+ : <p>Both images should have the same size, if not, the size of the left image will
1407+ : be taken.</p>
1408 :
1409 : @param $left-image left image for the stereo image.
1410 : @param $right-image right image for the stereo image.
1411@@ -432,15 +432,15 @@
1412 $right-image as xs:base64Binary) as xs:base64Binary external;
1413
1414 (:~
1415- : Make all pixels of the specfied color transparent.
1416- :
1417- : This works correctly only with image types supporting transparency
1418- : (e.g GIF or PNG).
1419+ : <p>Make all pixels of the specfied color transparent.</p>
1420+ : <p/>
1421+ : <p>This works correctly only with image types supporting transparency
1422+ : (e.g GIF or PNG).</p>
1423 :
1424 : @param $image the source image
1425 : @param $color color to make transparent (e.g. '#FFFFFF')
1426 : @return A copy of $image with the specified color made transparent.
1427- : @error ierr:IM001 passed image is invalid
1428+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1429 : @error err:FORG0001 unsupported color
1430 : @example test/Queries/image/manipulation_transparent.xq
1431 :)
1432@@ -452,64 +452,64 @@
1433 declare %private function man:transparent-impl($image as xs:base64Binary, $color as image:colorType) as xs:base64Binary external;
1434
1435 (:~
1436- : Swirl an image (image pixels are rotated by degree).
1437+ : <p>Swirl an image (image pixels are rotated by degree).</p>
1438 :
1439 : @param $image the source image
1440 : @param $degree degree to swirl image pixels
1441 : @return A swirled copy of $image
1442- : @error ierr:IM001 passed image is invalid
1443+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1444 : @example test/Queries/image/manipulation_swirl.xq
1445 :)
1446 declare function man:swirl($image as xs:base64Binary,
1447 $degree as xs:double) as xs:base64Binary external;
1448
1449 (:~
1450- : Reduce noise of an image using a noise peak elemination filter.
1451+ : <p>Reduce noise of an image using a noise peak elemination filter.</p>
1452 :
1453 : @param $image the source image
1454 : @param $order defines how much the noise is reduced
1455 : @return A copy of $image with reduced noise
1456- : @error ierr:IM001 passed image is invalid
1457+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1458 : @example test/Queries/image/manipulation_reduce_noise.xq
1459 :)
1460 declare function man:reduce-noise($image as xs:base64Binary,
1461 $order as xs:double) as xs:base64Binary external;
1462
1463 (:~
1464- : Contrast an image (enhances image intensity differences) by a given value.
1465+ : <p>Contrast an image (enhances image intensity differences) by a given value.</p>
1466 :
1467 : @param $image the source image
1468 : @param $sharpen defines how much the image is contrasted.
1469 : @return A contrasted copy of $image
1470- : @error ierr:IM001 passed image is invalid
1471+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1472 : @example test/Queries/image/manipulation_contrast.xq
1473 :)
1474 declare function man:contrast($image as xs:base64Binary,
1475 $sharpen as xs:double) as xs:base64Binary external;
1476
1477 (:~
1478- : Gamma correct an image.
1479- : Gamma values less than zero will erase the image.
1480+ : <p>Gamma correct an image.</p>
1481+ : <p>Gamma values less than zero will erase the image.</p>
1482 :
1483 : @param $image the source image
1484 : @param $gamma-value value for which to gamma correct the image
1485 : @return A gamma corrected copy of $image
1486- : @error ierr:IM001 passed image is invalid
1487+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1488 : @example test/Queries/image/manipulation_gamma.xq
1489 :)
1490 declare function man:gamma($image as xs:base64Binary,
1491 $gamma-value as xs:double) as xs:base64Binary external;
1492
1493 (:~
1494- : Gamma correct an image for every color channel seperately.
1495- : Gamma values less than zero for any color will erase the corresponding color.
1496+ : <p>Gamma correct an image for every color channel seperately.</p>
1497+ : <p>Gamma values less than zero for any color will erase the corresponding color.</p>
1498 :
1499 : @param $image the source image
1500 : @param $gamma-red value to gamma correct the red channel of the image
1501 : @param $gamma-green value to gamma correct the green channel of the image
1502 : @param $gamma-blue value to gamma correct the blue channel of the image
1503 : @return A gamma corrected copy of $image
1504- : @error ierr:IM001 passed image is invalid
1505+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1506 : @example test/Queries/image/manipulation_gamma2.xq
1507 :)
1508 declare function man:gamma($image as xs:base64Binary,
1509@@ -518,32 +518,32 @@
1510 $gamma-blue as xs:double) as xs:base64Binary external;
1511
1512 (:~
1513- : Apply an implode effect to an image (a sort of special effect).
1514+ : <p>Apply an implode effect to an image (a sort of special effect).</p>
1515 :
1516 : @param $image the source image
1517 : @param $factor factor to implode to
1518 : @return An imploded copy of $image.
1519- : @error ierr:IM001 passed image is invalid
1520+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1521 : @example test/Queries/image/manipulation_implode.xq
1522 :)
1523 declare function man:implode($image as xs:base64Binary,
1524 $factor as xs:double) as xs:base64Binary external;
1525
1526 (:~
1527- : Apply an oil paint effect to an image (makes the image look as if it was
1528- : an oil paint).
1529+ : <p>Apply an oil paint effect to an image (makes the image look as if it was
1530+ : an oil paint).</p>
1531 :
1532 : @param $image the source image
1533 : @param $radius radius with which to oil paint
1534 : @return A oil-painted copy of $image
1535- : @error ierr:IM001 passed image is invalid
1536+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1537 : @example test/Queries/image/manipulation_oil_paint.xq
1538 :)
1539 declare function man:oil-paint($image as xs:base64Binary,
1540 $radius as xs:double) as xs:base64Binary external;
1541
1542 (:~
1543- : Add a $watermark image to $image.
1544+ : <p>Add a $watermark image to $image.</p>
1545 :
1546 : @param $image the source image
1547 : @param $watermark the watermark image
1548
1549=== renamed directory 'src/com/zorba-xquery/www/modules/image/manipulation.xq.src' => 'src/manipulation.xq.src'
1550=== modified file 'src/manipulation.xq.src/manipulation_module.h'
1551--- src/com/zorba-xquery/www/modules/image/manipulation.xq.src/manipulation_module.h 2011-10-06 08:18:47 +0000
1552+++ src/manipulation.xq.src/manipulation_module.h 2013-10-23 04:15:35 +0000
1553@@ -31,7 +31,7 @@
1554
1555
1556 virtual String
1557- getURI() const { return "http://www.zorba-xquery.com/modules/image/manipulation"; }
1558+ getURI() const { return "http://zorba.io/modules/image/manipulation"; }
1559
1560 virtual ExternalFunction*
1561 getExternalFunction(const String& aLocalname);
1562
1563=== renamed file 'src/com/zorba-xquery/www/modules/image/paint.xq' => 'src/paint.xq'
1564--- src/com/zorba-xquery/www/modules/image/paint.xq 2013-08-09 09:37:05 +0000
1565+++ src/paint.xq 2013-10-23 04:15:35 +0000
1566@@ -17,9 +17,9 @@
1567 :)
1568
1569 (:~
1570- : This module provides a function to extend an image with additional shapes.
1571- :
1572- : Fully supported image formats are:
1573+ : <p>This module provides a function to extend an image with additional shapes.</p>
1574+ : <p/>
1575+ : <p>Fully supported image formats are:</p>
1576 : <ul>
1577 : <li>GIF</li>
1578 : <li>JPEG</li>
1579@@ -29,136 +29,169 @@
1580 : </ul>
1581 :
1582 : <p>The errors raised by functions of this module have the namespace
1583- : <tt>http://www.zorba-xquery.com/modules/image/error</tt> (associated with prefix ierr).</p>
1584+ : <tt>http://zorba.io/modules/image/error</tt> (associated with prefix ierr).</p>
1585 :
1586 : @author Daniel Thomas
1587 : @library <a href="http://www.imagemagick.org/Magick++/">Magick++ C++ Library</a>
1588 : @project Zorba/Image/Paint
1589 :
1590 :)
1591-module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
1592+module namespace paint = 'http://zorba.io/modules/image/paint';
1593
1594-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
1595+import schema namespace img = 'http://zorba.io/modules/image/image';
1596
1597 declare namespace err = "http://www.w3.org/2005/xqt-errors";
1598-declare namespace ierr = "http://www.zorba-xquery.com/modules/image/error";
1599+declare namespace ierr = "http://zorba.io/modules/image/error";
1600 declare namespace ver = "http://zorba.io/options/versioning";
1601 declare option ver:module-version "1.0";
1602
1603
1604 (:~
1605- : Extends the passed image with a sequence of shapes.
1606- : The shapes are passed as a sequence of elements.
1607- : The possibilities for shape elements are:
1608+ : <p>Extends the passed image with a sequence of shapes.</p>
1609+ : <p>The shapes are passed as a sequence of elements.</p>
1610+ : <p>The possibilities for shape elements are:</p>
1611 : <ul>
1612 : <li> line:
1613- : <pre class="brush: xml">
1614- : &lt;img:line&gt;
1615- : &lt;img:start&gt;&lt;img:x&gt;-20&lt;/img:x&gt;&lt;img:y&gt;-20&lt;/img:y&gt;&lt;/img:start&gt;
1616- : &lt;img:end&gt;&lt;img:x&gt;80&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:end&gt;
1617- : &lt;/img:line&gt;</pre>
1618+ : <pre class="brush: json">
1619+ : {
1620+ : "line" :
1621+ : {
1622+ : "start" : [0, 0],
1623+ : "end" : [80, 80]
1624+ : }
1625+ : }
1626+ : </pre>
1627 : </li>
1628 : <li> polyline:
1629- : <pre class="brush: xml">
1630- : &lt;img:polyLine&gt;
1631- : &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
1632- : &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/point&gt;
1633- : &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/point&gt;
1634- : &lt;img:point&gt;&lt;img:x&gt;200&lt;/img:x&gt;&lt;img:y&gt;200&lt;/img:y&gt;&lt;/point&gt;
1635- : &lt;/img:polyLine&gt;
1636+ : <pre class="">
1637+ : {
1638+ : "polyLine" :
1639+ : {
1640+ : "points" : [ [10, 10], [30, 10], [30, 30], [10, 30] ]
1641+ : }
1642+ : }
1643 : </pre>
1644 : </li>
1645 : <li> stroked polyline:
1646 : <pre class="brush: xml">
1647- : &lt;img:strokedPolyLine&gt;
1648- : &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
1649- : &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:point&gt;
1650- : &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/img:point&gt;
1651- : &lt;img:strokeLength&gt;5&lt;/img:strokeLength&gt;&lt;img:gapLength&gt;2&lt;/img:gapLength&gt;
1652- : &lt;/img:strokedPolyLine&gt;
1653+ : {
1654+ : "strokedPolyLine" :
1655+ : {
1656+ : "points" : [ [10, 10], [40, 80], [50, 30] ],
1657+ : "strokeLength" : 10,
1658+ : "gapLength" : 2
1659+ : }
1660+ : }
1661 : </pre>
1662 : </li>
1663 : <li> rectangle:
1664 : <pre class="brush: xml">
1665- : &lt;img:rectangle&gt;
1666- : &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
1667- : &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
1668- : &lt;/img:rectangle&gt;
1669+ : {
1670+ : "rectangle" :
1671+ : {
1672+ : "upperLeft" : [ 20, 20 ],
1673+ : "lowerRight" : [ 50, 50 ]
1674+ : }
1675+ : }
1676 : </pre>
1677 : </li>
1678 : <li> rounded rectangle:
1679- : <pre class="brush: xml">
1680- : &lt;img:roundedRectangle&gt;
1681- : &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
1682- : &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
1683- : &lt;img:cornerWidth&gt;10&lt;/img:cornerWidth&gt;&lt;img:cornerHeight&gt;10&lt;/img:cornerHeight&gt;
1684- : &lt;/img:roundedRectangle&gt;
1685+ : <pre class="brush: json">
1686+ : { "roundedRectangle" :
1687+ : {
1688+ : "upperLeft" : [ 20, 20 ],
1689+ : "lowerRight" : [ 50, 50 ],
1690+ : "cornerWidth" : 10,
1691+ : "cornerHeight" : 10
1692+ : }
1693+ : }
1694 : </pre>
1695 : </li>
1696 : <li> circle:
1697- : <pre class="brush: xml">
1698- : &lt;img:circle&gt;
1699- : &lt;img:origin&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:origin&gt;
1700- : &lt;img:perimeter&gt;5&lt;/img:perimeter&gt;
1701- : &lt;/img:circle&gt;
1702+ : <pre class="brush: json">
1703+ : {
1704+ : "circle" :
1705+ : {
1706+ : "origin" : [ 50, 50 ],
1707+ : "radius" : 5
1708+ : }
1709+ : }
1710 : </pre>
1711 : </li>
1712 : <li> ellipse:
1713- : <pre class="brush: xml">
1714- : &lt;img:ellipse&gt;
1715- : &lt;img:origin&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:origin&gt;
1716- : &lt;img:perimeterX&gt;30&lt;/img:perimeterX&gt;&lt;img:perimeterY&gt;20&lt;/img:perimeterY&gt;
1717- : &lt;/img:ellipse&gt;
1718+ : <pre class="brush: json">
1719+ : {
1720+ : "ellipse" :
1721+ : {
1722+ : "origin" : [ 50, 50 ],
1723+ : "radiusX" : 30,
1724+ : "radiusY" : 20
1725+ : }
1726+ : }
1727 : </pre>
1728 : </li>
1729 : <li> arc:
1730- : <pre class="brush: xml">
1731- : &lt;img:arc&gt;
1732- : &lt;img:origin&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:origin&gt;
1733- : &lt;img:perimeterX&gt;10&lt;/img:perimeterX&gt;&lt;img:perimeterY&gt;20&lt;/img:perimeterY&gt;
1734- : &lt;img:startDegrees&gt;180&lt;/img:startDegrees&gt;&lt;img:endDegrees&gt;270&lt;/img:endDegrees&gt;
1735- : &lt;/img:arc&gt;
1736+ : <pre class="brush: json">
1737+ : {
1738+ : "arc" :
1739+ : {
1740+ : "origin" : [ 50, 50 ],
1741+ : "radiusX" : 10,
1742+ : "radiusY" : 20,
1743+ : "startDegrees" : 180,
1744+ : "endDegrees" : 270
1745+ : }
1746+ : }
1747 : </pre>
1748 : </li>
1749 : <li> polygon:
1750- : <pre class="brush: xml">
1751- : &lt;img:polygon&gt;
1752- : &lt;img:point&gt;&lt;img:x&gt;10&lt;/img:x&gt;&lt;img:y&gt;10&lt;/img:y&gt;&lt;/img:point&gt;
1753- : &lt;img:point&gt;&lt;img:x&gt;40&lt;/img:x&gt;&lt;img:y&gt;80&lt;/img:y&gt;&lt;/img:point&gt;
1754- : &lt;img:point&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;30&lt;/img:y&gt;&lt;/img:point&gt;
1755- : &lt;/img:polygon&gt;
1756+ : <pre class="brush: json">
1757+ : {
1758+ : "polygon" :
1759+ : {
1760+ : "points" : [ [10, 10], [30, 10], [30, 30] ]
1761+ : }
1762+ : }
1763 : </pre>
1764 : </li>
1765 : <li> text:
1766- : <pre class="brush: xml">
1767- : &lt;img:text&gt;
1768- : &lt;img:origin&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:origin&gt;
1769- : &lt;img:text&gt;Hello Zorba&lt;/img:text&gt;&lt;img:font&gt;&lt;/img:font&gt;&lt;img:font-size&gt;12&lt;/img:font-size&gt;
1770- : &lt;/img:text&gt;
1771+ : <pre class="brush: json">
1772+ : {
1773+ : "text" :
1774+ : {
1775+ : "origin" : [ 50, 50 ],
1776+ : "text" : "Hello World!",
1777+ : "font" : "Arial",
1778+ : "font-size" : 12
1779+ : }
1780+ : }
1781 : </pre>
1782 : </li>
1783 : </ul>
1784- :
1785- : Optionally, each of the shape elements can contain elements to define the stroke with, stroke color, fill color, and anti-aliasing.
1786- : E.g.:
1787+ : <p/>
1788+ : <p>Optionally, each of the shape elements can contain elements to define the stroke with, stroke color, fill color, and anti-aliasing.</p>
1789+ : <p>E.g.:</p>
1790 : <p>
1791- : <pre class="brush: xml">
1792- : &lt;img:rectangle&gt;
1793- : &lt;img:strokeWidth&gt;5&lt;/img:strokeWidth&gt;
1794- : &lt;img:strokeColor&gt;#00AF00&lt;/img:strokeColor&gt;
1795- : &lt;img:fillColor&gt;#A10000&lt;/img:fillColor&gt;
1796- : &lt;img:antiAliasing&gt;true&lt;/img:antiAliasing&gt;
1797- : &lt;img:upperLeft&gt;&lt;img:x&gt;20&lt;/img:x&gt;&lt;img:y&gt;20&lt;/img:y&gt;&lt;/img:upperLeft&gt;
1798- : &lt;img:lowerRight&gt;&lt;img:x&gt;50&lt;/img:x&gt;&lt;img:y&gt;50&lt;/img:y&gt;&lt;/img:lowerRight&gt;
1799- : &lt;/img:rectangle&gt;
1800+ : <pre class="brush: json">
1801+ : {
1802+ : "polygon" :
1803+ : {
1804+ : "strokeWidth" : 3,
1805+ : "strokeColor" : "#FF0000",
1806+ : "fillColor" : "#00FF00",
1807+ : "antiAliasing" : fn:true(),
1808+ : "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
1809+ : }
1810+ : }
1811 : </pre>
1812 : </p>
1813 :
1814 : @param $image the passed image
1815 : @param $shapes the shapes
1816 : @return image with additional shapes
1817- : @error ierr:IM001 the passed image is invalid.
1818- : @error err:FORG0001 one of the passed shape elements is invalid.
1819+ : @error ierr:INVALID_IMAGE the passed image is invalid.
1820+ : @error err::XPTY0004 empty sequence not allowed.
1821+ : @error err:FORG0001 one of the passed shape objects is invalid.
1822 : @example test/Queries/image/paint_different_lines.xq
1823 : @example test/Queries/image/paint_polyline.xq
1824 : @example test/Queries/image/paint_stroked_polyline.xq
1825@@ -167,10 +200,10 @@
1826 : @example test/Queries/image/paint_circles.xq
1827 : @example test/Queries/image/paint_text.xq
1828 :)
1829-declare function paint:paint($image as xs:base64Binary, $shapes as element()*) as xs:base64Binary {
1830-
1831- paint:paint-impl($image, for $x in $shapes return validate{$x})
1832+declare function paint:paint($image as xs:base64Binary, $shapes as object()*) as xs:base64Binary {
1833+ (: missing json validation :)
1834+ paint:paint-impl($image, for $x in $shapes return $x)
1835 };
1836
1837-declare %private function paint:paint-impl($image as xs:base64Binary, $shapes as element(*, img:paintableType)*) as xs:base64Binary external;
1838+declare %private function paint:paint-impl($image as xs:base64Binary, $shapes as object()*) as xs:base64Binary external;
1839
1840
1841=== renamed directory 'src/com/zorba-xquery/www/modules/image/paint.xq.src' => 'src/paint.xq.src'
1842=== modified file 'src/paint.xq.src/paint.cpp'
1843--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.cpp 2013-06-21 03:28:34 +0000
1844+++ src/paint.xq.src/paint.cpp 2013-10-23 04:15:35 +0000
1845@@ -67,87 +67,96 @@
1846 }
1847
1848 bool
1849-PaintImplFunction::getCommonValues(Iterator_t& aChildIterator,
1850- Item& aLastItemFound,
1851+PaintImplFunction::getCommonValues(Item& aObject,
1852 double* aStrokeWidth,
1853 std::string& aStrokeColor,
1854 std::string& aFillColor) const {
1855-
1856 bool lFoundStrokeWidth = false;
1857 bool lFoundStrokeColor = false;
1858 bool lFoundFillColor = false;
1859+ bool lFoundAntialising = false;
1860 // fill in default values
1861 *aStrokeWidth = 1;
1862 aStrokeColor = "#000000";
1863 aFillColor = "#FFFFFF";
1864 bool lAntiAliasing = false;
1865-
1866- aChildIterator->next(aLastItemFound);
1867- // we just check through the first four elements
1868- for (int i = 0; i < 4; ++i) {
1869- Item lNodeName;
1870- aLastItemFound.getNodeName(lNodeName);
1871- String lName = lNodeName.getStringValue();
1872-
1873- if (!lFoundStrokeWidth && fn::ends_with(lName,"Width")) {
1874- *aStrokeWidth = getDoubleValue(aLastItemFound);
1875+
1876+ //we check for the 4 common objects inside the shapes object value
1877+ Iterator_t lKeys = aObject.getObjectKeys();
1878+ Item lKey;
1879+ lKeys->open();
1880+ while (lKeys->next(lKey))
1881+ {
1882+ String lStrKey = lKey.getStringValue();
1883+ if (!lFoundStrokeWidth && fn::ends_with(lStrKey, "eWidth"))
1884+ {
1885+ Item lValue = aObject.getObjectValue(lStrKey);
1886+ *aStrokeWidth = getDoubleValue(lValue);
1887 lFoundStrokeWidth = true;
1888- aChildIterator->next(aLastItemFound);
1889- } else if (!lFoundStrokeColor && fn::ends_with(lName,"eColor")) {
1890- aStrokeColor = aLastItemFound.getStringValue().c_str();
1891+ }
1892+ else if (!lFoundStrokeColor && fn::ends_with(lStrKey, "eColor"))
1893+ {
1894+ Item lValue = aObject.getObjectValue(lStrKey);
1895+ aStrokeColor = lValue.getStringValue().c_str();
1896 lFoundStrokeColor = true;
1897- aChildIterator->next(aLastItemFound);
1898- if (i < 1) { i = 1; }
1899- } else if (!lFoundFillColor && fn::ends_with(lName,"Color")) {
1900- aFillColor = aLastItemFound.getStringValue().c_str();
1901+ }
1902+ else if (!lFoundFillColor && fn::ends_with(lStrKey, "Color"))
1903+ {
1904+ Item lValue = aObject.getObjectValue(lStrKey);
1905+ aFillColor = lValue.getStringValue().c_str();
1906 lFoundFillColor = true;
1907- aChildIterator->next(aLastItemFound);
1908- if (i < 2) { i = 2; }
1909- } else if (fn::ends_with(lName,"ing")) {
1910- String lAntiAliasingString = aLastItemFound.getStringValue();
1911- if (fn::ends_with(lAntiAliasingString,"ue")) {
1912+ }
1913+ else if (!lFoundAntialising && fn::ends_with(lStrKey, "ing"))
1914+ {
1915+ Item lValue = aObject.getObjectValue(lStrKey);
1916+ String lAntialisingString = lValue.getStringValue();
1917+ if (fn::ends_with(lAntialisingString, "ue"))
1918+ {
1919 lAntiAliasing = true;
1920- } else {
1921+ }
1922+ else
1923+ {
1924 lAntiAliasing = false;
1925- }
1926-
1927- // iterate to next and break
1928- aChildIterator->next(aLastItemFound);
1929- break;
1930- }
1931+ }
1932+ }
1933+ }
1934+ lKeys->close();
1935
1936- }
1937 return lAntiAliasing;
1938-}
1939-
1940+}
1941
1942 void
1943 PaintImplFunction::applyShape(Magick::Blob& aBlob, Item& aShape) const {
1944- Item lNodeName;
1945- aShape.getNodeName(lNodeName);
1946- String lName = lNodeName.getStringValue();
1947- // removing the uri prefix
1948- if (fn::ends_with(lName,"line")) {
1949- applyLine(aBlob, aShape);
1950- } else if (fn::ends_with(lName,"dPolyLine")) {
1951- applyStrokedPolyLine(aBlob, aShape);
1952- } else if (fn::ends_with(lName,"Line")) {
1953- applyPolyLine(aBlob, aShape);
1954- } else if (fn::ends_with(lName,"rectangle")) {
1955- applyRectangle(aBlob, aShape);
1956- } else if (fn::ends_with(lName,"gle")) {
1957- applyRoundedRectangle(aBlob, aShape);
1958- } else if (fn::ends_with(lName,"cle")) {
1959- applyCircle(aBlob, aShape);
1960- } else if (fn::ends_with(lName,"se")) {
1961- applyEllipse(aBlob, aShape);
1962- } else if (fn::ends_with(lName,"c")) {
1963- applyArc(aBlob, aShape);
1964- } else if (fn::ends_with(lName,"n")) {
1965- applyPolygon(aBlob, aShape);
1966- } else if (fn::ends_with(lName,"t")) {
1967- applyText(aBlob, aShape);
1968+ Iterator_t lObjIter = aShape.getObjectKeys();
1969+ Item lKey;
1970+ lObjIter->open();
1971+ while ( lObjIter->next(lKey) )
1972+ {
1973+ String lStrKey = lKey.getStringValue();
1974+ Item lValue = aShape.getObjectValue(lStrKey);
1975+ if (fn::ends_with(lStrKey, "line")) {
1976+ applyLine(aBlob, lValue);
1977+ } else if (fn::ends_with(lStrKey, "dPolyLine")) {
1978+ applyStrokedPolyLine(aBlob, lValue);
1979+ } else if (fn::ends_with(lStrKey, "Line")) {
1980+ applyPolyLine(aBlob, lValue);
1981+ } else if (fn::ends_with(lStrKey,"rectangle")) {
1982+ applyRectangle(aBlob, lValue);
1983+ } else if (fn::ends_with(lStrKey, "gle")) {
1984+ applyRoundedRectangle(aBlob, lValue);
1985+ } else if (fn::ends_with(lStrKey, "cle")) {
1986+ applyCircle(aBlob, lValue);
1987+ } else if (fn::ends_with(lStrKey, "se")) {
1988+ applyEllipse(aBlob, lValue);
1989+ } else if (fn::ends_with(lStrKey, "c")) {
1990+ applyArc(aBlob, lValue);
1991+ } else if (fn::ends_with(lStrKey, "n")) {
1992+ applyPolygon(aBlob, lValue);
1993+ } else if (fn::ends_with(lStrKey, "t")) {
1994+ applyText(aBlob, lValue);
1995 }
1996+ }
1997+ lObjIter->close();
1998 }
1999
2000
2001@@ -163,46 +172,27 @@
2002
2003 void
2004 PaintImplFunction::getDoublesFromPoint(Item& aPoint, double aPointValues[2]) const {
2005- Item lXItem, lYItem, lX, lY;
2006-
2007- Iterator_t lPointChildren = aPoint.getChildren();
2008- lPointChildren->open();
2009- lPointChildren->next(lXItem);
2010- Iterator_t lXItemIterator = lXItem.getChildren();
2011- lXItemIterator->open();
2012- lXItemIterator->next(lX);
2013- lXItemIterator->close();
2014-
2015- lPointChildren->next(lYItem);
2016- Iterator_t lYItemIterator = lYItem.getChildren();
2017- lYItemIterator->open();
2018- lYItemIterator->next(lY);
2019- lYItemIterator->close();
2020- lPointChildren->close();
2021-
2022+ Item lX, lY;
2023+ lX = aPoint.getArrayValue(1);
2024+ lY = aPoint.getArrayValue(2);
2025 aPointValues[0] = getDoubleValue(lX);
2026 aPointValues[1] = getDoubleValue(lY);
2027-
2028 }
2029
2030-
2031 void
2032 PaintImplFunction::applyLine(Magick::Blob& aBlob, Item& aLine) const {
2033- Item lStartPoint, lEndPoint;
2034- Iterator_t lChildren = aLine.getChildren();
2035- lChildren->open();
2036+ Item lStartPoint, lEndPoint;
2037 double lStrokeWidth = 0;
2038 std::string lStrokeColor = "";
2039 std::string lFillColor = "";
2040- bool lAntiAliasing;
2041- // lStartPoint will contain the item of the start point after this operation
2042- lAntiAliasing = getCommonValues(lChildren, lStartPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2043-
2044- lChildren->next(lEndPoint);
2045- lChildren->close();
2046-
2047+ bool lAntiAliasing;
2048 double lFirst[2];
2049 double lSecond[2];
2050+
2051+ // set common values from JSON
2052+ lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
2053+ lStartPoint = aLine.getObjectValue("start");
2054+ lEndPoint = aLine.getObjectValue("end");
2055 getDoublesFromPoint(lStartPoint, lFirst);
2056 getDoublesFromPoint(lEndPoint, lSecond);
2057 double lXValues[2] = {lFirst[0], lSecond[0]};
2058@@ -217,41 +207,34 @@
2059
2060 void
2061 PaintImplFunction::applyPolyLine(Magick::Blob& aBlob, Item& aLine) const {
2062- Item lFirstPoint;
2063- Iterator_t lChildren = aLine.getChildren();
2064- lChildren->open();
2065 double lStrokeWidth = 0;
2066 std::string lStrokeColor = "";
2067 std::string lFillColor = "";
2068 bool lAntiAliasing;
2069-
2070- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2071-
2072 std::vector<double> lXValues;
2073 std::vector<double> lYValues;
2074+ double lTempPoint[2];
2075+ int lSize = 1;
2076
2077- double lFirst[2];
2078- getDoublesFromPoint(lFirstPoint, lFirst);
2079- lXValues.push_back(lFirst[0]);
2080- lYValues.push_back(lFirst[1]);
2081- Item lPoint;
2082- int lCounter = 1;
2083- while(lChildren->next(lPoint)) {
2084- lCounter++;
2085- double lPointValues[2];
2086- getDoublesFromPoint(lPoint, lPointValues);
2087- lXValues.push_back(lPointValues[0]);
2088- lYValues.push_back(lPointValues[1]);
2089+ lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
2090+
2091+ Item lPoints = aLine.getObjectValue("points");
2092+ lSize = lPoints.getArraySize();
2093+ for (int i = 1; i <= lSize; i++)
2094+ {
2095+ Item lPoint = lPoints.getArrayValue(i);
2096+ getDoublesFromPoint(lPoint, lTempPoint);
2097+ lXValues.push_back(lTempPoint[0]);
2098+ lYValues.push_back(lTempPoint[1]);
2099 }
2100- lChildren->close();
2101
2102 long lBlobLength = (long) aBlob.length();
2103- double* lXValuesArray = new double[lCounter];
2104- double* lYValuesArray = new double[lCounter];
2105- std::memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
2106- std::memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
2107+ double* lXValuesArray = new double[lSize];
2108+ double* lYValuesArray = new double[lSize];
2109+ std::memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
2110+ std::memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
2111
2112- void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lStrokeWidth, lAntiAliasing, NULL, 0);
2113+ void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lStrokeWidth, lAntiAliasing, NULL, 0);
2114
2115 delete[] lXValuesArray;
2116 delete[] lYValuesArray;
2117@@ -260,59 +243,47 @@
2118 // now read the blob back into an image to pass it back as encoded string
2119 aBlob = lBlobWithPolyLine;
2120
2121-
2122 }
2123
2124 void
2125 PaintImplFunction::applyStrokedPolyLine(Magick::Blob& aBlob, Item& aLine) const {
2126- Item lFirstPoint;
2127- Iterator_t lChildren = aLine.getChildren();
2128- lChildren->open();
2129+ Item lFirstPoint;
2130 double lStrokeWidth = 0;
2131 std::string lStrokeColor = "";
2132 std::string lFillColor = "";
2133 bool lAntiAliasing;
2134- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2135 std::vector<double> lXValues;
2136 std::vector<double> lYValues;
2137-
2138- double lFirst[2];
2139- getDoublesFromPoint(lFirstPoint, lFirst);
2140- lXValues.push_back(lFirst[0]);
2141- lYValues.push_back(lFirst[1]);
2142- Item lPoint;
2143- int lCounter = 1;
2144- while(lChildren->next(lPoint)) {
2145- // make sure that we aren't reading in the gap length as point
2146- if (lCounter >= 3) {
2147- Item lNodeName;
2148- lPoint.getNodeName(lNodeName);
2149- String lName = lNodeName.getStringValue();
2150- if (!fn::ends_with(lName,"oint")) {
2151- break;
2152- }
2153- }
2154- lCounter++;
2155- double lPointValues[2];
2156- getDoublesFromPoint(lPoint, lPointValues);
2157- lXValues.push_back(lPointValues[0]);
2158- lYValues.push_back(lPointValues[1]);
2159- }
2160- // lPoint now contains the strokeLength
2161+ double lTempPoint[2];
2162 double lStrokeArray[2];
2163- lStrokeArray[0] = getDoubleValue(lPoint);
2164- lChildren->next(lPoint);
2165- lStrokeArray[1] = getDoubleValue(lPoint);
2166- lChildren->close();
2167+ int lSize = 1;
2168
2169+ lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
2170+
2171+ Item lPoints = aLine.getObjectValue("points");
2172+ lSize = lPoints.getArraySize();
2173+ for (int i = 1; i <= lSize; i++)
2174+ {
2175+ Item lPoint = lPoints.getArrayValue(i);
2176+ getDoublesFromPoint(lPoint, lTempPoint);
2177+ lXValues.push_back(lTempPoint[0]);
2178+ lYValues.push_back(lTempPoint[1]);
2179+ }
2180+ //get stroke length
2181+ Item lStrokeLength = aLine.getObjectValue("strokeLength");
2182+ lStrokeArray[0] = getDoubleValue(lStrokeLength);
2183+ Item lGapLength = aLine.getObjectValue("gapLength");
2184+ lStrokeArray[1] = getDoubleValue(lGapLength);
2185+
2186+
2187 long lBlobLength = (long) aBlob.length();
2188
2189- double* lXValuesArray = new double[lCounter];
2190- double* lYValuesArray = new double[lCounter];
2191- memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
2192- memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
2193+ double* lXValuesArray = new double[lSize];
2194+ double* lYValuesArray = new double[lSize];
2195+ memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
2196+ memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
2197
2198- void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lStrokeWidth, lAntiAliasing, lStrokeArray, 2);
2199+ void * lBlobPointer = DrawPolyLine(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lStrokeWidth, lAntiAliasing, lStrokeArray, 2);
2200
2201 delete[] lXValuesArray;
2202 delete[] lYValuesArray;
2203@@ -325,51 +296,49 @@
2204
2205 void
2206 PaintImplFunction::applyRectangle(Magick::Blob& aBlob, Item& aRectangle) const {
2207- Item lFirstPoint;
2208- Iterator_t lChildren = aRectangle.getChildren();
2209- lChildren->open();
2210 double lStrokeWidth = 0;
2211 std::string lStrokeColor = "";
2212 std::string lFillColor = "";
2213 bool lAntiAliasing;
2214- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2215- // now lFirstPoint contains the upper left corner of this rectangle
2216 double lUpperLeft[2];
2217- getDoublesFromPoint(lFirstPoint, lUpperLeft);
2218- lChildren->next(lFirstPoint);
2219- lChildren->close();
2220 double lLowerRight[2];
2221- getDoublesFromPoint(lFirstPoint, lLowerRight);
2222+
2223+ lAntiAliasing = getCommonValues(aRectangle, &lStrokeWidth, lStrokeColor, lFillColor);
2224+ Item lUpperLeftItem = aRectangle.getObjectValue("upperLeft");
2225+ getDoublesFromPoint(lUpperLeftItem, lUpperLeft);
2226+ Item lLowerRightItem = aRectangle.getObjectValue("lowerRight");
2227+ getDoublesFromPoint(lLowerRightItem, lLowerRight);
2228+
2229+
2230 long lBlobLength = (long) aBlob.length();
2231 void * lBlobPointer = DrawRoundedRect(aBlob.data(), &lBlobLength, lUpperLeft[0], lUpperLeft[1], lLowerRight[0], lLowerRight[1], 0, 0, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
2232 Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
2233 // now read the blob back into an image to pass it back as encoded string
2234 aBlob = lBlobWithPolyLine;
2235-
2236 }
2237
2238 void
2239 PaintImplFunction::applyRoundedRectangle(Magick::Blob& aBlob, Item& aRectangle) const {
2240- Item lFirstPoint;
2241- Iterator_t lChildren = aRectangle.getChildren();
2242- lChildren->open();
2243+ Item lItem;
2244 double lStrokeWidth = 0;
2245 std::string lStrokeColor = "";
2246 std::string lFillColor = "";
2247 bool lAntiAliasing;
2248- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2249- // now lFirstPoint contains the upper left corner of this rectangle
2250 double lUpperLeft[2];
2251- getDoublesFromPoint(lFirstPoint, lUpperLeft);
2252- lChildren->next(lFirstPoint);
2253 double lLowerRight[2];
2254- getDoublesFromPoint(lFirstPoint, lLowerRight);
2255- Item lCorner;
2256- lChildren->next(lCorner);
2257- double lCornerWidth = getDoubleValue(lCorner);
2258- lChildren->next(lCorner);
2259- double lCornerHeight = getDoubleValue(lCorner);
2260-
2261+ double lCornerWidth;
2262+ double lCornerHeight;
2263+
2264+ lAntiAliasing = getCommonValues(aRectangle, &lStrokeWidth, lStrokeColor, lFillColor);
2265+ lItem = aRectangle.getObjectValue("upperLeft");
2266+ getDoublesFromPoint(lItem, lUpperLeft);
2267+ lItem = aRectangle.getObjectValue("lowerRight");
2268+ getDoublesFromPoint(lItem, lLowerRight);
2269+ lItem = aRectangle.getObjectValue("cornerWidth");
2270+ lCornerWidth = getDoubleValue(lItem);
2271+ lItem = aRectangle.getObjectValue("cornerHeight");
2272+ lCornerHeight = getDoubleValue(lItem);
2273+
2274 long lBlobLength = (long) aBlob.length();
2275 void * lBlobPointer = DrawRoundedRect(aBlob.data(), &lBlobLength, lUpperLeft[0], lUpperLeft[1], lLowerRight[0], lLowerRight[1], lCornerWidth, lCornerHeight, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
2276 Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
2277@@ -380,21 +349,20 @@
2278
2279 void
2280 PaintImplFunction::applyCircle(Magick::Blob& aBlob, Item& aCircle) const {
2281- Item lFirstPoint;
2282- Iterator_t lChildren = aCircle.getChildren();
2283- lChildren->open();
2284- double lStrokeWidth = 0;
2285+ double lStrokeWidth = 0;
2286 std::string lStrokeColor = "";
2287 std::string lFillColor = "";
2288 bool lAntiAliasing;
2289- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2290-
2291 double lOriginCoordinates[2];
2292- getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
2293- Item lPeremeterItem;
2294- lChildren->next(lPeremeterItem);
2295- double lPeremeter = getDoubleValue(lPeremeterItem);
2296- lChildren->close();
2297+ Item lItem;
2298+ double lRadius;
2299+
2300+ lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
2301+ lItem = aCircle.getObjectValue("origin");
2302+ getDoublesFromPoint(lItem, lOriginCoordinates);
2303+ lItem = aCircle.getObjectValue("radius");
2304+ lRadius = getDoubleValue(lItem);
2305+
2306 Magick::Image lImage(aBlob);
2307 lImage.strokeAntiAlias(lAntiAliasing);
2308 lImage.strokeWidth(lStrokeWidth);
2309@@ -404,32 +372,31 @@
2310 ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
2311 lImage.strokeColor(lStrokeColorForMagick);
2312 lImage.fillColor(lFillColorForMagick);
2313- lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeter, lPeremeter, 0, 360));
2314+ lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadius, lRadius, 0, 360));
2315 Magick::Blob lBlob;
2316 lImage.write(&lBlob);
2317 aBlob = lBlob;
2318-
2319 }
2320
2321 void
2322 PaintImplFunction::applyEllipse(Magick::Blob& aBlob, Item& aCircle) const {
2323- Item lFirstPoint;
2324- Iterator_t lChildren = aCircle.getChildren();
2325- lChildren->open();
2326- double lStrokeWidth = 0;
2327+ double lStrokeWidth = 0;
2328 std::string lStrokeColor = "";
2329 std::string lFillColor = "";
2330 bool lAntiAliasing;
2331- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2332-
2333+ Item lItem;
2334 double lOriginCoordinates[2];
2335- getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
2336- Item lPeremeterItem;
2337- lChildren->next(lPeremeterItem);
2338- double lPeremeterX = getDoubleValue(lPeremeterItem);
2339- lChildren->next(lPeremeterItem);
2340- double lPeremeterY = getDoubleValue(lPeremeterItem);
2341- lChildren->close();
2342+ double lRadiusX;
2343+ double lRadiusY;
2344+
2345+ lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
2346+ lItem = aCircle.getObjectValue("origin");
2347+ getDoublesFromPoint(lItem, lOriginCoordinates);
2348+ lItem = aCircle.getObjectValue("radiusX");
2349+ lRadiusX = getDoubleValue(lItem);
2350+ lItem = aCircle.getObjectValue("radiusY");
2351+ lRadiusY = getDoubleValue(lItem);
2352+
2353 Magick::Image lImage(aBlob);
2354 lImage.strokeAntiAlias(lAntiAliasing);
2355 lImage.strokeWidth(lStrokeWidth);
2356@@ -439,7 +406,7 @@
2357 ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
2358 lImage.strokeColor(lStrokeColorForMagick);
2359 lImage.fillColor(lFillColorForMagick);
2360- lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeterX, lPeremeterY, 0, 360));
2361+ lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadiusX, lRadiusY, 0, 360));
2362 Magick::Blob lBlob;
2363 lImage.write(&lBlob);
2364 aBlob = lBlob;
2365@@ -447,29 +414,26 @@
2366
2367 void
2368 PaintImplFunction::applyArc(Magick::Blob& aBlob, Item& aCircle) const {
2369- Item lFirstPoint;
2370- Iterator_t lChildren = aCircle.getChildren();
2371- lChildren->open();
2372- double lStrokeWidth = 0;
2373+ double lStrokeWidth = 0;
2374 std::string lStrokeColor = "";
2375 std::string lFillColor = "";
2376 bool lAntiAliasing;
2377- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2378-
2379 double lOriginCoordinates[2];
2380- getDoublesFromPoint(lFirstPoint, lOriginCoordinates);
2381- Item lPeremeterItem;
2382- lChildren->next(lPeremeterItem);
2383- double lPeremeterX = getDoubleValue(lPeremeterItem);
2384- lChildren->next(lPeremeterItem);
2385- double lPeremeterY = getDoubleValue(lPeremeterItem);
2386- Item lDegreesItem;
2387- lChildren->next(lDegreesItem);
2388- double lStartDegrees = getDoubleValue(lDegreesItem);
2389- lChildren->next(lDegreesItem);
2390- double lEndDegrees = getDoubleValue(lDegreesItem);
2391+ double lRadiusX, lRadiusY, lStartDegrees, lEndDegrees;
2392+ Item lItem;
2393+
2394+ lAntiAliasing = getCommonValues(aCircle, &lStrokeWidth, lStrokeColor, lFillColor);
2395+ lItem = aCircle.getObjectValue("origin");
2396+ getDoublesFromPoint(lItem, lOriginCoordinates);
2397+ lItem = aCircle.getObjectValue("radiusX");
2398+ lRadiusX = getDoubleValue(lItem);
2399+ lItem = aCircle.getObjectValue("radiusY");
2400+ lRadiusY = getDoubleValue(lItem);
2401+ lItem = aCircle.getObjectValue("startDegrees");
2402+ lStartDegrees = getDoubleValue(lItem);
2403+ lItem = aCircle.getObjectValue("endDegrees");
2404+ lEndDegrees = getDoubleValue(lItem);
2405
2406- lChildren->close();
2407 Magick::Image lImage(aBlob);
2408 lImage.strokeAntiAlias(lAntiAliasing);
2409 lImage.strokeWidth(lStrokeWidth);
2410@@ -479,7 +443,7 @@
2411 ImageFunction::getColorFromString(lFillColor.c_str(), lFillColorForMagick);
2412 lImage.strokeColor(lStrokeColorForMagick);
2413 lImage.fillColor(lFillColorForMagick);
2414- lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lPeremeterX, lPeremeterY, lStartDegrees, lEndDegrees));
2415+ lImage.draw(Magick::DrawableEllipse(lOriginCoordinates[0], lOriginCoordinates[1], lRadiusX, lRadiusY, lStartDegrees, lEndDegrees));
2416 Magick::Blob lBlob;
2417 lImage.write(&lBlob);
2418 aBlob = lBlob;
2419@@ -488,42 +452,35 @@
2420
2421 void
2422 PaintImplFunction::applyPolygon(Magick::Blob& aBlob, Item& aLine) const {
2423- Item lFirstPoint;
2424- Iterator_t lChildren = aLine.getChildren();
2425- lChildren->open();
2426- double lStrokeWidth = 0;
2427+ double lStrokeWidth = 0;
2428 std::string lStrokeColor = "";
2429 std::string lFillColor = "";
2430 bool lAntiAliasing;
2431-
2432- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2433-
2434 std::vector<double> lXValues;
2435 std::vector<double> lYValues;
2436-
2437- double lFirst[2];
2438- getDoublesFromPoint(lFirstPoint, lFirst);
2439- lXValues.push_back(lFirst[0]);
2440- lYValues.push_back(lFirst[1]);
2441- Item lPoint;
2442- int lCounter = 1;
2443- while(lChildren->next(lPoint)) {
2444- lCounter++;
2445- double lPointValues[2];
2446- getDoublesFromPoint(lPoint, lPointValues);
2447- lXValues.push_back(lPointValues[0]);
2448- lYValues.push_back(lPointValues[1]);
2449+ double lTempPoint[2];
2450+ int lSize = 1;
2451+
2452+ lAntiAliasing = getCommonValues(aLine, &lStrokeWidth, lStrokeColor, lFillColor);
2453+
2454+ Item lPoints = aLine.getObjectValue("points");
2455+ lSize = lPoints.getArraySize();
2456+ for (int i = 1; i <= lSize; i++)
2457+ {
2458+ Item lPoint = lPoints.getArrayValue(i);
2459+ getDoublesFromPoint(lPoint, lTempPoint);
2460+ lXValues.push_back(lTempPoint[0]);
2461+ lYValues.push_back(lTempPoint[1]);
2462 }
2463- lChildren->close();
2464
2465 long lBlobLength = (long) aBlob.length();
2466
2467- double* lXValuesArray = new double[lCounter];
2468- double* lYValuesArray = new double[lCounter];
2469- memcpy(lXValuesArray, &lXValues[0], lCounter*sizeof(lXValues[0]));
2470- memcpy(lYValuesArray, &lYValues[0], lCounter*sizeof(lYValues[0]));
2471+ double* lXValuesArray = new double[lSize];
2472+ double* lYValuesArray = new double[lSize];
2473+ memcpy(lXValuesArray, &lXValues[0], lSize*sizeof(lXValues[0]));
2474+ memcpy(lYValuesArray, &lYValues[0], lSize*sizeof(lYValues[0]));
2475
2476- void * lBlobPointer = DrawPolygon(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lCounter, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
2477+ void * lBlobPointer = DrawPolygon(aBlob.data(), &lBlobLength, &lXValuesArray[0], &lYValuesArray[0], lSize, lStrokeColor, lFillColor, lStrokeWidth, lAntiAliasing);
2478
2479 delete[] lXValuesArray;
2480 delete[] lYValuesArray;
2481@@ -531,47 +488,34 @@
2482 Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
2483 // now read the blob back into an image to pass it back as encoded string
2484 aBlob = lBlobWithPolyLine;
2485-
2486-
2487 }
2488
2489 void
2490 PaintImplFunction::applyText(Magick::Blob& aBlob, Item& aText) const {
2491- Item lFirstPoint;
2492- Iterator_t lChildren = aText.getChildren();
2493- lChildren->open();
2494 double lStrokeWidth = 0;
2495 std::string lStrokeColor = "";
2496 std::string lFillColor = "";
2497 bool lAntiAliasing;
2498-
2499- lAntiAliasing = getCommonValues(lChildren, lFirstPoint, &lStrokeWidth, lStrokeColor, lFillColor);
2500-
2501-
2502- double lFirst[2];
2503- getDoublesFromPoint(lFirstPoint, lFirst);
2504-
2505- Item lTextItem;
2506- lChildren->next(lTextItem);
2507- String lText = lTextItem.getStringValue();
2508- Item lFontFamilyItem;
2509- lChildren->next(lFontFamilyItem);
2510- String lFontFamily = lFontFamilyItem.getStringValue();
2511- Item lFontSizeItem;
2512- lChildren->next(lFontSizeItem);
2513- double lFontSize = getDoubleValue(lFontSizeItem);
2514-
2515- lChildren->close();
2516+ double lOriginCoordinates[2];
2517+ Item lItem;
2518+ String lText, lFontFamily;
2519+ double lFontSize;
2520+
2521+ lAntiAliasing = getCommonValues(aText, &lStrokeWidth, lStrokeColor, lFillColor);
2522+ lItem = aText.getObjectValue("origin");
2523+ getDoublesFromPoint(lItem, lOriginCoordinates);
2524+ lItem = aText.getObjectValue("text");
2525+ lText = lItem.getStringValue();
2526+ lItem = aText.getObjectValue("font");
2527+ lFontFamily = lItem.getStringValue();
2528+ lItem = aText.getObjectValue("fontSize");
2529+ lFontSize = getDoubleValue(lItem);
2530
2531-
2532 long lBlobLength = (long) aBlob.length();
2533- void * lBlobPointer = DrawText(aBlob.data(), &lBlobLength, lText.c_str() , lFirst[0], lFirst[1], lFontFamily.c_str(), lFontSize, lStrokeColor.c_str());
2534+ void * lBlobPointer = DrawText(aBlob.data(), &lBlobLength, lText.c_str() , lOriginCoordinates[0], lOriginCoordinates[1], lFontFamily.c_str(), lFontSize, lStrokeColor.c_str());
2535 Magick::Blob lBlobWithPolyLine(lBlobPointer, lBlobLength);
2536 // now read the blob back into an image to pass it back as encoded string
2537 aBlob = lBlobWithPolyLine;
2538-
2539-
2540-
2541 }
2542
2543
2544
2545=== modified file 'src/paint.xq.src/paint.h'
2546--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint.h 2011-10-06 08:18:47 +0000
2547+++ src/paint.xq.src/paint.h 2013-10-23 04:15:35 +0000
2548@@ -79,11 +79,10 @@
2549 applyText(Magick::Blob& aBlob, Item& aShape) const;
2550
2551 virtual bool
2552- getCommonValues(Iterator_t& aChildIterator,
2553- Item& aLastItemFound,
2554+ getCommonValues(Item& lObjectValue,
2555 double* aStrokeWidth,
2556 std::string& aStrokeColor,
2557- std::string& aFillColor) const;
2558+ std::string& aFillColor) const;
2559
2560
2561 double
2562
2563=== modified file 'src/paint.xq.src/paint_module.h'
2564--- src/com/zorba-xquery/www/modules/image/paint.xq.src/paint_module.h 2011-10-06 08:18:47 +0000
2565+++ src/paint.xq.src/paint_module.h 2013-10-23 04:15:35 +0000
2566@@ -34,7 +34,7 @@
2567 public:
2568
2569 virtual String
2570- getURI() const { return "http://www.zorba-xquery.com/modules/image/paint"; }
2571+ getURI() const { return "http://zorba.io/modules/image/paint"; }
2572
2573 virtual ExternalFunction*
2574 getExternalFunction(const String& aLocalname);
2575
2576=== modified file 'test/Queries/image/animation.xq'
2577--- test/Queries/image/animation.xq 2013-08-09 09:37:05 +0000
2578+++ test/Queries/image/animation.xq 2013-10-23 04:15:35 +0000
2579@@ -4,9 +4,9 @@
2580 : @author Daniel Thomas
2581 :)
2582 import module namespace file = 'http://expath.org/ns/file';
2583-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2584-import module namespace ani = 'http://www.zorba-xquery.com/modules/image/animation';
2585-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2586+import module namespace basic = 'http://zorba.io/modules/image/basic';
2587+import module namespace ani = 'http://zorba.io/modules/image/animation';
2588+import schema namespace image = 'http://zorba.io/modules/image/image';
2589
2590 declare namespace an = "http://zorba.io/annotations";
2591
2592
2593=== modified file 'test/Queries/image/animation_create.xq'
2594--- test/Queries/image/animation_create.xq 2011-10-06 08:18:47 +0000
2595+++ test/Queries/image/animation_create.xq 2013-10-23 04:15:35 +0000
2596@@ -5,7 +5,7 @@
2597 : to disk using file:write-binary(a_path, $animatedGif), send it in an email etc.
2598 :)
2599 import module namespace file = 'http://expath.org/ns/file';
2600-import module namespace animation = 'http://www.zorba-xquery.com/modules/image/animation';
2601+import module namespace animation = 'http://zorba.io/modules/image/animation';
2602
2603 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2604
2605
2606=== modified file 'test/Queries/image/animation_create_morphed.xq'
2607--- test/Queries/image/animation_create_morphed.xq 2011-10-06 08:18:47 +0000
2608+++ test/Queries/image/animation_create_morphed.xq 2013-10-23 04:15:35 +0000
2609@@ -5,7 +5,7 @@
2610 : to disk using file:write-binary(a_path, $animatedGif), send it in an email etc.
2611 :)
2612 import module namespace file = 'http://expath.org/ns/file';
2613-import module namespace animation = 'http://www.zorba-xquery.com/modules/image/animation';
2614+import module namespace animation = 'http://zorba.io/modules/image/animation';
2615
2616 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2617
2618
2619=== modified file 'test/Queries/image/basic.xq'
2620--- test/Queries/image/basic.xq 2013-08-09 09:37:05 +0000
2621+++ test/Queries/image/basic.xq 2013-10-23 04:15:35 +0000
2622@@ -3,7 +3,7 @@
2623 :
2624 : @author Daniel Thomas
2625 :)
2626-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2627+import module namespace basic = 'http://zorba.io/modules/image/basic';
2628 import module namespace file = 'http://expath.org/ns/file';
2629
2630 declare namespace an = "http://zorba.io/annotations";
2631
2632=== modified file 'test/Queries/image/basic_compress.xq'
2633--- test/Queries/image/basic_compress.xq 2011-10-06 08:18:47 +0000
2634+++ test/Queries/image/basic_compress.xq 2013-10-23 04:15:35 +0000
2635@@ -4,7 +4,7 @@
2636 : to disk using file:write-binary(a_path, basic:compress($compressed-bird, xs:unsignedInt(2))), send it in an email etc.
2637 :)
2638 import module namespace file = 'http://expath.org/ns/file';
2639-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2640+import module namespace basic = 'http://zorba.io/modules/image/basic';
2641
2642 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2643
2644
2645=== modified file 'test/Queries/image/basic_convert.xq'
2646--- test/Queries/image/basic_convert.xq 2011-10-06 08:18:47 +0000
2647+++ test/Queries/image/basic_convert.xq 2013-10-23 04:15:35 +0000
2648@@ -4,7 +4,7 @@
2649 : to disk using file:write-binary(a_path, basic:compress($gif-bird, xs:unsignedInt(2))), send it in an email etc.
2650 :)
2651 import module namespace file = 'http://expath.org/ns/file';
2652-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2653+import module namespace basic = 'http://zorba.io/modules/image/basic';
2654
2655 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2656
2657
2658=== modified file 'test/Queries/image/basic_create.xq'
2659--- test/Queries/image/basic_create.xq 2011-10-06 08:18:47 +0000
2660+++ test/Queries/image/basic_create.xq 2013-10-23 04:15:35 +0000
2661@@ -3,7 +3,7 @@
2662 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
2663 : to disk using file:write-binary(a_path, $new-image)), send it in an email etc.
2664 :)
2665-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2666+import module namespace basic = 'http://zorba.io/modules/image/basic';
2667
2668 let $new-image as xs:base64Binary := basic:create(xs:unsignedInt(100), xs:unsignedInt(50), "GIF")
2669 return not(empty($new-image))
2670
2671=== modified file 'test/Queries/image/basic_equals.xq'
2672--- test/Queries/image/basic_equals.xq 2011-10-06 08:18:47 +0000
2673+++ test/Queries/image/basic_equals.xq 2013-10-23 04:15:35 +0000
2674@@ -3,7 +3,7 @@
2675 : are not equal.
2676 :)
2677 import module namespace file = 'http://expath.org/ns/file';
2678-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2679+import module namespace basic = 'http://zorba.io/modules/image/basic';
2680
2681 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2682
2683
2684=== modified file 'test/Queries/image/basic_exif.xq'
2685--- test/Queries/image/basic_exif.xq 2011-10-06 08:18:47 +0000
2686+++ test/Queries/image/basic_exif.xq 2013-10-23 04:15:35 +0000
2687@@ -3,7 +3,7 @@
2688 : Trying to read out the value of an non-existing exif tag will result in an empty sequence.
2689 :)
2690 import module namespace file = 'http://expath.org/ns/file';
2691-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2692+import module namespace basic = 'http://zorba.io/modules/image/basic';
2693
2694 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2695
2696
2697=== modified file 'test/Queries/image/basic_height.xq'
2698--- test/Queries/image/basic_height.xq 2011-10-06 08:18:47 +0000
2699+++ test/Queries/image/basic_height.xq 2013-10-23 04:15:35 +0000
2700@@ -3,7 +3,7 @@
2701 : The basic:height function returns the height in pixels (as xs:unsignedInt).
2702 :)
2703 import module namespace file = 'http://expath.org/ns/file';
2704-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2705+import module namespace basic = 'http://zorba.io/modules/image/basic';
2706
2707 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2708
2709
2710=== modified file 'test/Queries/image/basic_svg.xq'
2711--- test/Queries/image/basic_svg.xq 2012-10-29 07:53:55 +0000
2712+++ test/Queries/image/basic_svg.xq 2013-10-23 04:15:35 +0000
2713@@ -4,7 +4,7 @@
2714 : to disk using file:write-binary(a_path, basic:compress($jpeg-bird, xs:unsignedInt(2))), send it in an email etc.
2715 :)
2716 import module namespace file = 'http://expath.org/ns/file';
2717-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2718+import module namespace basic = 'http://zorba.io/modules/image/basic';
2719
2720 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2721
2722
2723=== modified file 'test/Queries/image/basic_type.xq'
2724--- test/Queries/image/basic_type.xq 2011-08-04 04:09:00 +0000
2725+++ test/Queries/image/basic_type.xq 2013-10-23 04:15:35 +0000
2726@@ -3,7 +3,7 @@
2727 : The basic:width function returns the width in pixels (as xs:unsignedInt).
2728 :)
2729 import module namespace file = 'http://expath.org/ns/file';
2730-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2731+import module namespace basic = 'http://zorba.io/modules/image/basic';
2732
2733 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2734
2735
2736=== modified file 'test/Queries/image/basic_width.xq'
2737--- test/Queries/image/basic_width.xq 2011-10-06 08:18:47 +0000
2738+++ test/Queries/image/basic_width.xq 2013-10-23 04:15:35 +0000
2739@@ -3,7 +3,7 @@
2740 : The basic:width function returns the width in pixels (as xs:unsignedInt).
2741 :)
2742 import module namespace file = 'http://expath.org/ns/file';
2743-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2744+import module namespace basic = 'http://zorba.io/modules/image/basic';
2745
2746 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2747
2748
2749=== modified file 'test/Queries/image/manipulation_1.xq'
2750--- test/Queries/image/manipulation_1.xq 2013-08-09 09:37:05 +0000
2751+++ test/Queries/image/manipulation_1.xq 2013-10-23 04:15:35 +0000
2752@@ -3,10 +3,10 @@
2753 :
2754 : @author Daniel Thomas
2755 :)
2756-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2757+import module namespace basic = 'http://zorba.io/modules/image/basic';
2758 import module namespace file = 'http://expath.org/ns/file';
2759-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
2760-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2761+import module namespace man = 'http://zorba.io/modules/image/manipulation';
2762+import schema namespace image = 'http://zorba.io/modules/image/image';
2763
2764 declare namespace an = "http://zorba.io/annotations";
2765
2766
2767=== modified file 'test/Queries/image/manipulation_2.xq'
2768--- test/Queries/image/manipulation_2.xq 2013-08-09 09:37:05 +0000
2769+++ test/Queries/image/manipulation_2.xq 2013-10-23 04:15:35 +0000
2770@@ -3,10 +3,10 @@
2771 :
2772 : @author Daniel Thomas
2773 :)
2774-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2775+import module namespace basic = 'http://zorba.io/modules/image/basic';
2776 import module namespace file = 'http://expath.org/ns/file';
2777-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
2778-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2779+import module namespace man = 'http://zorba.io/modules/image/manipulation';
2780+import schema namespace image = 'http://zorba.io/modules/image/image';
2781
2782 declare namespace an = "http://zorba.io/annotations";
2783
2784
2785=== modified file 'test/Queries/image/manipulation_3.xq'
2786--- test/Queries/image/manipulation_3.xq 2013-08-09 09:37:05 +0000
2787+++ test/Queries/image/manipulation_3.xq 2013-10-23 04:15:35 +0000
2788@@ -3,10 +3,10 @@
2789 :
2790 : @author Daniel Thomas
2791 :)
2792-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2793+import module namespace basic = 'http://zorba.io/modules/image/basic';
2794 import module namespace file = 'http://expath.org/ns/file';
2795-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
2796-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2797+import module namespace man = 'http://zorba.io/modules/image/manipulation';
2798+import schema namespace image = 'http://zorba.io/modules/image/image';
2799
2800 declare namespace an = "http://zorba.io/annotations";
2801
2802
2803=== modified file 'test/Queries/image/manipulation_4.xq'
2804--- test/Queries/image/manipulation_4.xq 2013-08-09 09:37:05 +0000
2805+++ test/Queries/image/manipulation_4.xq 2013-10-23 04:15:35 +0000
2806@@ -3,10 +3,10 @@
2807 :
2808 : @author Daniel Thomas
2809 :)
2810-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2811+import module namespace basic = 'http://zorba.io/modules/image/basic';
2812 import module namespace file = 'http://expath.org/ns/file';
2813-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
2814-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2815+import module namespace man = 'http://zorba.io/modules/image/manipulation';
2816+import schema namespace image = 'http://zorba.io/modules/image/image';
2817
2818 declare namespace an = "http://zorba.io/annotations";
2819
2820
2821=== modified file 'test/Queries/image/manipulation_5.xq'
2822--- test/Queries/image/manipulation_5.xq 2013-08-09 09:37:05 +0000
2823+++ test/Queries/image/manipulation_5.xq 2013-10-23 04:15:35 +0000
2824@@ -3,10 +3,10 @@
2825 :
2826 : @author Daniel Thomas
2827 :)
2828-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
2829+import module namespace basic = 'http://zorba.io/modules/image/basic';
2830 import module namespace file = 'http://expath.org/ns/file';
2831-import module namespace man = 'http://www.zorba-xquery.com/modules/image/manipulation';
2832-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
2833+import module namespace man = 'http://zorba.io/modules/image/manipulation';
2834+import schema namespace image = 'http://zorba.io/modules/image/image';
2835
2836 declare namespace an = "http://zorba.io/annotations";
2837
2838
2839=== modified file 'test/Queries/image/manipulation_add_noise.xq'
2840--- test/Queries/image/manipulation_add_noise.xq 2011-10-06 08:18:47 +0000
2841+++ test/Queries/image/manipulation_add_noise.xq 2013-10-23 04:15:35 +0000
2842@@ -6,7 +6,7 @@
2843 : to disk using file:write-binary(a_path, $noise-image), send it in an email etc.
2844 :)
2845 import module namespace file = 'http://expath.org/ns/file';
2846-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2847+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2848
2849 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2850
2851
2852=== modified file 'test/Queries/image/manipulation_blur.xq'
2853--- test/Queries/image/manipulation_blur.xq 2011-10-06 08:18:47 +0000
2854+++ test/Queries/image/manipulation_blur.xq 2013-10-23 04:15:35 +0000
2855@@ -6,7 +6,7 @@
2856 : to disk using file:write-binary(a_path, $blurred-image), send it in an email etc.
2857 :)
2858 import module namespace file = 'http://expath.org/ns/file';
2859-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2860+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2861
2862 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2863
2864
2865=== modified file 'test/Queries/image/manipulation_charcoal.xq'
2866--- test/Queries/image/manipulation_charcoal.xq 2011-10-06 08:18:47 +0000
2867+++ test/Queries/image/manipulation_charcoal.xq 2013-10-23 04:15:35 +0000
2868@@ -6,7 +6,7 @@
2869 : to disk using file:write-binary(a_path, $charcoaled-image), send it in an email etc.
2870 :)
2871 import module namespace file = 'http://expath.org/ns/file';
2872-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2873+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2874
2875 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2876
2877
2878=== modified file 'test/Queries/image/manipulation_chop.xq'
2879--- test/Queries/image/manipulation_chop.xq 2011-10-06 08:18:47 +0000
2880+++ test/Queries/image/manipulation_chop.xq 2013-10-23 04:15:35 +0000
2881@@ -7,7 +7,7 @@
2882 : to disk using file:write-binary(a_path, $chopped-image), send it in an email etc.
2883 :)
2884 import module namespace file = 'http://expath.org/ns/file';
2885-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2886+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2887
2888 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2889
2890
2891=== modified file 'test/Queries/image/manipulation_contrast.xq'
2892--- test/Queries/image/manipulation_contrast.xq 2011-10-06 08:18:47 +0000
2893+++ test/Queries/image/manipulation_contrast.xq 2013-10-23 04:15:35 +0000
2894@@ -6,7 +6,7 @@
2895 : to disk using file:write-binary(a_path, $contrasted-image), send it in an email etc.
2896 :)
2897 import module namespace file = 'http://expath.org/ns/file';
2898-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2899+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2900
2901 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2902
2903
2904=== modified file 'test/Queries/image/manipulation_crop.xq'
2905--- test/Queries/image/manipulation_crop.xq 2011-10-06 08:18:47 +0000
2906+++ test/Queries/image/manipulation_crop.xq 2013-10-23 04:15:35 +0000
2907@@ -7,7 +7,7 @@
2908 : to disk using file:write-binary(a_path, $cropped-image), send it in an email etc.
2909 :)
2910 import module namespace file = 'http://expath.org/ns/file';
2911-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2912+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2913
2914 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2915
2916
2917=== modified file 'test/Queries/image/manipulation_despeckle.xq'
2918--- test/Queries/image/manipulation_despeckle.xq 2011-10-06 08:18:47 +0000
2919+++ test/Queries/image/manipulation_despeckle.xq 2013-10-23 04:15:35 +0000
2920@@ -6,7 +6,7 @@
2921 : to disk using file:write-binary(a_path, $despeckled-image), send it in an email etc.
2922 :)
2923 import module namespace file = 'http://expath.org/ns/file';
2924-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2925+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2926
2927 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2928
2929
2930=== modified file 'test/Queries/image/manipulation_edge.xq'
2931--- test/Queries/image/manipulation_edge.xq 2011-10-06 08:18:47 +0000
2932+++ test/Queries/image/manipulation_edge.xq 2013-10-23 04:15:35 +0000
2933@@ -7,7 +7,7 @@
2934 : to disk using file:write-binary(a_path, $edged-image), send it in an email etc.
2935 :)
2936 import module namespace file = 'http://expath.org/ns/file';
2937-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2938+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2939
2940 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2941
2942
2943=== modified file 'test/Queries/image/manipulation_emboss.xq'
2944--- test/Queries/image/manipulation_emboss.xq 2011-10-06 08:18:47 +0000
2945+++ test/Queries/image/manipulation_emboss.xq 2013-10-23 04:15:35 +0000
2946@@ -6,7 +6,7 @@
2947 : to disk using file:write-binary(a_path, $embossed-image), send it in an email etc.
2948 :)
2949 import module namespace file = 'http://expath.org/ns/file';
2950-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2951+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2952
2953 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2954
2955
2956=== modified file 'test/Queries/image/manipulation_enhance.xq'
2957--- test/Queries/image/manipulation_enhance.xq 2011-10-06 08:18:47 +0000
2958+++ test/Queries/image/manipulation_enhance.xq 2013-10-23 04:15:35 +0000
2959@@ -6,7 +6,7 @@
2960 : to disk using file:write-binary(a_path, $enhanced-image), send it in an email etc.
2961 :)
2962 import module namespace file = 'http://expath.org/ns/file';
2963-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2964+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2965
2966 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2967
2968
2969=== modified file 'test/Queries/image/manipulation_equalize.xq'
2970--- test/Queries/image/manipulation_equalize.xq 2011-10-06 08:18:47 +0000
2971+++ test/Queries/image/manipulation_equalize.xq 2013-10-23 04:15:35 +0000
2972@@ -6,7 +6,7 @@
2973 : to disk using file:write(a_path, $enhanced-image, <method>binary</method>), send it in an email etc.
2974 :)
2975 import module namespace file = 'http://expath.org/ns/file';
2976-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2977+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2978
2979 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2980
2981
2982=== modified file 'test/Queries/image/manipulation_erase.xq'
2983--- test/Queries/image/manipulation_erase.xq 2011-10-06 08:18:47 +0000
2984+++ test/Queries/image/manipulation_erase.xq 2013-10-23 04:15:35 +0000
2985@@ -6,7 +6,7 @@
2986 : to disk using file:write(a_path, $erased-image, <method>binary</method>), send it in an email etc.
2987 :)
2988 import module namespace file = 'http://expath.org/ns/file';
2989-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
2990+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
2991
2992 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
2993
2994
2995=== modified file 'test/Queries/image/manipulation_flip.xq'
2996--- test/Queries/image/manipulation_flip.xq 2011-10-06 08:18:47 +0000
2997+++ test/Queries/image/manipulation_flip.xq 2013-10-23 04:15:35 +0000
2998@@ -6,7 +6,7 @@
2999 : to disk using file:write(a_path, $flip-image, <method>binary</method>), send it in an email etc.
3000 :)
3001 import module namespace file = 'http://expath.org/ns/file';
3002-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3003+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3004
3005 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3006
3007
3008=== modified file 'test/Queries/image/manipulation_flop.xq'
3009--- test/Queries/image/manipulation_flop.xq 2011-10-06 08:18:47 +0000
3010+++ test/Queries/image/manipulation_flop.xq 2013-10-23 04:15:35 +0000
3011@@ -6,7 +6,7 @@
3012 : to disk using file:write(a_path, $flop-image, <method>binary</method>), send it in an email etc.
3013 :)
3014 import module namespace file = 'http://expath.org/ns/file';
3015-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3016+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3017
3018 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3019
3020
3021=== modified file 'test/Queries/image/manipulation_gamma.xq'
3022--- test/Queries/image/manipulation_gamma.xq 2011-10-06 08:18:47 +0000
3023+++ test/Queries/image/manipulation_gamma.xq 2013-10-23 04:15:35 +0000
3024@@ -6,7 +6,7 @@
3025 : to disk using file:write(a_path, $gamma-corrected-image, <method>binary</method>), send it in an email etc.
3026 :)
3027 import module namespace file = 'http://expath.org/ns/file';
3028-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3029+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3030
3031 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3032
3033
3034=== modified file 'test/Queries/image/manipulation_gamma2.xq'
3035--- test/Queries/image/manipulation_gamma2.xq 2011-10-06 08:18:47 +0000
3036+++ test/Queries/image/manipulation_gamma2.xq 2013-10-23 04:15:35 +0000
3037@@ -6,7 +6,7 @@
3038 : to disk using file:write(a_path, $gamma-corrected-image, <method>binary</method>), send it in an email etc.
3039 :)
3040 import module namespace file = 'http://expath.org/ns/file';
3041-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3042+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3043
3044 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3045
3046
3047=== modified file 'test/Queries/image/manipulation_implode.xq'
3048--- test/Queries/image/manipulation_implode.xq 2011-10-06 08:18:47 +0000
3049+++ test/Queries/image/manipulation_implode.xq 2013-10-23 04:15:35 +0000
3050@@ -6,7 +6,7 @@
3051 : to disk using file:write(a_path, $imploded-image, <method>binary</method>), send it in an email etc.
3052 :)
3053 import module namespace file = 'http://expath.org/ns/file';
3054-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3055+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3056
3057 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3058
3059
3060=== modified file 'test/Queries/image/manipulation_oil_paint.xq'
3061--- test/Queries/image/manipulation_oil_paint.xq 2011-10-06 08:18:47 +0000
3062+++ test/Queries/image/manipulation_oil_paint.xq 2013-10-23 04:15:35 +0000
3063@@ -6,7 +6,7 @@
3064 : to disk using file:write(a_path, $oil-image, <method>binary</method>), send it in an email etc.
3065 :)
3066 import module namespace file = 'http://expath.org/ns/file';
3067-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3068+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3069
3070 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3071
3072
3073=== modified file 'test/Queries/image/manipulation_overlay.xq'
3074--- test/Queries/image/manipulation_overlay.xq 2011-10-06 08:18:47 +0000
3075+++ test/Queries/image/manipulation_overlay.xq 2013-10-23 04:15:35 +0000
3076@@ -5,8 +5,8 @@
3077 : to disk using file:write(a_path, $overlayed-image, <method>binary</method>), send it in an email etc.
3078 :)
3079 import module namespace file = 'http://expath.org/ns/file';
3080-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3081-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3082+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3083+import module namespace basic = 'http://zorba.io/modules/image/basic';
3084
3085 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3086
3087
3088=== modified file 'test/Queries/image/manipulation_reduce_noise.xq'
3089--- test/Queries/image/manipulation_reduce_noise.xq 2011-10-06 08:18:47 +0000
3090+++ test/Queries/image/manipulation_reduce_noise.xq 2013-10-23 04:15:35 +0000
3091@@ -6,7 +6,7 @@
3092 : to disk using file:write(a_path, $less-noisy-image, <method>binary</method>), send it in an email etc.
3093 :)
3094 import module namespace file = 'http://expath.org/ns/file';
3095-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3096+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3097
3098 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3099
3100
3101=== modified file 'test/Queries/image/manipulation_resize.xq'
3102--- test/Queries/image/manipulation_resize.xq 2011-10-06 08:18:47 +0000
3103+++ test/Queries/image/manipulation_resize.xq 2013-10-23 04:15:35 +0000
3104@@ -4,7 +4,7 @@
3105 : to disk using file:write(a_path, $resized-image, <method>binary</method>), send it in an email etc.
3106 :)
3107 import module namespace file = 'http://expath.org/ns/file';
3108-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3109+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3110
3111 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3112
3113
3114=== modified file 'test/Queries/image/manipulation_rotate.xq'
3115--- test/Queries/image/manipulation_rotate.xq 2011-10-06 08:18:47 +0000
3116+++ test/Queries/image/manipulation_rotate.xq 2013-10-23 04:15:35 +0000
3117@@ -6,7 +6,7 @@
3118 : to disk using file:write(a_path, $rotated-image, <method>binary</method>), send it in an email etc.
3119 :)
3120 import module namespace file = 'http://expath.org/ns/file';
3121-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3122+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3123
3124 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3125
3126
3127=== modified file 'test/Queries/image/manipulation_solarize.xq'
3128--- test/Queries/image/manipulation_solarize.xq 2011-10-06 08:18:47 +0000
3129+++ test/Queries/image/manipulation_solarize.xq 2013-10-23 04:15:35 +0000
3130@@ -6,7 +6,7 @@
3131 : to disk using file:write(a_path, $solarized-image, <method>binary</method>), send it in an email etc.
3132 :)
3133 import module namespace file = 'http://expath.org/ns/file';
3134-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3135+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3136
3137 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3138
3139
3140=== modified file 'test/Queries/image/manipulation_stereo.xq'
3141--- test/Queries/image/manipulation_stereo.xq 2011-10-06 08:18:47 +0000
3142+++ test/Queries/image/manipulation_stereo.xq 2013-10-23 04:15:35 +0000
3143@@ -7,7 +7,7 @@
3144 : to disk using file:write(a_path, $stereo-image, <method>binary</method>), send it in an email etc.
3145 :)
3146 import module namespace file = 'http://expath.org/ns/file';
3147-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3148+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3149
3150 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3151
3152
3153=== modified file 'test/Queries/image/manipulation_sub_image.xq'
3154--- test/Queries/image/manipulation_sub_image.xq 2011-10-06 08:18:47 +0000
3155+++ test/Queries/image/manipulation_sub_image.xq 2013-10-23 04:15:35 +0000
3156@@ -5,8 +5,8 @@
3157 : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
3158 :)
3159 import module namespace file = 'http://expath.org/ns/file';
3160-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3161-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3162+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3163+import module namespace basic = 'http://zorba.io/modules/image/basic';
3164
3165 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3166
3167
3168=== modified file 'test/Queries/image/manipulation_swirl.xq'
3169--- test/Queries/image/manipulation_swirl.xq 2011-10-06 08:18:47 +0000
3170+++ test/Queries/image/manipulation_swirl.xq 2013-10-23 04:15:35 +0000
3171@@ -6,7 +6,7 @@
3172 : to disk using file:write(a_path, $swirled-image, <method>binary</method>), send it in an email etc.
3173 :)
3174 import module namespace file = 'http://expath.org/ns/file';
3175-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3176+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3177
3178 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3179
3180
3181=== modified file 'test/Queries/image/manipulation_transparent.xq'
3182--- test/Queries/image/manipulation_transparent.xq 2011-10-06 08:18:47 +0000
3183+++ test/Queries/image/manipulation_transparent.xq 2013-10-23 04:15:35 +0000
3184@@ -6,7 +6,7 @@
3185 : to disk using file:write(a_path, $transparent-image, <method>binary</method>), send it in an email etc.
3186 :)
3187 import module namespace file = 'http://expath.org/ns/file';
3188-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3189+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3190
3191 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3192
3193
3194=== modified file 'test/Queries/image/manipulation_trim.xq'
3195--- test/Queries/image/manipulation_trim.xq 2011-10-06 08:18:47 +0000
3196+++ test/Queries/image/manipulation_trim.xq 2013-10-23 04:15:35 +0000
3197@@ -6,7 +6,7 @@
3198 : to disk using file:write(a_path, $trimmed-image, <method>binary</method>), send it in an email etc.
3199 :)
3200 import module namespace file = 'http://expath.org/ns/file';
3201-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3202+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3203
3204 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3205
3206
3207=== modified file 'test/Queries/image/manipulation_watermark.xq'
3208--- test/Queries/image/manipulation_watermark.xq 2011-10-06 08:18:47 +0000
3209+++ test/Queries/image/manipulation_watermark.xq 2013-10-23 04:15:35 +0000
3210@@ -6,7 +6,7 @@
3211 : to disk using file:write(a_path, $watermarked-image, <method>binary</method>), send it in an email etc.
3212 :)
3213 import module namespace file = 'http://expath.org/ns/file';
3214-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3215+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3216
3217 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3218
3219
3220=== modified file 'test/Queries/image/manipulation_zoom.xq'
3221--- test/Queries/image/manipulation_zoom.xq 2011-10-06 08:18:47 +0000
3222+++ test/Queries/image/manipulation_zoom.xq 2013-10-23 04:15:35 +0000
3223@@ -4,7 +4,7 @@
3224 : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
3225 :)
3226 import module namespace file = 'http://expath.org/ns/file';
3227-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3228+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3229
3230 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3231
3232
3233=== modified file 'test/Queries/image/manipulation_zoom_height.xq'
3234--- test/Queries/image/manipulation_zoom_height.xq 2011-10-06 08:18:47 +0000
3235+++ test/Queries/image/manipulation_zoom_height.xq 2013-10-23 04:15:35 +0000
3236@@ -5,8 +5,8 @@
3237 : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
3238 :)
3239 import module namespace file = 'http://expath.org/ns/file';
3240-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3241-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3242+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3243+import module namespace basic = 'http://zorba.io/modules/image/basic';
3244
3245 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3246
3247
3248=== modified file 'test/Queries/image/manipulation_zoom_width.xq'
3249--- test/Queries/image/manipulation_zoom_width.xq 2011-10-06 08:18:47 +0000
3250+++ test/Queries/image/manipulation_zoom_width.xq 2013-10-23 04:15:35 +0000
3251@@ -5,8 +5,8 @@
3252 : to disk using file:write(a_path, $zoomed-image, <method>binary</method>), send it in an email etc.
3253 :)
3254 import module namespace file = 'http://expath.org/ns/file';
3255-import module namespace manipulation = 'http://www.zorba-xquery.com/modules/image/manipulation';
3256-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3257+import module namespace manipulation = 'http://zorba.io/modules/image/manipulation';
3258+import module namespace basic = 'http://zorba.io/modules/image/basic';
3259
3260 declare variable $local:image-dir := fn:concat(file:dir-name(fn:static-base-uri()), "/images/");
3261
3262
3263=== modified file 'test/Queries/image/paint_1.xq'
3264--- test/Queries/image/paint_1.xq 2013-08-09 09:37:05 +0000
3265+++ test/Queries/image/paint_1.xq 2013-10-23 04:15:35 +0000
3266@@ -3,10 +3,10 @@
3267 :
3268 : @author Daniel Thomas
3269 :)
3270-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3271-import module namespace file = 'http://expath.org/ns/file';
3272-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3273-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
3274+import module namespace basic = 'http://zorba.io/modules/image/basic';
3275+import module namespace file = 'http://expath.org/ns/file';
3276+import module namespace paint = 'http://zorba.io/modules/image/paint';
3277+import schema namespace image = 'http://zorba.io/modules/image/image';
3278
3279 declare namespace an = "http://zorba.io/annotations";
3280
3281@@ -38,36 +38,77 @@
3282 (:~
3283 : @return true if the man:draw-line function works.
3284 :)
3285-declare %an:nondeterministic function local:test-draw-line() as xs:boolean {
3286- let $draw := paint:paint($local:gif, <image:line><image:start><image:x>-20</image:x><image:y>-20</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>)
3287+declare %an:nondeterministic function local:test-draw-line() as xs:boolean {
3288+ let $draw := paint:paint($local:gif,
3289+ {
3290+ "line" : {
3291+ "start" : [ -20, -20 ],
3292+ "end" : [ 80, 80 ]
3293+ }
3294+ })
3295 let $draw-ref := file:read-binary(concat($local:image-dir,"paint/line.gif"))
3296 return basic:equals($draw, $draw-ref)
3297 };
3298
3299 declare %an:nondeterministic function local:test-draw-line-color-red() {
3300- let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#6F0000</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>)
3301+ let $draw := paint:paint($local:gif,
3302+ {
3303+ "line" : {
3304+ "strokeColor" : "#6F0000",
3305+ "start" : [ 0, 0 ],
3306+ "end" : [ 80, 80 ]
3307+ }
3308+ })
3309 let $draw-ref := file:read-binary(concat($local:image-dir,"paint/redLine.gif"))
3310 return basic:equals($draw, $draw-ref)
3311
3312 };
3313
3314 declare %an:nondeterministic function local:test-draw-line-color-green() {
3315- let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#006F00</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>)
3316-
3317+ let $draw := paint:paint($local:gif,
3318+ {
3319+ "line" : {
3320+ "strokeColor" : "#006F00",
3321+ "start" : [ 0, 0 ],
3322+ "end" : [ 80, 80 ]
3323+ }
3324+ })
3325 let $draw-ref := file:read-binary(concat($local:image-dir,"paint/greenLine.gif"))
3326 return basic:equals($draw, $draw-ref)
3327
3328 };
3329
3330 declare %an:nondeterministic function local:test-draw-line-color-blue() {
3331- let $draw := paint:paint($local:gif, <image:line><image:strokeColor>#00006F</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>)
3332+ let $draw := paint:paint($local:gif,
3333+ {
3334+ "line" : {
3335+ "strokeColor" : "#00006F",
3336+ "start" : [ 0, 0 ],
3337+ "end" : [ 80, 80 ]
3338+ }
3339+ })
3340 let $draw-ref := file:read-binary(concat($local:image-dir,"paint/blueLine.gif"))
3341 return basic:equals($draw, $draw-ref)
3342
3343 };
3344
3345 declare %an:nondeterministic function local:test-stroke-width() {
3346- let $draw := paint:paint($local:gif, (<image:line><image:strokeWidth>10</image:strokeWidth><image:strokeColor>#000000</image:strokeColor><image:start><image:x>0</image:x><image:y>0</image:y></image:start><image:end><image:x>80</image:x><image:y>80</image:y></image:end></image:line>,<image:line><image:strokeColor>#FF00FF</image:strokeColor><image:start><image:x>30</image:x><image:y>0</image:y></image:start><image:end><image:x>70</image:x><image:y>90</image:y></image:end></image:line>))
3347+ let $draw := paint:paint($local:gif,
3348+ ({
3349+ "line" : {
3350+ "strokeWidth" : 10,
3351+ "strokeColor" : "#000000",
3352+ "start" : [ 0, 0 ],
3353+ "end" : [ 80, 80 ]
3354+ }
3355+ },
3356+ {
3357+ "line" : {
3358+ "strokeColor" : "#FF00FF",
3359+ "start" : [ 30, 0 ],
3360+ "end" : [ 70, 90 ]
3361+ }
3362+ }))
3363 let $draw-ref := file:read-binary(concat($local:image-dir,"paint/wideLine.gif"))
3364 return basic:equals($draw, $draw-ref)
3365
3366@@ -76,7 +117,7 @@
3367
3368
3369
3370-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
3371+declare %an:nondeterministic function local:main() as xs:string* {
3372
3373 let $a := local:test-draw-line()
3374 return
3375
3376=== modified file 'test/Queries/image/paint_2.xq'
3377--- test/Queries/image/paint_2.xq 2013-08-09 09:37:05 +0000
3378+++ test/Queries/image/paint_2.xq 2013-10-23 04:15:35 +0000
3379@@ -3,10 +3,10 @@
3380 :
3381 : @author Daniel Thomas
3382 :)
3383-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3384+import module namespace basic = 'http://zorba.io/modules/image/basic';
3385 import module namespace file = 'http://expath.org/ns/file';
3386-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3387-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
3388+import module namespace paint = 'http://zorba.io/modules/image/paint';
3389+import schema namespace img = 'http://zorba.io/modules/image/image';
3390
3391 declare namespace an = "http://zorba.io/annotations";
3392
3393@@ -37,14 +37,25 @@
3394
3395 declare %an:nondeterministic function local:test-draw-poly-line() as xs:boolean
3396 {
3397- let $draw := paint:paint($local:gif, <img:polyLine><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:point><img:x>200</img:x><img:y>200</img:y></img:point></img:polyLine>)
3398+ let $draw := paint:paint($local:gif,
3399+ {
3400+ "polyLine" : {
3401+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ], [ 200, 200 ] ]
3402+ }
3403+ })
3404 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLine.gif"))
3405 return basic:equals($draw, $draw-ref)
3406 };
3407
3408 declare %an:nondeterministic function local:test-draw-poly-line-anti-aliased() as xs:boolean
3409 {
3410- let $draw := paint:paint($local:gif, <img:polyLine><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
3411+ let $draw := paint:paint($local:gif,
3412+ {
3413+ "polyLine" : {
3414+ "antiAliasing" : fn:true(),
3415+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3416+ }
3417+ })
3418 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineAntiAliased.gif"))
3419 return basic:equals($draw, $draw-ref)
3420 };
3421@@ -54,27 +65,40 @@
3422 : @return true if the man:draw-poly-line function works.
3423 :)
3424 declare %an:nondeterministic function local:test-draw-poly-line-red() as xs:boolean
3425-{
3426- let $draw := paint:paint($local:gif, <img:polyLine><img:strokeColor>#FF0000</img:strokeColor><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
3427-
3428- let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineRed.gif"))
3429- return basic:equals($draw, $draw-ref)
3430+{
3431+ let $draw := paint:paint($local:gif,
3432+ {
3433+ "polyLine" : {
3434+ "strokeColor" : "#FF0000",
3435+ "antiAliasing" : fn:true(),
3436+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3437+ }
3438+ })
3439+ let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineRed.gif"))
3440+ return basic:equals($draw, $draw-ref)
3441 };
3442
3443
3444 (:~
3445 : @return true if the man:draw-poly-line function works.
3446 :)
3447-declare %an:nondeterministic function local:test-draw-poly-line-wide() as xs:boolean {
3448- let $draw := paint:paint($local:gif, <img:polyLine><img:strokeWidth>5</img:strokeWidth><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point></img:polyLine>)
3449-
3450- let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineWide.gif"))
3451- return basic:equals($draw, $draw-ref)
3452+declare %an:nondeterministic function local:test-draw-poly-line-wide() as xs:boolean
3453+{
3454+ let $draw := paint:paint($local:gif,
3455+ {
3456+ "polyLine" : {
3457+ "strokeWidth" : 5,
3458+ "antiAliasing" : fn:true(),
3459+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3460+ }
3461+ })
3462+ let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineWide.gif"))
3463+ return basic:equals($draw, $draw-ref)
3464 };
3465
3466
3467
3468-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
3469+declare %an:nondeterministic function local:main() as xs:string* {
3470
3471
3472 let $a := local:test-draw-poly-line()
3473
3474=== modified file 'test/Queries/image/paint_3.xq'
3475--- test/Queries/image/paint_3.xq 2013-08-09 09:37:05 +0000
3476+++ test/Queries/image/paint_3.xq 2013-10-23 04:15:35 +0000
3477@@ -3,10 +3,10 @@
3478 :
3479 : @author Daniel Thomas
3480 :)
3481-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3482+import module namespace basic = 'http://zorba.io/modules/image/basic';
3483 import module namespace file = 'http://expath.org/ns/file';
3484-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3485-import schema namespace img = 'http://www.zorba-xquery.com/modules/image/image';
3486+import module namespace paint = 'http://zorba.io/modules/image/paint';
3487+import schema namespace img = 'http://zorba.io/modules/image/image';
3488
3489 declare namespace an = "http://zorba.io/annotations";
3490
3491@@ -39,7 +39,14 @@
3492 : @return true if the man:draw-stroked-poly-line function works.
3493 :)
3494 declare %an:nondeterministic function local:test-draw-stroked-poly-line() as xs:boolean {
3495- let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
3496+ let $draw := paint:paint($local:gif,
3497+ {
3498+ "strokedPolyLine" : {
3499+ "points" : [ [10,10], [40,80], [50,30] ],
3500+ "strokeLength" : 5,
3501+ "gapLength" : 2
3502+ }
3503+ })
3504 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStroked.gif"))
3505 return basic:equals($draw, $draw-ref)
3506 };
3507@@ -49,7 +56,15 @@
3508 : @return true if the man:draw-stroked-poly-line function works.
3509 :)
3510 declare %an:nondeterministic function local:test-draw-stroked-poly-line-blue() as xs:boolean {
3511- let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:strokeColor>#0000FF</img:strokeColor><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
3512+ let $draw := paint:paint($local:gif,
3513+ {
3514+ "strokedPolyLine" : {
3515+ "strokeColor" : "#0000FF",
3516+ "points" : [ [10,10], [40,80], [50,30] ],
3517+ "strokeLength" : 5,
3518+ "gapLength" : 2
3519+ }
3520+ })
3521 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedBlue.gif"))
3522 return basic:equals($draw, $draw-ref)
3523 };
3524@@ -58,7 +73,15 @@
3525 : @return true if the man:draw-stroked-poly-line function works.
3526 :)
3527 declare %an:nondeterministic function local:test-draw-stroked-poly-line-wide() as xs:boolean {
3528- let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:strokeWidth>4</img:strokeWidth><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
3529+ let $draw := paint:paint($local:gif,
3530+ {
3531+ "strokedPolyLine" : {
3532+ "strokeWidth" : 4,
3533+ "points" : [ [10,10], [40,80], [50,30] ],
3534+ "strokeLength" : 5,
3535+ "gapLength" : 2
3536+ }
3537+ })
3538 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedWide.gif"))
3539 return basic:equals($draw, $draw-ref)
3540 };
3541@@ -67,12 +90,20 @@
3542 : @return true if the man:draw-stroked-poly-line function works.
3543 :)
3544 declare %an:nondeterministic function local:test-draw-stroked-poly-line-anti-aliased() as xs:boolean {
3545- let $draw := paint:paint($local:gif, <img:strokedPolyLine><img:antiAliasing>true</img:antiAliasing><img:point><img:x>10</img:x><img:y>10</img:y></img:point><img:point><img:x>40</img:x><img:y>80</img:y></img:point><img:point><img:x>50</img:x><img:y>30</img:y></img:point><img:strokeLength>5</img:strokeLength><img:gapLength>2</img:gapLength></img:strokedPolyLine>)
3546+ let $draw := paint:paint($local:gif,
3547+ {
3548+ "strokedPolyLine" : {
3549+ "antiAliasing" : fn:true(),
3550+ "points" : [ [10,10], [40,80], [50,30] ],
3551+ "strokeLength" : 5,
3552+ "gapLength" : 2
3553+ }
3554+ })
3555 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polyLineStrokedAntiAliased.gif"))
3556 return basic:equals($draw, $draw-ref)
3557 };
3558
3559-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
3560+declare %an:nondeterministic function local:main() as xs:string* {
3561
3562 let $a := local:test-draw-stroked-poly-line()
3563 return
3564
3565=== modified file 'test/Queries/image/paint_4.xq'
3566--- test/Queries/image/paint_4.xq 2013-08-09 09:37:05 +0000
3567+++ test/Queries/image/paint_4.xq 2013-10-23 04:15:35 +0000
3568@@ -3,10 +3,10 @@
3569 :
3570 : @author Daniel Thomas
3571 :)
3572-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3573+import module namespace basic = 'http://zorba.io/modules/image/basic';
3574 import module namespace file = 'http://expath.org/ns/file';
3575-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3576-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
3577+import module namespace paint = 'http://zorba.io/modules/image/paint';
3578+import schema namespace image = 'http://zorba.io/modules/image/image';
3579
3580 declare namespace an = "http://zorba.io/annotations";
3581
3582@@ -39,7 +39,13 @@
3583 : @return true if the man:draw-rectangle function works.
3584 :)
3585 declare %an:nondeterministic function local:test-draw-rectangle() as xs:boolean {
3586- let $draw := paint:paint($local:gif, <image:rectangle><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
3587+ let $draw := paint:paint($local:gif,
3588+ {
3589+ "rectangle" : {
3590+ "upperLeft" : [ 20, 20 ],
3591+ "lowerRight" : [ 50, 50 ]
3592+ }
3593+ })
3594 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangle.gif"))
3595 return basic:equals($draw, $draw-ref)
3596 };
3597@@ -48,7 +54,14 @@
3598 : @return true if the man:draw-rectangle function works.
3599 :)
3600 declare %an:nondeterministic function local:test-draw-rectangle-green() as xs:boolean {
3601- let $draw := paint:paint($local:gif, <image:rectangle><image:strokeColor>#00AF00</image:strokeColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
3602+ let $draw := paint:paint($local:gif,
3603+ {
3604+ "rectangle" : {
3605+ "strokeColor" : "#00AF00",
3606+ "upperLeft" : [ 20, 20 ],
3607+ "lowerRight" : [ 50, 50 ]
3608+ }
3609+ })
3610 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleGreen.gif"))
3611 return basic:equals($draw, $draw-ref)
3612 };
3613@@ -58,7 +71,15 @@
3614 : @return true if the man:draw-rectangle function works.
3615 :)
3616 declare %an:nondeterministic function local:test-draw-rectangle-green-red() as xs:boolean {
3617- let $draw := paint:paint($local:gif, <image:rectangle><image:strokeColor>#00AF00</image:strokeColor><image:fillColor>#A10000</image:fillColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
3618+ let $draw := paint:paint($local:gif,
3619+ {
3620+ "rectangle" : {
3621+ "strokeColor" : "#00AF00",
3622+ "fillColor" : "#A10000",
3623+ "upperLeft" : [ 20, 20 ],
3624+ "lowerRight" : [ 50, 50 ]
3625+ }
3626+ })
3627 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleGreenRed.gif"))
3628 return basic:equals($draw, $draw-ref)
3629 };
3630@@ -68,7 +89,17 @@
3631 : @return true if the man:draw-rectangle function works.
3632 :)
3633 declare %an:nondeterministic function local:test-draw-rectangle-anti-aliased() as xs:boolean {
3634- let $draw := paint:paint($local:gif, <image:rectangle><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#00AF00</image:strokeColor><image:fillColor>#A10000</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
3635+ let $draw := paint:paint($local:gif,
3636+ {
3637+ "rectangle" : {
3638+ "strokeWidth" : 5,
3639+ "strokeColor" : "#00AF00",
3640+ "fillColor" : "#A10000",
3641+ "antiAliasing" : fn:true(),
3642+ "upperLeft" : [ 20, 20 ],
3643+ "lowerRight" : [ 50, 50 ]
3644+ }
3645+ })
3646 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleAntiAliased.gif"))
3647 return basic:equals($draw, $draw-ref)
3648 };
3649@@ -77,7 +108,15 @@
3650 : @return true if the man:draw-rounded-rectangle function works.
3651 :)
3652 declare %an:nondeterministic function local:test-draw-rounded-rectangle() as xs:boolean {
3653- let $draw := paint:paint($local:gif, <image:roundedRectangle><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
3654+ let $draw := paint:paint($local:gif,
3655+ {
3656+ "roundedRectangle" : {
3657+ "upperLeft" : [ 20, 20 ],
3658+ "lowerRight" : [ 50, 50 ],
3659+ "cornerWidth" : 10,
3660+ "cornerHeight" : 10
3661+ }
3662+ })
3663 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRounded.gif"))
3664 return basic:equals($draw, $draw-ref)
3665 };
3666@@ -86,7 +125,16 @@
3667 : @return true if the man:draw-rounded-rectangle function works.
3668 :)
3669 declare %an:nondeterministic function local:test-draw-rounded-rectangle-blue() as xs:boolean {
3670- let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
3671+ let $draw := paint:paint($local:gif,
3672+ {
3673+ "roundedRectangle" : {
3674+ "strokeColor" : "#0000FF",
3675+ "upperLeft" : [ 20, 20 ],
3676+ "lowerRight" : [ 50, 50 ],
3677+ "cornerWidth" : 10,
3678+ "cornerHeight" : 10
3679+ }
3680+ })
3681 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedBlue.gif"))
3682 return basic:equals($draw, $draw-ref)
3683 };
3684@@ -96,7 +144,17 @@
3685 : @return true if the man:draw-rounded-rectangle function works.
3686 :)
3687 declare %an:nondeterministic function local:test-draw-rounded-rectangle-blue-green() as xs:boolean {
3688- let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
3689+ let $draw := paint:paint($local:gif,
3690+ {
3691+ "roundedRectangle" : {
3692+ "strokeColor" : "#0000FF",
3693+ "fillColor" : "#00FF00",
3694+ "upperLeft" : [ 20, 20 ],
3695+ "lowerRight" : [ 50, 50 ],
3696+ "cornerWidth" : 10,
3697+ "cornerHeight" : 10
3698+ }
3699+ })
3700 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedBlueGreen.gif"))
3701 return basic:equals($draw, $draw-ref)
3702 };
3703@@ -106,13 +164,24 @@
3704 : @return true if the man:draw-rounded-rectangle function works.
3705 :)
3706 declare %an:nondeterministic function local:test-draw-rounded-rectangle-anti-aliased() as xs:boolean {
3707- let $draw := paint:paint($local:gif, <image:roundedRectangle><image:strokeColor>#0000FF</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:upperLeft><image:x>20</image:x><image:y>20</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>50</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
3708+ let $draw := paint:paint($local:gif,
3709+ {
3710+ "roundedRectangle" : {
3711+ "strokeColor" : "#0000FF",
3712+ "fillColor" : "#00FF00",
3713+ "antiAliased" : fn:true(),
3714+ "upperLeft" : [ 20, 20 ],
3715+ "lowerRight" : [ 50, 50 ],
3716+ "cornerWidth" : 10,
3717+ "cornerHeight" : 10
3718+ }
3719+ })
3720 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/rectangleRoundedAntiAliased.gif"))
3721 return basic:equals($draw, $draw-ref)
3722 };
3723
3724
3725-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
3726+declare %an:nondeterministic function local:main() as xs:string* {
3727
3728 let $a := local:test-draw-rectangle()
3729 return
3730
3731=== modified file 'test/Queries/image/paint_5.xq'
3732--- test/Queries/image/paint_5.xq 2013-08-09 09:37:05 +0000
3733+++ test/Queries/image/paint_5.xq 2013-10-23 04:15:35 +0000
3734@@ -3,10 +3,10 @@
3735 :
3736 : @author Daniel Thomas
3737 :)
3738-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3739+import module namespace basic = 'http://zorba.io/modules/image/basic';
3740 import module namespace file = 'http://expath.org/ns/file';
3741-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3742-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
3743+import module namespace paint = 'http://zorba.io/modules/image/paint';
3744+import schema namespace image = 'http://zorba.io/modules/image/image';
3745
3746 declare namespace an = "http://zorba.io/annotations";
3747
3748@@ -40,7 +40,12 @@
3749 : @return true if the man:draw-circle function works.
3750 :)
3751 declare %an:nondeterministic function local:test-draw-circle() as xs:boolean {
3752- let $draw := paint:paint($local:jpg, <image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>5</image:perimeter></image:circle>)
3753+ let $draw := paint:paint($local:jpg, {
3754+ "circle" : {
3755+ "origin" : [ 20, 20 ],
3756+ "radius" : 5
3757+ }
3758+ })
3759 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/circle.jpg"))
3760 return basic:equals($draw, $draw-ref)
3761 };
3762@@ -50,7 +55,13 @@
3763 : @return true if the man:draw-ellipse function works.
3764 :)
3765 declare %an:nondeterministic function local:test-draw-ellipse() as xs:boolean {
3766- let $draw := paint:paint($local:jpg, <image:ellipse><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>30</image:perimeterX><image:perimeterY>20</image:perimeterY></image:ellipse>)
3767+ let $draw := paint:paint($local:jpg, {
3768+ "ellipse" : {
3769+ "origin" : [ 50, 50 ],
3770+ "radiusX" : 30,
3771+ "radiusY" : 20
3772+ }
3773+ })
3774 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/ellipse.jpg"))
3775 return basic:equals($draw, $draw-ref)
3776 };
3777@@ -59,7 +70,15 @@
3778 : @return true if the man:draw-arc function works.
3779 :)
3780 declare %an:nondeterministic function local:test-draw-arc() as xs:boolean {
3781- let $draw := paint:paint($local:jpg, <image:arc><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
3782+ let $draw := paint:paint($local:jpg, {
3783+ "arc" : {
3784+ "origin" : [ 50, 50 ],
3785+ "radiusX" : 10,
3786+ "radiusY" : 20,
3787+ "startDegrees" : 180,
3788+ "endDegrees" : 270
3789+ }
3790+ })
3791 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arc.jpg"))
3792 return basic:equals($draw, $draw-ref)
3793 };
3794@@ -68,7 +87,16 @@
3795 : @return true if the man:draw-arc function works.
3796 :)
3797 declare %an:nondeterministic function local:test-draw-red-arc() as xs:boolean {
3798- let $draw := paint:paint($local:jpg, <image:arc><image:strokeColor>#FF0000</image:strokeColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
3799+ let $draw := paint:paint($local:jpg, {
3800+ "arc" : {
3801+ "strokeColor" : "#FF0000",
3802+ "origin" : [ 50, 50 ],
3803+ "radiusX" : 10,
3804+ "radiusY" : 20,
3805+ "startDegrees" : 180,
3806+ "endDegrees" : 270
3807+ }
3808+ })
3809 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcRed.jpg"))
3810 return basic:equals($draw, $draw-ref)
3811 };
3812@@ -77,7 +105,17 @@
3813 : @return true if the man:draw-arc function works.
3814 :)
3815 declare %an:nondeterministic function local:test-draw-red-green-arc() as xs:boolean {
3816- let $draw := paint:paint($local:jpg, <image:arc><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
3817+ let $draw := paint:paint($local:jpg, {
3818+ "arc" : {
3819+ "strokeColor" : "#FF0000",
3820+ "fillColor" : "#00AF00",
3821+ "origin" : [ 50, 50 ],
3822+ "radiusX" : 10,
3823+ "radiusY" : 20,
3824+ "startDegrees" : 180,
3825+ "endDegrees" : 270
3826+ }
3827+ })
3828 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcRedGreen.jpg"))
3829 return basic:equals($draw, $draw-ref)
3830 };
3831@@ -86,7 +124,18 @@
3832 : @return true if the man:draw-arc function works.
3833 :)
3834 declare %an:nondeterministic function local:test-draw-wide-arc() as xs:boolean {
3835- let $draw := paint:paint($local:jpg, <image:arc><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
3836+ let $draw := paint:paint($local:jpg, {
3837+ "arc" : {
3838+ "strokeWidth" : 5,
3839+ "strokeColor" : "#FF0000",
3840+ "fillColor" : "#00AF00",
3841+ "origin" : [ 50, 50 ],
3842+ "radiusX" : 10,
3843+ "radiusY" : 20,
3844+ "startDegrees" : 180,
3845+ "endDegrees" : 270
3846+ }
3847+ })
3848 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcWide.jpg"))
3849 return basic:equals($draw, $draw-ref)
3850 };
3851@@ -97,7 +146,19 @@
3852 : @return true if the man:draw-arc function works.
3853 :)
3854 declare %an:nondeterministic function local:test-draw-anti-aliased-arc() as xs:boolean {
3855- let $draw := paint:paint($local:jpg, <image:arc><image:strokeWidth>5</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00AF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:origin><image:x>50</image:x><image:y>50</image:y></image:origin><image:perimeterX>10</image:perimeterX><image:perimeterY>20</image:perimeterY><image:startDegrees>180</image:startDegrees><image:endDegrees>270</image:endDegrees></image:arc>)
3856+ let $draw := paint:paint($local:jpg, {
3857+ "arc" : {
3858+ "strokeWidth" : 5,
3859+ "strokeColor" : "#FF0000",
3860+ "fillColor" : "#00AF00",
3861+ "antiAliasing" : fn:true(),
3862+ "origin" : [ 50, 50 ],
3863+ "radiusX" : 10,
3864+ "radiusY" : 20,
3865+ "startDegrees" : 180,
3866+ "endDegrees" : 270
3867+ }
3868+ })
3869 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/arcAntiAliased.jpg"))
3870 return basic:equals($draw, $draw-ref)
3871 };
3872@@ -106,7 +167,7 @@
3873
3874
3875
3876-declare %an:nondeterministic %an:sequential function local:main() as xs:string* {
3877+declare %an:nondeterministic function local:main() as xs:string* {
3878
3879 let $a := local:test-draw-circle()
3880 return
3881
3882=== modified file 'test/Queries/image/paint_6.xq'
3883--- test/Queries/image/paint_6.xq 2013-08-09 09:37:05 +0000
3884+++ test/Queries/image/paint_6.xq 2013-10-23 04:15:35 +0000
3885@@ -3,10 +3,10 @@
3886 :
3887 : @author Daniel Thomas
3888 :)
3889-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3890+import module namespace basic = 'http://zorba.io/modules/image/basic';
3891 import module namespace file = 'http://expath.org/ns/file';
3892-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3893-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
3894+import module namespace paint = 'http://zorba.io/modules/image/paint';
3895+import schema namespace image = 'http://zorba.io/modules/image/image';
3896
3897 declare namespace an = "http://zorba.io/annotations";
3898
3899@@ -37,7 +37,12 @@
3900 : @return true if the man:draw-polygon function works.
3901 :)
3902 declare %an:nondeterministic function local:test-draw-polygon() as xs:boolean {
3903- let $draw := paint:paint($local:jpg, <image:polygon><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
3904+ let $draw := paint:paint($local:jpg,
3905+ {
3906+ "polygon" : {
3907+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3908+ }
3909+ })
3910 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygon.jpg"))
3911 return basic:equals($draw, $draw-ref)
3912 };
3913@@ -46,7 +51,13 @@
3914 : @return true if the man:draw-polygon function works.
3915 :)
3916 declare %an:nondeterministic function local:test-draw-polygon-red() as xs:boolean {
3917- let $draw := paint:paint($local:jpg, <image:polygon><image:strokeColor>#FF0000</image:strokeColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
3918+ let $draw := paint:paint($local:jpg,
3919+ {
3920+ "polygon" : {
3921+ "strokeColor" : "#FF0000",
3922+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3923+ }
3924+ })
3925 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonRed.jpg"))
3926 return basic:equals($draw, $draw-ref)
3927 };
3928@@ -55,7 +66,14 @@
3929 : @return true if the man:draw-polygon function works.
3930 :)
3931 declare %an:nondeterministic function local:test-draw-polygon-red-green() as xs:boolean {
3932- let $draw := paint:paint($local:jpg, <image:polygon><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
3933+ let $draw := paint:paint($local:jpg,
3934+ {
3935+ "polygon" : {
3936+ "strokeColor" : "#FF0000",
3937+ "fillColor" : "#00FF00",
3938+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3939+ }
3940+ })
3941 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonRedGreen.jpg"))
3942 return basic:equals($draw, $draw-ref)
3943 };
3944@@ -64,7 +82,15 @@
3945 : @return true if the man:draw-polygon function works.
3946 :)
3947 declare %an:nondeterministic function local:test-draw-polygon-wide() as xs:boolean {
3948- let $draw := paint:paint($local:jpg, <image:polygon><image:strokeWidth>3</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
3949+ let $draw := paint:paint($local:jpg,
3950+ {
3951+ "polygon" : {
3952+ "strokeWidth" : 3,
3953+ "strokeColor" : "#FF0000",
3954+ "fillColor" : "#00FF00",
3955+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3956+ }
3957+ })
3958 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonWide.jpg"))
3959 return basic:equals($draw, $draw-ref)
3960 };
3961@@ -74,7 +100,16 @@
3962 : @return true if the man:draw-polygon function works.
3963 :)
3964 declare %an:nondeterministic function local:test-draw-polygon-anti-aliased() as xs:boolean {
3965- let $draw := paint:paint($local:jpg, <image:polygon><image:strokeWidth>3</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:fillColor>#00FF00</image:fillColor><image:antiAliasing>true</image:antiAliasing><image:point><image:x>10</image:x><image:y>10</image:y></image:point><image:point><image:x>40</image:x><image:y>80</image:y></image:point><image:point><image:x>50</image:x><image:y>30</image:y></image:point></image:polygon>)
3966+ let $draw := paint:paint($local:jpg,
3967+ {
3968+ "polygon" : {
3969+ "strokeWidth" : 3,
3970+ "strokeColor" : "#FF0000",
3971+ "fillColor" : "#00FF00",
3972+ "antiAliasing" : fn:true(),
3973+ "points" : [ [ 10, 10 ], [ 40, 80 ], [ 50, 30 ] ]
3974+ }
3975+ })
3976 let $draw-ref := file:read-binary(concat($local:image-dir, "paint/polygonAntiAliased.jpg"))
3977 return basic:equals($draw, $draw-ref)
3978 };
3979
3980=== modified file 'test/Queries/image/paint_circles.xq'
3981--- test/Queries/image/paint_circles.xq 2011-08-07 00:38:36 +0000
3982+++ test/Queries/image/paint_circles.xq 2013-10-23 04:15:35 +0000
3983@@ -3,34 +3,58 @@
3984 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
3985 : to disk using file:write(a_path, $image-with-circles, <method>binary</method>), send it in an email etc.
3986 :
3987- : Actually, as the paint function accepts sequences of shapes, it would have been possible to paint all circles, ellipses and arcs with one single command
3988- : paint:paint($new-image, (<image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>,
3989- : <image:ellipse><image:origin><image:x>40</image:x><image:y>70</image:y></image:origin><image:perimeterX>20</image:perimeterX><image:perimeterY>10</image:perimeterY></image:ellipse>,
3990- : <image:arc><image:origin><image:x>70</image:x><image:y>35</image:y></image:origin><image:perimeterX>15</image:perimeterX><image:perimeterY>25</image:perimeterY><image:startDegrees>90</image:startDegrees><image:endDegrees>180</image:endDegrees></image:arc>,
3991- : <image:circle><image:fillColor>#0000FF</image:fillColor><image:origin><image:x>80</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>))
3992- :
3993+ : Actually, as the paint function accepts sequences of shapes, it would have been possible to paint all circles, ellipses and arcs with one single command
3994 : However, here it is done with several function calls to make it more clear what exactly is painted.
3995 :
3996 :)
3997-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
3998-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
3999+import module namespace basic = 'http://zorba.io/modules/image/basic';
4000+import module namespace paint = 'http://zorba.io/modules/image/paint';
4001 import module namespace file = 'http://expath.org/ns/file';
4002
4003-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4004+import schema namespace image = 'http://zorba.io/modules/image/image';
4005
4006 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4007
4008 (: paint a simple circle with origin in (20, 20) and a perimeter of 20px to the image :)
4009-let $image-with-circle := paint:paint($new-image, <image:circle><image:origin><image:x>20</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>)
4010+let $image-with-circle := paint:paint($new-image,
4011+{
4012+ "circle" : {
4013+ "origin" : [ 20, 20 ],
4014+ "radius" : 20
4015+ }
4016+})
4017
4018 (: paint an ellipse to the image :)
4019-let $image-with-circles := paint:paint($image-with-circle, <image:ellipse><image:origin><image:x>40</image:x><image:y>70</image:y></image:origin><image:perimeterX>20</image:perimeterX><image:perimeterY>10</image:perimeterY></image:ellipse>)
4020+let $image-with-circles := paint:paint($image-with-circle,
4021+{
4022+ "ellipse" : {
4023+ "origin" : [ 40, 70 ],
4024+ "radiusX" : 20,
4025+ "radiusY" : 10
4026+ }
4027+})
4028
4029 (: paint an arc from 90 to 180 degrees to the image :)
4030-let $image-with-circles := paint:paint($image-with-circles, <image:arc><image:origin><image:x>70</image:x><image:y>35</image:y></image:origin><image:perimeterX>15</image:perimeterX><image:perimeterY>25</image:perimeterY><image:startDegrees>90</image:startDegrees><image:endDegrees>180</image:endDegrees></image:arc>)
4031+let $image-with-circles := paint:paint($image-with-circles,
4032+{
4033+ "arc" : {
4034+ "origin" : [ 70, 35 ],
4035+ "radiusX" : 15,
4036+ "radiusY" : 25,
4037+ "startDegrees" : 90,
4038+ "endDegrees" : 180
4039+ }
4040+})
4041
4042 (: paint a blue circle with black contour onto the image :)
4043-let $image-with-circles := paint:paint($image-with-circles, <image:circle><image:fillColor>#0000FF</image:fillColor><image:origin><image:x>80</image:x><image:y>20</image:y></image:origin><image:perimeter>20</image:perimeter></image:circle>)
4044+let $image-with-circles := paint:paint($image-with-circles,
4045+{
4046+ "circle" : {
4047+ "fillColor" : "#0000FF",
4048+ "origin" : [ 80, 20 ],
4049+ "radius" : 20
4050+ }
4051+})
4052
4053
4054 return not(empty($image-with-circles))
4055
4056=== modified file 'test/Queries/image/paint_different_lines.xq'
4057--- test/Queries/image/paint_different_lines.xq 2011-08-07 00:38:36 +0000
4058+++ test/Queries/image/paint_different_lines.xq 2013-10-23 04:15:35 +0000
4059@@ -10,20 +10,50 @@
4060 :
4061 : However, to show exactly what is painted it was done with several function calls in this example (which is much less performant).
4062 :)
4063-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
4064-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4065+import module namespace basic = 'http://zorba.io/modules/image/basic';
4066+import module namespace paint = 'http://zorba.io/modules/image/paint';
4067
4068-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4069+import schema namespace image = 'http://zorba.io/modules/image/image';
4070
4071 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4072 (: paint a simple line from (10, 0) to (10, 100) :)
4073-let $image-with-1-line := paint:paint($new-image, <image:line><image:start><image:x>10</image:x><image:y>0</image:y></image:start><image:end><image:x>10</image:x><image:y>100</image:y></image:end></image:line>)
4074+let $image-with-1-line := paint:paint($new-image,
4075+{
4076+ "line" : {
4077+ "start" : [10,0],
4078+ "end" : [10,100]
4079+ }
4080+})
4081 (: paint a simple red line from (30, 0) to (30, 100) :)
4082-let $image-with-2-line := paint:paint($image-with-1-line, <image:line><image:strokeColor>#FF0000</image:strokeColor><image:start><image:x>30</image:x><image:y>0</image:y></image:start><image:end><image:x>30</image:x><image:y>100</image:y></image:end></image:line>)
4083+let $image-with-2-line := paint:paint($image-with-1-line,
4084+{
4085+ "line" : {
4086+ "strokeColor" : "#FF0000",
4087+ "start" : [30,0],
4088+ "end" : [30,100]
4089+ }
4090+})
4091 (: paint a simple red anti-aliased line from (50, 0) to (50, 100) :)
4092-let $image-with-3-line := paint:paint($image-with-2-line, <image:line><image:strokeColor>#FF0000</image:strokeColor><image:antiAliasing>true</image:antiAliasing><image:start><image:x>50</image:x><image:y>0</image:y></image:start><image:end><image:x>50</image:x><image:y>100</image:y></image:end></image:line>)
4093+let $image-with-3-line := paint:paint($image-with-2-line,
4094+{
4095+ "line" : {
4096+ "strokeColor" : "#FF0000",
4097+ "antiAliasing" : fn:true(),
4098+ "start" : [50,0],
4099+ "end" : [50,100]
4100+ }
4101+})
4102 (: paint a simple red wide anti-aliased line from (70, 0) to (70, 100) :)
4103-let $image-with-4-line := paint:paint($image-with-3-line, <image:line><image:strokeWidth>10</image:strokeWidth><image:strokeColor>#FF0000</image:strokeColor><image:antiAliasing>true</image:antiAliasing><image:start><image:x>70</image:x><image:y>0</image:y></image:start><image:end><image:x>70</image:x><image:y>100</image:y></image:end></image:line>)
4104+let $image-with-4-line := paint:paint($image-with-3-line,
4105+{
4106+ "line" : {
4107+ "strokeWidth" : 10,
4108+ "strokeColor" : "#FF0000",
4109+ "antiAliasing" : fn:true(),
4110+ "start" : [70,0],
4111+ "end" : [70,100]
4112+ }
4113+})
4114
4115 return not(empty($image-with-4-line))
4116
4117
4118=== modified file 'test/Queries/image/paint_polygon.xq'
4119--- test/Queries/image/paint_polygon.xq 2011-08-07 00:38:36 +0000
4120+++ test/Queries/image/paint_polygon.xq 2013-10-23 04:15:35 +0000
4121@@ -3,15 +3,20 @@
4122 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
4123 : to disk using file:write(a_path, $image-with-polygon, <method>binary</method>), send it in an email etc.
4124 :)
4125-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
4126-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4127+import module namespace basic = 'http://zorba.io/modules/image/basic';
4128+import module namespace paint = 'http://zorba.io/modules/image/paint';
4129
4130-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4131+import schema namespace image = 'http://zorba.io/modules/image/image';
4132
4133 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4134
4135 (: paint an anti-aliased polyline which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
4136-let $image-with-polygon := paint:paint($new-image, <image:polygon><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point></image:polygon>)
4137+let $image-with-polygon := paint:paint($new-image, {
4138+ "polyLine" : {
4139+ "antiAliasing" : fn:true(),
4140+ "points" : [ [ 0, 0 ], [ 30, 70 ], [ 20, 18 ], [ 89, 33 ] ]
4141+ }
4142+})
4143
4144 return not(empty($image-with-polygon))
4145
4146
4147=== modified file 'test/Queries/image/paint_polyline.xq'
4148--- test/Queries/image/paint_polyline.xq 2011-08-07 00:38:36 +0000
4149+++ test/Queries/image/paint_polyline.xq 2013-10-23 04:15:35 +0000
4150@@ -3,15 +3,20 @@
4151 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
4152 : to disk using file:write(a_path, $image-with-polyline, <method>binary</method>), send it in an email etc.
4153 :)
4154-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
4155-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4156+import module namespace basic = 'http://zorba.io/modules/image/basic';
4157+import module namespace paint = 'http://zorba.io/modules/image/paint';
4158
4159-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4160+import schema namespace image = 'http://zorba.io/modules/image/image';
4161
4162 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4163
4164 (: paint an anti-aliased polyline which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
4165-let $image-with-polyline := paint:paint($new-image, <image:polyLine><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point></image:polyLine>)
4166+let $image-with-polyline := paint:paint($new-image, {
4167+ "polyLine" : {
4168+ "antiAliasing" : fn:true(),
4169+ "points" : [ [ 0, 0 ], [ 30, 70 ], [ 20, 18 ], [ 89, 33 ] ]
4170+ }
4171+})
4172
4173 return not(empty($image-with-polyline))
4174
4175
4176=== modified file 'test/Queries/image/paint_rectangles.xq'
4177--- test/Queries/image/paint_rectangles.xq 2011-08-07 00:38:36 +0000
4178+++ test/Queries/image/paint_rectangles.xq 2013-10-23 04:15:35 +0000
4179@@ -12,20 +12,42 @@
4180 :
4181 : However, to make clear what exaclty is painted it was done with several function calls in this example (which is less performant).
4182 :)
4183-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
4184-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4185+import module namespace basic = 'http://zorba.io/modules/image/basic';
4186+import module namespace paint = 'http://zorba.io/modules/image/paint';
4187
4188-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4189+import schema namespace image = 'http://zorba.io/modules/image/image';
4190
4191 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4192
4193 (: paint a simple rectangle to the image :)
4194-let $image-with-rectangle := paint:paint($new-image, <image:rectangle><image:upperLeft><image:x>10</image:x><image:y>10</image:y></image:upperLeft><image:lowerRight><image:x>20</image:x><image:y>20</image:y></image:lowerRight></image:rectangle>)
4195+let $image-with-rectangle := paint:paint($new-image,
4196+{
4197+ "rectangle" : {
4198+ "upperLeft" : [10,10],
4199+ "lowerRight" : [20,20]
4200+ }
4201+})
4202
4203 (: paint a rounded rectangle to the image with a corner width of 10px and a corner height of 10 px :)
4204-let $image-with-rectangles := paint:paint($image-with-rectangle, <image:roundedRectangle><image:upperLeft><image:x>30</image:x><image:y>30</image:y></image:upperLeft><image:lowerRight><image:x>50</image:x><image:y>60</image:y></image:lowerRight><image:cornerWidth>10</image:cornerWidth><image:cornerHeight>10</image:cornerHeight></image:roundedRectangle>)
4205+let $image-with-rectangles := paint:paint($image-with-rectangle,
4206+{
4207+ "roundedRectangle" : {
4208+ "upperLeft" : [30,30],
4209+ "lowerRight" : [50,60],
4210+ "cornerWidth" : 10,
4211+ "cornerHeight" : 10
4212+ }
4213+})
4214
4215 (: paint a rectangle with green contour which is filled with red to the image :)
4216-let $image-with-rectangles := paint:paint($image-with-rectangles, <image:rectangle><image:strokeColor>#00FF00</image:strokeColor><image:fillColor>#FF0000</image:fillColor><image:upperLeft><image:x>75</image:x><image:y>10</image:y></image:upperLeft><image:lowerRight><image:x>95</image:x><image:y>50</image:y></image:lowerRight></image:rectangle>)
4217+let $image-with-rectangles := paint:paint($image-with-rectangles,
4218+{
4219+ "rectangle" : {
4220+ "strokeColor" : "#00FF00",
4221+ "fillColor" : "#FF0000",
4222+ "upperLeft" : [75,10],
4223+ "lowerRight" : [95,50]
4224+ }
4225+})
4226
4227 return not(empty($image-with-rectangles))
4228
4229=== modified file 'test/Queries/image/paint_stroked_polyline.xq'
4230--- test/Queries/image/paint_stroked_polyline.xq 2011-08-07 00:38:36 +0000
4231+++ test/Queries/image/paint_stroked_polyline.xq 2013-10-23 04:15:35 +0000
4232@@ -3,14 +3,21 @@
4233 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
4234 : to disk using file:write(a_path, $image-with-polyline, <method>binary</method>), send it in an email etc.
4235 :)
4236-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic';
4237-import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4238+import module namespace basic = 'http://zorba.io/modules/image/basic';
4239+import module namespace paint = 'http://zorba.io/modules/image/paint';
4240
4241-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4242+import schema namespace image = 'http://zorba.io/modules/image/image';
4243
4244 let $new-image := basic:create(xs:unsignedInt(100), xs:unsignedInt(100), "GIF")
4245 (: paint an anti-aliased polyline with stoke length 2 and gap length 1 which goes through the points (0,0) (30, 70), (20, 18), (89, 33) :)
4246-let $image-with-polyline := paint:paint($new-image, <image:strokedPolyLine><image:antiAliasing>true</image:antiAliasing><image:point><image:x>0</image:x><image:y>0</image:y></image:point><image:point><image:x>30</image:x><image:y>70</image:y></image:point><image:point><image:x>20</image:x><image:y>18</image:y></image:point><image:point><image:x>89</image:x><image:y>33</image:y></image:point><image:strokeLength>2</image:strokeLength><image:gapLength>5</image:gapLength></image:strokedPolyLine>)
4247+let $image-with-polyline := paint:paint($new-image,
4248+{
4249+ "strokedPolyLine" : {
4250+ "points" : [ [ 0, 0 ], [ 30, 70 ], [ 20, 18 ], [ 89, 33 ] ],
4251+ "strokeLength" : 2,
4252+ "gapLength" : 5
4253+ }
4254+})
4255
4256 return not(empty($image-with-polyline))
4257
4258
4259=== modified file 'test/Queries/image/paint_text.xq'
4260--- test/Queries/image/paint_text.xq 2011-08-07 00:38:36 +0000
4261+++ test/Queries/image/paint_text.xq 2013-10-23 04:15:35 +0000
4262@@ -3,13 +3,21 @@
4263 : As it is, the example just asserts that the resulting xs:base64Binary is not empty, in a real application one could further process the image, or write it
4264 : to disk using file:write-binary(a_path, $image-with-text), send it in an email etc.
4265 :)
4266-import module namespace basic = 'http://www.zorba-xquery.com/modules/image/basic'; import module namespace paint = 'http://www.zorba-xquery.com/modules/image/paint';
4267-import schema namespace image = 'http://www.zorba-xquery.com/modules/image/image';
4268+import module namespace basic = 'http://zorba.io/modules/image/basic'; import module namespace paint = 'http://zorba.io/modules/image/paint';
4269+import schema namespace image = 'http://zorba.io/modules/image/image';
4270
4271 let $new-image := basic:create(xs:unsignedInt(200), xs:unsignedInt(100), "GIF")
4272
4273 (: write a really important message to the image :)
4274
4275-let $image-with-text := paint:paint($new-image, <image:text><image:origin><image:x>10</image:x><image:y>40</image:y></image:origin><image:text>Zorba really rocks!</image:text><image:font>Arial</image:font><image:font-size>12</image:font-size></image:text>)
4276+let $image-with-text := paint:paint($new-image,
4277+{
4278+ "text" : {
4279+ "origin" : [ 10, 40 ],
4280+ "text" : "Zorba really rocks!",
4281+ "font" : "Arial",
4282+ "fontSize" : 12
4283+ }
4284+})
4285
4286 return not(empty($image-with-text))

Subscribers

People subscribed via source and target branches

to all changes: