mathematical 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +11 -21
  3. data/ext/mathematical/extconf.rb +21 -12
  4. data/ext/mathematical/lasem/Makefile +10 -10
  5. data/ext/mathematical/lasem/docs/Makefile +9 -9
  6. data/ext/mathematical/lasem/docs/reference/Makefile +9 -9
  7. data/ext/mathematical/lasem/docs/reference/lasem/Makefile +15 -9
  8. data/ext/mathematical/lasem/docs/reference/lasem/lasem-decl-list.txt +245 -0
  9. data/ext/mathematical/lasem/docs/reference/lasem/lasem-decl.txt +856 -0
  10. data/ext/mathematical/lasem/docs/reference/lasem/lasem-overrides.txt +0 -0
  11. data/ext/mathematical/lasem/itex2mml/Makefile +9 -9
  12. data/ext/mathematical/lasem/src/Makefile +34 -13
  13. data/ext/mathematical/lasem/src/lasemrender.c +13 -7
  14. data/ext/mathematical/lasem/src/lsmdomenumtypes.c +99 -0
  15. data/ext/mathematical/lasem/src/lsmdomenumtypes.h +26 -0
  16. data/ext/mathematical/lasem/src/lsmmathmlenums.c +24 -0
  17. data/ext/mathematical/lasem/src/lsmmathmlenums.h +12 -1
  18. data/ext/mathematical/lasem/src/lsmmathmlenumtypes.c +793 -0
  19. data/ext/mathematical/lasem/src/lsmmathmlenumtypes.h +96 -0
  20. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.c +14 -0
  21. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.h +1 -1
  22. data/ext/mathematical/lasem/src/lsmmathmltraits.c +24 -0
  23. data/ext/mathematical/lasem/src/lsmmathmltraits.h +1 -0
  24. data/ext/mathematical/lasem/src/lsmsvgattributes.h +50 -0
  25. data/ext/mathematical/lasem/src/lsmsvgdocument.c +18 -0
  26. data/ext/mathematical/lasem/src/lsmsvgenums.c +130 -0
  27. data/ext/mathematical/lasem/src/lsmsvgenums.h +59 -0
  28. data/ext/mathematical/lasem/src/lsmsvgenumtypes.c +1254 -0
  29. data/ext/mathematical/lasem/src/lsmsvgenumtypes.h +129 -0
  30. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.c +115 -0
  31. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.h +58 -0
  32. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.c +206 -0
  33. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.h +64 -0
  34. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.c +124 -0
  35. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.h +60 -0
  36. data/ext/mathematical/lasem/src/lsmsvgfilterimage.c +167 -0
  37. data/ext/mathematical/lasem/src/lsmsvgfilterimage.h +61 -0
  38. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.c +116 -0
  39. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.h +58 -0
  40. data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c +9 -2
  41. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.c +1169 -87
  42. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.h +28 -2
  43. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.c +142 -0
  44. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.h +61 -0
  45. data/ext/mathematical/lasem/src/lsmsvgtraits.c +249 -0
  46. data/ext/mathematical/lasem/src/lsmsvgtraits.h +18 -0
  47. data/ext/mathematical/lasem/src/lsmsvgtypes.h +6 -0
  48. data/ext/mathematical/lasem/src/lsmsvgview.c +267 -66
  49. data/ext/mathematical/lasem/src/lsmsvgview.h +23 -0
  50. data/ext/mathematical/lasem/src/lsmtraits.c +53 -1
  51. data/ext/mathematical/lasem/src/lsmtraits.h +2 -0
  52. data/ext/mathematical/lasem/tests/Makefile +26 -15
  53. data/ext/mathematical/lasem/tests/filter.c +152 -0
  54. data/ext/mathematical/lasem/tests/lsmtest.c +34 -30
  55. data/ext/mathematical/lasem/tests/suite.c +5 -2
  56. data/ext/mathematical/lib/libmtex2MML.a +0 -0
  57. data/ext/mathematical/mtex2MML/build/CMakeCache.txt +425 -0
  58. data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeCCompiler.cmake +55 -0
  59. data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeCXXCompiler.cmake +56 -0
  60. data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeSystem.cmake +15 -0
  61. data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.c +393 -0
  62. data/ext/mathematical/mtex2MML/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  63. data/ext/mathematical/mtex2MML/build/CMakeFiles/CMakeRuleHashes.txt +34 -0
  64. data/ext/mathematical/mtex2MML/build/CMakeFiles/Continuous.dir/DependInfo.cmake +27 -0
  65. data/ext/mathematical/mtex2MML/build/CMakeFiles/Continuous.dir/cmake_clean.cmake +8 -0
  66. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousBuild.dir/DependInfo.cmake +27 -0
  67. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousBuild.dir/cmake_clean.cmake +8 -0
  68. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousConfigure.dir/DependInfo.cmake +27 -0
  69. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousConfigure.dir/cmake_clean.cmake +8 -0
  70. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousCoverage.dir/DependInfo.cmake +27 -0
  71. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousCoverage.dir/cmake_clean.cmake +8 -0
  72. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousMemCheck.dir/DependInfo.cmake +27 -0
  73. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousMemCheck.dir/cmake_clean.cmake +8 -0
  74. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousStart.dir/DependInfo.cmake +27 -0
  75. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousStart.dir/cmake_clean.cmake +8 -0
  76. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousSubmit.dir/DependInfo.cmake +27 -0
  77. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousSubmit.dir/cmake_clean.cmake +8 -0
  78. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousTest.dir/DependInfo.cmake +27 -0
  79. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousTest.dir/cmake_clean.cmake +8 -0
  80. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousUpdate.dir/DependInfo.cmake +27 -0
  81. data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousUpdate.dir/cmake_clean.cmake +8 -0
  82. data/ext/mathematical/mtex2MML/build/CMakeFiles/Experimental.dir/DependInfo.cmake +27 -0
  83. data/ext/mathematical/mtex2MML/build/CMakeFiles/Experimental.dir/cmake_clean.cmake +8 -0
  84. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalBuild.dir/DependInfo.cmake +27 -0
  85. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalBuild.dir/cmake_clean.cmake +8 -0
  86. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalConfigure.dir/DependInfo.cmake +27 -0
  87. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalConfigure.dir/cmake_clean.cmake +8 -0
  88. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalCoverage.dir/DependInfo.cmake +27 -0
  89. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalCoverage.dir/cmake_clean.cmake +8 -0
  90. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalMemCheck.dir/DependInfo.cmake +27 -0
  91. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalMemCheck.dir/cmake_clean.cmake +8 -0
  92. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalStart.dir/DependInfo.cmake +27 -0
  93. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalStart.dir/cmake_clean.cmake +8 -0
  94. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalSubmit.dir/DependInfo.cmake +27 -0
  95. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalSubmit.dir/cmake_clean.cmake +8 -0
  96. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalTest.dir/DependInfo.cmake +27 -0
  97. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalTest.dir/cmake_clean.cmake +8 -0
  98. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalUpdate.dir/DependInfo.cmake +27 -0
  99. data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalUpdate.dir/cmake_clean.cmake +8 -0
  100. data/ext/mathematical/mtex2MML/build/CMakeFiles/Makefile.cmake +95 -0
  101. data/ext/mathematical/mtex2MML/build/CMakeFiles/Nightly.dir/DependInfo.cmake +27 -0
  102. data/ext/mathematical/mtex2MML/build/CMakeFiles/Nightly.dir/cmake_clean.cmake +8 -0
  103. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyBuild.dir/DependInfo.cmake +27 -0
  104. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyBuild.dir/cmake_clean.cmake +8 -0
  105. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyConfigure.dir/DependInfo.cmake +27 -0
  106. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyConfigure.dir/cmake_clean.cmake +8 -0
  107. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyCoverage.dir/DependInfo.cmake +27 -0
  108. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyCoverage.dir/cmake_clean.cmake +8 -0
  109. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemCheck.dir/DependInfo.cmake +27 -0
  110. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemCheck.dir/cmake_clean.cmake +8 -0
  111. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemoryCheck.dir/DependInfo.cmake +27 -0
  112. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemoryCheck.dir/cmake_clean.cmake +8 -0
  113. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyStart.dir/DependInfo.cmake +27 -0
  114. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyStart.dir/cmake_clean.cmake +8 -0
  115. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlySubmit.dir/DependInfo.cmake +27 -0
  116. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlySubmit.dir/cmake_clean.cmake +8 -0
  117. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyTest.dir/DependInfo.cmake +27 -0
  118. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyTest.dir/cmake_clean.cmake +8 -0
  119. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyUpdate.dir/DependInfo.cmake +27 -0
  120. data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyUpdate.dir/cmake_clean.cmake +8 -0
  121. data/ext/mathematical/mtex2MML/build/CMakeFiles/TargetDirectories.txt +34 -0
  122. data/ext/mathematical/mtex2MML/build/CMakeFiles/format.dir/DependInfo.cmake +27 -0
  123. data/ext/mathematical/mtex2MML/build/CMakeFiles/format.dir/cmake_clean.cmake +8 -0
  124. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/DependInfo.cmake +44 -0
  125. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/cmake_clean.cmake +19 -0
  126. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/link.txt +1 -0
  127. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/DependInfo.cmake +43 -0
  128. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/cmake_clean.cmake +18 -0
  129. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/cmake_clean_target.cmake +3 -0
  130. data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/link.txt +2 -0
  131. data/ext/mathematical/mtex2MML/build/CMakeFiles/memcheck.dir/DependInfo.cmake +27 -0
  132. data/ext/mathematical/mtex2MML/build/CMakeFiles/memcheck.dir/cmake_clean.cmake +8 -0
  133. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/DependInfo.cmake +44 -0
  134. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/cmake_clean.cmake +19 -0
  135. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/link.txt +1 -0
  136. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/DependInfo.cmake +59 -0
  137. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/cmake_clean.cmake +35 -0
  138. data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/link.txt +1 -0
  139. data/ext/mathematical/mtex2MML/build/CTestTestfile.cmake +7 -0
  140. data/ext/mathematical/mtex2MML/build/Makefile +1332 -0
  141. data/ext/mathematical/mtex2MML/build/cmake_install.cmake +43 -0
  142. data/ext/mathematical/mtex2MML/build/lexer.c +8877 -0
  143. data/ext/mathematical/mtex2MML/build/libmtex2MML.a +0 -0
  144. data/ext/mathematical/mtex2MML/build/mtex2mml_export.h +35 -0
  145. data/ext/mathematical/mtex2MML/build/parser.c +10202 -0
  146. data/ext/mathematical/mtex2MML/build/parser.h +619 -0
  147. data/ext/mathematical/mtex2MML/src/mtex2MML.h +1 -1
  148. data/lib/mathematical/version.rb +1 -1
  149. metadata +115 -2
@@ -25,7 +25,9 @@
25
25
  #define LSM_SVG_FILTER_SURFACE_H
26
26
 
27
27
  #include <lsmtypes.h>
28
+ #include <lsmsvgtraits.h>
28
29
  #include <cairo.h>
30
+ #include <gdk-pixbuf/gdk-pixbuf.h>
29
31
 
30
32
  G_BEGIN_DECLS
31
33
 
@@ -40,7 +42,6 @@ LsmSvgFilterSurface * lsm_svg_filter_surface_new (const char *name, unsigned
40
42
  LsmSvgFilterSurface * lsm_svg_filter_surface_new_with_content (const char *name, cairo_surface_t *surface, const LsmBox *subregion);
41
43
  LsmSvgFilterSurface * lsm_svg_filter_surface_new_similar (const char *name, LsmSvgFilterSurface *model, const LsmBox *subregion);
42
44
 
43
- void lsm_svg_filter_surface_copy_data (LsmSvgFilterSurface *to, LsmSvgFilterSurface *from);
44
45
  const char * lsm_svg_filter_surface_get_name (LsmSvgFilterSurface *surface);
45
46
  cairo_surface_t * lsm_svg_filter_surface_get_cairo_surface(LsmSvgFilterSurface *surface);
46
47
  const LsmBox * lsm_svg_filter_surface_get_subregion (LsmSvgFilterSurface *surface);
@@ -52,7 +53,7 @@ void lsm_svg_filter_surface_blend (LsmSvgFilterSurface *input_1,
52
53
  LsmSvgFilterSurface *input_2,
53
54
  LsmSvgFilterSurface *output,
54
55
  int blending_mode);
55
- void lsm_svg_filter_surface_fast_blur (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output,
56
+ void lsm_svg_filter_surface_blur (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output,
56
57
  double sx, double sy);
57
58
  void lsm_svg_filter_surface_flood (LsmSvgFilterSurface *surface,
58
59
  double red, double green, double blue, double opacity);
@@ -60,6 +61,31 @@ void lsm_svg_filter_surface_offset (LsmSvgFilterSurface *input, LsmSvgFilte
60
61
  int dx, int dy);
61
62
  void lsm_svg_filter_surface_merge (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output);
62
63
  void lsm_svg_filter_surface_tile (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output);
64
+ void lsm_svg_filter_surface_color_matrix (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output,
65
+ LsmSvgColorFilterType type, unsigned n_values, const double *values);
66
+ void lsm_svg_filter_surface_convolve_matrix (LsmSvgFilterSurface *input, LsmSvgFilterSurface *output,
67
+ unsigned x_order, unsigned y_order,
68
+ unsigned n_values, const double *values,
69
+ double divisor, double bias, unsigned target_x, unsigned target_y,
70
+ LsmSvgEdgeMode edge_mode, gboolean preserve_alpha);
71
+ void lsm_svg_filter_surface_displacement_map (LsmSvgFilterSurface *input_1,
72
+ LsmSvgFilterSurface *input_2,
73
+ LsmSvgFilterSurface *output,
74
+ double x_scale, double y_scale,
75
+ LsmSvgChannelSelector x_channel_selector,
76
+ LsmSvgChannelSelector y_channel_selector);
77
+ void lsm_svg_filter_surface_image (LsmSvgFilterSurface *output, GdkPixbuf *pixbuf,
78
+ LsmSvgPreserveAspectRatio preserve_aspect_ratio);
79
+ void lsm_svg_filter_surface_morphology (LsmSvgFilterSurface *input_surface, LsmSvgFilterSurface *output_surface,
80
+ LsmSvgMorphologyOperator op, double rx, double ry);
81
+ void lsm_svg_filter_surface_specular_lighting(LsmSvgFilterSurface *output_surface,
82
+ double surface_scale, double specular_constant, double specular_exponent,
83
+ double dx, double dy);
84
+ void lsm_svg_filter_surface_turbulence (LsmSvgFilterSurface *output_surface,
85
+ double base_frequency_x, double base_frequency_y,
86
+ int n_octaves, double seed,
87
+ LsmSvgStitchTiles stitch_tiles, LsmSvgTurbulenceType type,
88
+ const cairo_matrix_t *transform);
63
89
 
64
90
  G_END_DECLS
65
91
 
@@ -0,0 +1,142 @@
1
+ /* Lasem
2
+ *
3
+ * Copyright © 2012 Emmanuel Pacaud
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General
16
+ * Public License along with this library; if not, write to the
17
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
+ * Boston, MA 02111-1307, USA.
19
+ *
20
+ * Author:
21
+ * Emmanuel Pacaud <emmanuel@gnome.org>
22
+ */
23
+
24
+ #include <lsmsvgfilterturbulence.h>
25
+ #include <lsmsvgview.h>
26
+
27
+ static GObjectClass *parent_class;
28
+
29
+ /* GdomNode implementation */
30
+
31
+ static const char *
32
+ lsm_svg_filter_turbulence_get_node_name (LsmDomNode *node)
33
+ {
34
+ return "feTurbulence";
35
+ }
36
+
37
+ /* LsmSvgElement implementation */
38
+
39
+ static void
40
+ lsm_svg_filter_turbulence_apply (LsmSvgFilterPrimitive *self, LsmSvgView *view,
41
+ const char *input, const char *output, const LsmBox *subregion)
42
+ {
43
+ LsmSvgFilterTurbulence *turbulence = LSM_SVG_FILTER_TURBULENCE (self);
44
+
45
+ lsm_svg_view_apply_turbulence (view, output, subregion,
46
+ turbulence->base_frequency.value.a,
47
+ turbulence->base_frequency.value.b,
48
+ turbulence->n_octaves.value,
49
+ turbulence->seed.value,
50
+ turbulence->stitch_tiles.value,
51
+ turbulence->type.value);
52
+ }
53
+
54
+ /* LsmSvgFilterTurbulence implementation */
55
+
56
+ LsmDomNode *
57
+ lsm_svg_filter_turbulence_new (void)
58
+ {
59
+ return g_object_new (LSM_TYPE_SVG_FILTER_TURBULENCE, NULL);
60
+ }
61
+
62
+ static const LsmSvgOneOrTwoDouble base_frequency_default = {0.0, 0.0};
63
+ static const int n_octaves_default = 1;
64
+ static const double seed_default = 0.0;
65
+ static const LsmSvgStitchTiles stitch_tiles_default = LSM_SVG_STITCH_TILES_NO_STITCH;
66
+ static const LsmSvgTurbulenceType type_default = LSM_SVG_TURBULENCE_TYPE_TURBULENCE;
67
+
68
+ static void
69
+ lsm_svg_filter_turbulence_init (LsmSvgFilterTurbulence *self)
70
+ {
71
+ self->base_frequency.value = base_frequency_default;
72
+ self->n_octaves.value = n_octaves_default;
73
+ self->seed.value = seed_default;
74
+ self->stitch_tiles.value = stitch_tiles_default;
75
+ self->type.value = type_default;
76
+ }
77
+
78
+ static void
79
+ lsm_svg_filter_turbulence_finalize (GObject *object)
80
+ {
81
+ parent_class->finalize (object);
82
+ }
83
+
84
+ /* LsmSvgFilterTurbulence class */
85
+
86
+ static const LsmAttributeInfos lsm_svg_filter_turbulence_attribute_infos[] = {
87
+ {
88
+ .name = "baseFrequency",
89
+ .attribute_offset = offsetof (LsmSvgFilterTurbulence, base_frequency),
90
+ .trait_class = &lsm_svg_one_or_two_double_trait_class,
91
+ .trait_default = &base_frequency_default
92
+ },
93
+ {
94
+ .name = "numOctaves",
95
+ .attribute_offset = offsetof (LsmSvgFilterTurbulence, n_octaves),
96
+ .trait_class = &lsm_integer_trait_class,
97
+ .trait_default = &n_octaves_default
98
+ },
99
+ {
100
+ .name = "seed",
101
+ .attribute_offset = offsetof (LsmSvgFilterTurbulence, seed),
102
+ .trait_class = &lsm_double_trait_class,
103
+ .trait_default = &seed_default
104
+ },
105
+ {
106
+ .name = "stitchTiles",
107
+ .attribute_offset = offsetof (LsmSvgFilterTurbulence, stitch_tiles),
108
+ .trait_class = &lsm_svg_stitch_tiles_trait_class,
109
+ .trait_default = &stitch_tiles_default
110
+ },
111
+ {
112
+ .name = "type",
113
+ .attribute_offset = offsetof (LsmSvgFilterTurbulence, type),
114
+ .trait_class = &lsm_svg_turbulence_type_trait_class,
115
+ .trait_default = &type_default
116
+ }
117
+ };
118
+
119
+ static void
120
+ lsm_svg_filter_turbulence_class_init (LsmSvgFilterTurbulenceClass *klass)
121
+ {
122
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
123
+ LsmDomNodeClass *d_node_class = LSM_DOM_NODE_CLASS (klass);
124
+ LsmSvgElementClass *s_element_class = LSM_SVG_ELEMENT_CLASS (klass);
125
+ LsmSvgFilterPrimitiveClass *f_primitive_class = LSM_SVG_FILTER_PRIMITIVE_CLASS (klass);
126
+
127
+ parent_class = g_type_class_peek_parent (klass);
128
+
129
+ object_class->finalize = lsm_svg_filter_turbulence_finalize;
130
+
131
+ d_node_class->get_node_name = lsm_svg_filter_turbulence_get_node_name;
132
+
133
+ s_element_class->attribute_manager = lsm_attribute_manager_duplicate (s_element_class->attribute_manager);
134
+
135
+ lsm_attribute_manager_add_attributes (s_element_class->attribute_manager,
136
+ G_N_ELEMENTS (lsm_svg_filter_turbulence_attribute_infos),
137
+ lsm_svg_filter_turbulence_attribute_infos);
138
+
139
+ f_primitive_class->apply = lsm_svg_filter_turbulence_apply;
140
+ }
141
+
142
+ G_DEFINE_TYPE (LsmSvgFilterTurbulence, lsm_svg_filter_turbulence, LSM_TYPE_SVG_FILTER_PRIMITIVE)
@@ -0,0 +1,61 @@
1
+ /* Lasem
2
+ *
3
+ * Copyright © 2015 Emmanuel Pacaud
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General
16
+ * Public License along with this library; if not, write to the
17
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
+ * Boston, MA 02111-1307, USA.
19
+ *
20
+ * Author:
21
+ * Emmanuel Pacaud <emmanuel@gnome.org>
22
+ */
23
+
24
+ #ifndef LSM_SVG_FILTER_TURBULENCE_H
25
+ #define LSM_SVG_FILTER_TURBULENCE_H
26
+
27
+ #include <lsmsvgtypes.h>
28
+ #include <lsmsvgfilterprimitive.h>
29
+
30
+ G_BEGIN_DECLS
31
+
32
+ #define LSM_TYPE_SVG_FILTER_TURBULENCE (lsm_svg_filter_turbulence_get_type ())
33
+ #define LSM_SVG_FILTER_TURBULENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LSM_TYPE_SVG_FILTER_TURBULENCE, LsmSvgFilterTurbulence))
34
+ #define LSM_SVG_FILTER_TURBULENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LSM_TYPE_SVG_FILTER_TURBULENCE, LsmSvgFilterTurbulenceClass))
35
+ #define LSM_IS_SVG_FILTER_TURBULENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LSM_TYPE_SVG_FILTER_TURBULENCE))
36
+ #define LSM_IS_SVG_FILTER_TURBULENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LSM_TYPE_SVG_FILTER_TURBULENCE))
37
+ #define LSM_SVG_FILTER_TURBULENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), LSM_TYPE_SVG_FILTER_TURBULENCE, LsmSvgFilterTurbulenceClass))
38
+
39
+ typedef struct _LsmSvgFilterTurbulenceClass LsmSvgFilterTurbulenceClass;
40
+
41
+ struct _LsmSvgFilterTurbulence {
42
+ LsmSvgFilterPrimitive base;
43
+
44
+ LsmSvgOneOrTwoDoubleAttribute base_frequency;
45
+ LsmSvgIntegerAttribute n_octaves;
46
+ LsmSvgDoubleAttribute seed;
47
+ LsmSvgStitchTilesAttribute stitch_tiles;
48
+ LsmSvgTurbulenceTypeAttribute type;
49
+ };
50
+
51
+ struct _LsmSvgFilterTurbulenceClass {
52
+ LsmSvgFilterPrimitiveClass element_class;
53
+ };
54
+
55
+ GType lsm_svg_filter_turbulence_get_type (void);
56
+
57
+ LsmDomNode * lsm_svg_filter_turbulence_new (void);
58
+
59
+ G_END_DECLS
60
+
61
+ #endif
@@ -103,6 +103,71 @@ const LsmTraitClass lsm_svg_enable_background_trait_class = {
103
103
  .to_string = lsm_svg_enable_background_trait_to_string
104
104
  };
105
105
 
106
+ static gboolean
107
+ lsm_svg_vector_trait_from_string (LsmTrait *abstract_trait, char *string)
108
+ {
109
+ LsmSvgVector *vector = (LsmSvgVector *) abstract_trait;
110
+ unsigned int n_values = 1;
111
+ gboolean success = FALSE;
112
+ char *iter = (char *) string;
113
+
114
+ g_free (vector->values);
115
+ vector->n_values = 0;
116
+ vector->values = NULL;
117
+
118
+ while (*iter != '\0') {
119
+ if (*iter == ',' ||
120
+ *iter == ' ') {
121
+ n_values++;
122
+ do {
123
+ iter++;
124
+ } while (*iter == ',' ||
125
+ *iter == ' ');
126
+ } else
127
+ iter++;
128
+ }
129
+
130
+ vector->values = g_new (double, n_values);
131
+ vector->n_values = n_values;
132
+
133
+ iter = (char *)string;
134
+ n_values = lsm_str_parse_double_list (&iter, vector->n_values, vector->values);
135
+ success = n_values == vector->n_values;
136
+
137
+ if (!success) {
138
+ g_free (vector->values);
139
+ vector->values = NULL;
140
+ vector->n_values = 0;
141
+ }
142
+
143
+ return success;
144
+ }
145
+
146
+ static char *
147
+ lsm_svg_vector_trait_to_string (LsmTrait *abstract_trait)
148
+ {
149
+ g_assert_not_reached ();
150
+
151
+ return NULL;
152
+ }
153
+
154
+ static void
155
+ lsm_svg_vector_trait_finalize (LsmTrait *abstract_trait)
156
+ {
157
+ LsmSvgVector *svg_vector = (LsmSvgVector *) abstract_trait;
158
+
159
+ g_free (svg_vector->values);
160
+ svg_vector->n_values = 0;
161
+ svg_vector->values = NULL;
162
+ }
163
+
164
+ const LsmTraitClass lsm_svg_vector_trait_class = {
165
+ .size = sizeof (LsmSvgVector),
166
+ .from_string = lsm_svg_vector_trait_from_string,
167
+ .to_string = lsm_svg_vector_trait_to_string,
168
+ .finalize = lsm_svg_vector_trait_finalize
169
+ };
170
+
106
171
  static gboolean
107
172
  lsm_svg_length_trait_from_string (LsmTrait *abstract_trait, char *string)
108
173
  {
@@ -935,6 +1000,30 @@ const LsmTraitClass lsm_svg_color_trait_class = {
935
1000
  .to_string = lsm_svg_color_trait_to_string
936
1001
  };
937
1002
 
1003
+ static gboolean
1004
+ lsm_svg_color_filter_type_trait_from_string (LsmTrait *abstract_trait, char *string)
1005
+ {
1006
+ LsmSvgColorFilterType *trait = (LsmSvgColorFilterType *) abstract_trait;
1007
+
1008
+ *trait = lsm_svg_color_filter_type_from_string (string);
1009
+
1010
+ return *trait >= 0;
1011
+ }
1012
+
1013
+ static char *
1014
+ lsm_svg_color_filter_type_trait_to_string (LsmTrait *abstract_trait)
1015
+ {
1016
+ LsmSvgColorFilterType *trait = (LsmSvgColorFilterType *) abstract_trait;
1017
+
1018
+ return g_strdup (lsm_svg_color_filter_type_to_string (*trait));
1019
+ }
1020
+
1021
+ const LsmTraitClass lsm_svg_color_filter_type_trait_class = {
1022
+ .size = sizeof (LsmSvgColorFilterType),
1023
+ .from_string = lsm_svg_color_filter_type_trait_from_string,
1024
+ .to_string = lsm_svg_color_filter_type_trait_to_string
1025
+ };
1026
+
938
1027
  static gboolean
939
1028
  lsm_svg_marker_units_trait_from_string (LsmTrait *abstract_trait, char *string)
940
1029
  {
@@ -1182,6 +1271,47 @@ const LsmTraitClass lsm_svg_one_or_two_double_trait_class = {
1182
1271
  .to_string = lsm_svg_one_or_two_double_trait_to_string
1183
1272
  };
1184
1273
 
1274
+ static gboolean
1275
+ lsm_svg_one_or_two_integer_trait_from_string (LsmTrait *abstract_trait, char *string)
1276
+ {
1277
+ LsmSvgOneOrTwoInteger *trait = (LsmSvgOneOrTwoInteger *) abstract_trait;
1278
+ char *end_ptr;
1279
+
1280
+ trait->a = g_ascii_strtoll (string, &end_ptr, 10);
1281
+ if (end_ptr == string) {
1282
+ trait->a = 0;
1283
+ trait->b = 0;
1284
+ return FALSE;
1285
+ }
1286
+
1287
+ string = end_ptr;
1288
+
1289
+ lsm_str_skip_spaces (&string);
1290
+
1291
+ if (string[0] == '\0') {
1292
+ trait->b = trait->a;
1293
+ return TRUE;
1294
+ }
1295
+
1296
+ trait->b = g_ascii_strtoll (string, &end_ptr, 10);
1297
+
1298
+ return TRUE;
1299
+ }
1300
+
1301
+ static char *
1302
+ lsm_svg_one_or_two_integer_trait_to_string (LsmTrait *abstract_trait)
1303
+ {
1304
+ LsmSvgOneOrTwoInteger *trait = (LsmSvgOneOrTwoInteger *) abstract_trait;
1305
+
1306
+ return g_strdup_printf ("%d %d", trait->a, trait->b);
1307
+ }
1308
+
1309
+ const LsmTraitClass lsm_svg_one_or_two_integer_trait_class = {
1310
+ .size = sizeof (double),
1311
+ .from_string = lsm_svg_one_or_two_integer_trait_from_string,
1312
+ .to_string = lsm_svg_one_or_two_integer_trait_to_string
1313
+ };
1314
+
1185
1315
  static gboolean
1186
1316
  lsm_svg_overflow_trait_from_string (LsmTrait *abstract_trait, char *string)
1187
1317
  {
@@ -1230,3 +1360,122 @@ const LsmTraitClass lsm_svg_writing_mode_trait_class = {
1230
1360
  .to_string = lsm_svg_writing_mode_trait_to_string
1231
1361
  };
1232
1362
 
1363
+ static gboolean
1364
+ lsm_svg_morphology_operator_trait_from_string (LsmTrait *abstract_trait, char *string)
1365
+ {
1366
+ LsmSvgMorphologyOperator *trait = (LsmSvgMorphologyOperator *) abstract_trait;
1367
+
1368
+ *trait = lsm_svg_morphology_operator_from_string (string);
1369
+
1370
+ return *trait >= 0;
1371
+ }
1372
+
1373
+ static char *
1374
+ lsm_svg_morphology_operator_trait_to_string (LsmTrait *abstract_trait)
1375
+ {
1376
+ LsmSvgMorphologyOperator *trait = (LsmSvgMorphologyOperator *) abstract_trait;
1377
+
1378
+ return g_strdup (lsm_svg_morphology_operator_to_string (*trait));
1379
+ }
1380
+
1381
+ const LsmTraitClass lsm_svg_morphology_operator_trait_class = {
1382
+ .size = sizeof (LsmSvgMorphologyOperator),
1383
+ .from_string = lsm_svg_morphology_operator_trait_from_string,
1384
+ .to_string = lsm_svg_morphology_operator_trait_to_string
1385
+ };
1386
+
1387
+ static gboolean
1388
+ lsm_svg_edge_mode_trait_from_string (LsmTrait *abstract_trait, char *string)
1389
+ {
1390
+ LsmSvgEdgeMode *trait = (LsmSvgEdgeMode *) abstract_trait;
1391
+
1392
+ *trait = lsm_svg_edge_mode_from_string (string);
1393
+
1394
+ return *trait >= 0;
1395
+ }
1396
+
1397
+ static char *
1398
+ lsm_svg_edge_mode_trait_to_string (LsmTrait *abstract_trait)
1399
+ {
1400
+ LsmSvgEdgeMode *trait = (LsmSvgEdgeMode *) abstract_trait;
1401
+
1402
+ return g_strdup (lsm_svg_edge_mode_to_string (*trait));
1403
+ }
1404
+
1405
+ const LsmTraitClass lsm_svg_edge_mode_trait_class = {
1406
+ .size = sizeof (LsmSvgEdgeMode),
1407
+ .from_string = lsm_svg_edge_mode_trait_from_string,
1408
+ .to_string = lsm_svg_edge_mode_trait_to_string
1409
+ };
1410
+
1411
+ static gboolean
1412
+ lsm_svg_stitch_tiles_trait_from_string (LsmTrait *abstract_trait, char *string)
1413
+ {
1414
+ LsmSvgStitchTiles *trait = (LsmSvgStitchTiles *) abstract_trait;
1415
+
1416
+ *trait = lsm_svg_stitch_tiles_from_string (string);
1417
+
1418
+ return *trait >= 0;
1419
+ }
1420
+
1421
+ static char *
1422
+ lsm_svg_stitch_tiles_trait_to_string (LsmTrait *abstract_trait)
1423
+ {
1424
+ LsmSvgStitchTiles *trait = (LsmSvgStitchTiles *) abstract_trait;
1425
+
1426
+ return g_strdup (lsm_svg_stitch_tiles_to_string (*trait));
1427
+ }
1428
+
1429
+ const LsmTraitClass lsm_svg_stitch_tiles_trait_class = {
1430
+ .size = sizeof (LsmSvgStitchTiles),
1431
+ .from_string = lsm_svg_stitch_tiles_trait_from_string,
1432
+ .to_string = lsm_svg_stitch_tiles_trait_to_string
1433
+ };
1434
+
1435
+ static gboolean
1436
+ lsm_svg_turbulence_type_trait_from_string (LsmTrait *abstract_trait, char *string)
1437
+ {
1438
+ LsmSvgTurbulenceType *trait = (LsmSvgTurbulenceType *) abstract_trait;
1439
+
1440
+ *trait = lsm_svg_turbulence_type_from_string (string);
1441
+
1442
+ return *trait >= 0;
1443
+ }
1444
+
1445
+ static char *
1446
+ lsm_svg_turbulence_type_trait_to_string (LsmTrait *abstract_trait)
1447
+ {
1448
+ LsmSvgTurbulenceType *trait = (LsmSvgTurbulenceType *) abstract_trait;
1449
+
1450
+ return g_strdup (lsm_svg_turbulence_type_to_string (*trait));
1451
+ }
1452
+
1453
+ const LsmTraitClass lsm_svg_turbulence_type_trait_class = {
1454
+ .size = sizeof (LsmSvgTurbulenceType),
1455
+ .from_string = lsm_svg_turbulence_type_trait_from_string,
1456
+ .to_string = lsm_svg_turbulence_type_trait_to_string
1457
+ };
1458
+
1459
+ static gboolean
1460
+ lsm_svg_channel_selector_trait_from_string (LsmTrait *abstract_trait, char *string)
1461
+ {
1462
+ LsmSvgChannelSelector *trait = (LsmSvgChannelSelector *) abstract_trait;
1463
+
1464
+ *trait = lsm_svg_channel_selector_from_string (string);
1465
+
1466
+ return *trait >= 0;
1467
+ }
1468
+
1469
+ static char *
1470
+ lsm_svg_channel_selector_trait_to_string (LsmTrait *abstract_trait)
1471
+ {
1472
+ LsmSvgChannelSelector *trait = (LsmSvgChannelSelector *) abstract_trait;
1473
+
1474
+ return g_strdup (lsm_svg_channel_selector_to_string (*trait));
1475
+ }
1476
+
1477
+ const LsmTraitClass lsm_svg_channel_selector_trait_class = {
1478
+ .size = sizeof (LsmSvgChannelSelector),
1479
+ .from_string = lsm_svg_channel_selector_trait_from_string,
1480
+ .to_string = lsm_svg_channel_selector_trait_to_string
1481
+ };
@@ -30,6 +30,11 @@
30
30
 
31
31
  G_BEGIN_DECLS
32
32
 
33
+ typedef struct {
34
+ unsigned int n_values;
35
+ double *values;
36
+ } LsmSvgVector;
37
+
33
38
  typedef struct {
34
39
  LsmSvgAngleType type;
35
40
  double angle;
@@ -72,30 +77,43 @@ typedef struct {
72
77
  double b;
73
78
  } LsmSvgOneOrTwoDouble;
74
79
 
80
+ typedef struct {
81
+ int a;
82
+ int b;
83
+ } LsmSvgOneOrTwoInteger;
84
+
75
85
  extern const LsmTraitClass lsm_svg_angle_trait_class;
76
86
  extern const LsmTraitClass lsm_svg_blending_mode_trait_class;
77
87
  extern const LsmTraitClass lsm_svg_enable_background_trait_class;
88
+ extern const LsmTraitClass lsm_svg_channel_selector_trait_class;
78
89
  extern const LsmTraitClass lsm_svg_color_trait_class;
90
+ extern const LsmTraitClass lsm_svg_color_filter_type_trait_class;
79
91
  extern const LsmTraitClass lsm_svg_comp_op_trait_class;
80
92
  extern const LsmTraitClass lsm_svg_dash_array_trait_class;
81
93
  extern const LsmTraitClass lsm_svg_display_trait_class;
94
+ extern const LsmTraitClass lsm_svg_edge_mode_trait_class;
82
95
  extern const LsmTraitClass lsm_svg_fill_rule_trait_class;
83
96
  extern const LsmTraitClass lsm_svg_font_stretch_trait_class;
84
97
  extern const LsmTraitClass lsm_svg_font_style_trait_class;
85
98
  extern const LsmTraitClass lsm_svg_font_weight_trait_class;
99
+ extern const LsmTraitClass lsm_svg_one_or_two_integer_trait_class;
86
100
  extern const LsmTraitClass lsm_svg_length_trait_class;
87
101
  extern const LsmTraitClass lsm_svg_length_list_trait_class;
88
102
  extern const LsmTraitClass lsm_svg_line_join_trait_class;
89
103
  extern const LsmTraitClass lsm_svg_line_cap_trait_class;
90
104
  extern const LsmTraitClass lsm_svg_marker_units_trait_class;
91
105
  extern const LsmTraitClass lsm_svg_matrix_trait_class;
106
+ extern const LsmTraitClass lsm_svg_morphology_operator_trait_class;
92
107
  extern const LsmTraitClass lsm_svg_one_or_two_double_trait_class;
93
108
  extern const LsmTraitClass lsm_svg_overflow_trait_class;
94
109
  extern const LsmTraitClass lsm_svg_paint_trait_class;
95
110
  extern const LsmTraitClass lsm_svg_pattern_units_trait_class;
96
111
  extern const LsmTraitClass lsm_svg_preserve_aspect_ratio_trait_class;
97
112
  extern const LsmTraitClass lsm_svg_spread_method_trait_class;
113
+ extern const LsmTraitClass lsm_svg_stitch_tiles_trait_class;
98
114
  extern const LsmTraitClass lsm_svg_text_anchor_trait_class;
115
+ extern const LsmTraitClass lsm_svg_turbulence_type_trait_class;
116
+ extern const LsmTraitClass lsm_svg_vector_trait_class;
99
117
  extern const LsmTraitClass lsm_svg_visibility_trait_class;
100
118
  extern const LsmTraitClass lsm_svg_writing_mode_trait_class;
101
119
 
@@ -47,13 +47,19 @@ typedef struct _LsmSvgEllipseElement LsmSvgEllipseElement;
47
47
  typedef struct _LsmSvgFilterElement LsmSvgFilterElement;
48
48
  typedef struct _LsmSvgFilterPrimitive LsmSvgFilterPrimitive;
49
49
  typedef struct _LsmSvgFilterBlend LsmSvgFilterBlend;
50
+ typedef struct _LsmSvgFilterColorMatrix LsmSvgFilterColorMatrix;
50
51
  typedef struct _LsmSvgFilterComposite LsmSvgFilterComposite;
52
+ typedef struct _LsmSvgFilterConvolveMatrix LsmSvgFilterConvolveMatrix;
53
+ typedef struct _LsmSvgFilterDisplacementMap LsmSvgFilterDisplacementMap;
51
54
  typedef struct _LsmSvgFilterFlood LsmSvgFilterFlood;
52
55
  typedef struct _LsmSvgFilterGaussianBlur LsmSvgFilterGaussianBlur;
56
+ typedef struct _LsmSvgFilterImage LsmSvgFilterImage;
53
57
  typedef struct _LsmSvgFilterMerge LsmSvgFilterMerge;
54
58
  typedef struct _LsmSvgFilterMergeNode LsmSvgFilterMergeNode;
59
+ typedef struct _LsmSvgFilterMorphology LsmSvgFilterMorphology;
55
60
  typedef struct _LsmSvgFilterOffset LsmSvgFilterOffset;
56
61
  typedef struct _LsmSvgFilterSpecularLighting LsmSvgFilterSpecularLighting;
62
+ typedef struct _LsmSvgFilterTurbulence LsmSvgFilterTurbulence;
57
63
  typedef struct _LsmSvgFilterTile LsmSvgFilterTile;
58
64
  typedef struct _LsmSvgLineElement LsmSvgLineElement;
59
65
  typedef struct _LsmSvgPolylineElement LsmSvgPolylineElement;