emf 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +24 -0
  3. data/README.adoc +136 -0
  4. data/exe/emf +113 -0
  5. data/lib/emf/binary/codec.rb +19 -0
  6. data/lib/emf/binary/types.rb +105 -0
  7. data/lib/emf/binary.rb +10 -0
  8. data/lib/emf/detector.rb +58 -0
  9. data/lib/emf/emf_plus/binary.rb +8 -0
  10. data/lib/emf/emf_plus/parser.rb +13 -0
  11. data/lib/emf/emf_plus/serializer.rb +13 -0
  12. data/lib/emf/emf_plus.rb +9 -0
  13. data/lib/emf/emr/binary/header.rb +41 -0
  14. data/lib/emf/emr/binary/record.rb +17 -0
  15. data/lib/emf/emr/binary/records/abort_path.rb +16 -0
  16. data/lib/emf/emr/binary/records/alpha_blend.rb +17 -0
  17. data/lib/emf/emr/binary/records/angle_arc.rb +19 -0
  18. data/lib/emf/emr/binary/records/arc.rb +19 -0
  19. data/lib/emf/emr/binary/records/arc_to.rb +19 -0
  20. data/lib/emf/emr/binary/records/begin_path.rb +16 -0
  21. data/lib/emf/emr/binary/records/bit_blt.rb +37 -0
  22. data/lib/emf/emr/binary/records/chord.rb +19 -0
  23. data/lib/emf/emr/binary/records/close_figure.rb +16 -0
  24. data/lib/emf/emr/binary/records/color_correct_palette.rb +17 -0
  25. data/lib/emf/emr/binary/records/colormatch_to_target_w.rb +17 -0
  26. data/lib/emf/emr/binary/records/comment.rb +20 -0
  27. data/lib/emf/emr/binary/records/create_brush_indirect.rb +20 -0
  28. data/lib/emf/emr/binary/records/create_colorspace.rb +17 -0
  29. data/lib/emf/emr/binary/records/create_colorspace_w.rb +17 -0
  30. data/lib/emf/emr/binary/records/create_dib_pattern_brush_pt.rb +25 -0
  31. data/lib/emf/emr/binary/records/create_font_indirect_w.rb +18 -0
  32. data/lib/emf/emr/binary/records/create_mono_brush.rb +25 -0
  33. data/lib/emf/emr/binary/records/create_palette.rb +17 -0
  34. data/lib/emf/emr/binary/records/create_pen.rb +20 -0
  35. data/lib/emf/emr/binary/records/delete_colorspace.rb +17 -0
  36. data/lib/emf/emr/binary/records/delete_object.rb +16 -0
  37. data/lib/emf/emr/binary/records/draw_escape.rb +17 -0
  38. data/lib/emf/emr/binary/records/ellipse.rb +18 -0
  39. data/lib/emf/emr/binary/records/end_path.rb +16 -0
  40. data/lib/emf/emr/binary/records/eof.rb +21 -0
  41. data/lib/emf/emr/binary/records/exclude_clip_rect.rb +16 -0
  42. data/lib/emf/emr/binary/records/ext_create_pen.rb +17 -0
  43. data/lib/emf/emr/binary/records/ext_escape.rb +17 -0
  44. data/lib/emf/emr/binary/records/ext_flood_fill.rb +17 -0
  45. data/lib/emf/emr/binary/records/ext_select_clip_rgn.rb +19 -0
  46. data/lib/emf/emr/binary/records/ext_text_out_a.rb +27 -0
  47. data/lib/emf/emr/binary/records/ext_text_out_w.rb +41 -0
  48. data/lib/emf/emr/binary/records/fill_path.rb +16 -0
  49. data/lib/emf/emr/binary/records/fill_rgn.rb +17 -0
  50. data/lib/emf/emr/binary/records/flatten_path.rb +16 -0
  51. data/lib/emf/emr/binary/records/force_ufi_mapping.rb +17 -0
  52. data/lib/emf/emr/binary/records/frame_rgn.rb +17 -0
  53. data/lib/emf/emr/binary/records/gls_bounded_record.rb +17 -0
  54. data/lib/emf/emr/binary/records/gls_record.rb +17 -0
  55. data/lib/emf/emr/binary/records/gradient_fill.rb +19 -0
  56. data/lib/emf/emr/binary/records/intersect_clip_rect.rb +16 -0
  57. data/lib/emf/emr/binary/records/invert_rgn.rb +17 -0
  58. data/lib/emf/emr/binary/records/line_to.rb +16 -0
  59. data/lib/emf/emr/binary/records/mask_blt.rb +17 -0
  60. data/lib/emf/emr/binary/records/modify_world_transform.rb +17 -0
  61. data/lib/emf/emr/binary/records/move_to_ex.rb +16 -0
  62. data/lib/emf/emr/binary/records/named_escape.rb +17 -0
  63. data/lib/emf/emr/binary/records/offset_clip_rgn.rb +16 -0
  64. data/lib/emf/emr/binary/records/paint_rgn.rb +17 -0
  65. data/lib/emf/emr/binary/records/pie.rb +19 -0
  66. data/lib/emf/emr/binary/records/pixel_format.rb +17 -0
  67. data/lib/emf/emr/binary/records/plg_blt.rb +17 -0
  68. data/lib/emf/emr/binary/records/poly_bezier.rb +17 -0
  69. data/lib/emf/emr/binary/records/poly_bezier16.rb +17 -0
  70. data/lib/emf/emr/binary/records/poly_bezier_to.rb +17 -0
  71. data/lib/emf/emr/binary/records/poly_bezier_to16.rb +17 -0
  72. data/lib/emf/emr/binary/records/poly_draw.rb +18 -0
  73. data/lib/emf/emr/binary/records/poly_draw16.rb +18 -0
  74. data/lib/emf/emr/binary/records/poly_polygon.rb +19 -0
  75. data/lib/emf/emr/binary/records/poly_polygon16.rb +19 -0
  76. data/lib/emf/emr/binary/records/poly_polyline.rb +19 -0
  77. data/lib/emf/emr/binary/records/poly_polyline16.rb +19 -0
  78. data/lib/emf/emr/binary/records/poly_textout_a.rb +17 -0
  79. data/lib/emf/emr/binary/records/poly_textout_w.rb +17 -0
  80. data/lib/emf/emr/binary/records/polygon.rb +17 -0
  81. data/lib/emf/emr/binary/records/polygon16.rb +17 -0
  82. data/lib/emf/emr/binary/records/polyline.rb +17 -0
  83. data/lib/emf/emr/binary/records/polyline16.rb +17 -0
  84. data/lib/emf/emr/binary/records/polyline_to.rb +17 -0
  85. data/lib/emf/emr/binary/records/polyline_to16.rb +17 -0
  86. data/lib/emf/emr/binary/records/raw.rb +19 -0
  87. data/lib/emf/emr/binary/records/realize_palette.rb +15 -0
  88. data/lib/emf/emr/binary/records/rectangle.rb +18 -0
  89. data/lib/emf/emr/binary/records/resize_palette.rb +17 -0
  90. data/lib/emf/emr/binary/records/restore_dc.rb +17 -0
  91. data/lib/emf/emr/binary/records/round_rect.rb +19 -0
  92. data/lib/emf/emr/binary/records/save_dc.rb +16 -0
  93. data/lib/emf/emr/binary/records/scale_viewport_ext_ex.rb +19 -0
  94. data/lib/emf/emr/binary/records/scale_window_ext_ex.rb +19 -0
  95. data/lib/emf/emr/binary/records/select_clip_path.rb +20 -0
  96. data/lib/emf/emr/binary/records/select_object.rb +16 -0
  97. data/lib/emf/emr/binary/records/select_palette.rb +16 -0
  98. data/lib/emf/emr/binary/records/set_arc_direction.rb +16 -0
  99. data/lib/emf/emr/binary/records/set_bk_color.rb +16 -0
  100. data/lib/emf/emr/binary/records/set_bk_mode.rb +16 -0
  101. data/lib/emf/emr/binary/records/set_brush_org_ex.rb +16 -0
  102. data/lib/emf/emr/binary/records/set_colorspace.rb +17 -0
  103. data/lib/emf/emr/binary/records/set_dibits_to_device.rb +17 -0
  104. data/lib/emf/emr/binary/records/set_icm_mode.rb +16 -0
  105. data/lib/emf/emr/binary/records/set_icm_profile_a.rb +17 -0
  106. data/lib/emf/emr/binary/records/set_icm_profile_w.rb +17 -0
  107. data/lib/emf/emr/binary/records/set_layout.rb +16 -0
  108. data/lib/emf/emr/binary/records/set_linked_ufis.rb +17 -0
  109. data/lib/emf/emr/binary/records/set_map_mode.rb +16 -0
  110. data/lib/emf/emr/binary/records/set_mapper_flags.rb +16 -0
  111. data/lib/emf/emr/binary/records/set_metargn.rb +16 -0
  112. data/lib/emf/emr/binary/records/set_miter_limit.rb +16 -0
  113. data/lib/emf/emr/binary/records/set_palette_entries.rb +17 -0
  114. data/lib/emf/emr/binary/records/set_pixel_v.rb +18 -0
  115. data/lib/emf/emr/binary/records/set_poly_fill_mode.rb +16 -0
  116. data/lib/emf/emr/binary/records/set_rop2.rb +16 -0
  117. data/lib/emf/emr/binary/records/set_stretch_blt_mode.rb +16 -0
  118. data/lib/emf/emr/binary/records/set_text_align.rb +16 -0
  119. data/lib/emf/emr/binary/records/set_text_color.rb +17 -0
  120. data/lib/emf/emr/binary/records/set_text_justification.rb +17 -0
  121. data/lib/emf/emr/binary/records/set_viewport_ext_ex.rb +16 -0
  122. data/lib/emf/emr/binary/records/set_viewport_org_ex.rb +16 -0
  123. data/lib/emf/emr/binary/records/set_window_ext_ex.rb +16 -0
  124. data/lib/emf/emr/binary/records/set_window_org_ex.rb +16 -0
  125. data/lib/emf/emr/binary/records/set_world_transform.rb +16 -0
  126. data/lib/emf/emr/binary/records/small_text_out.rb +28 -0
  127. data/lib/emf/emr/binary/records/stretch_blt.rb +39 -0
  128. data/lib/emf/emr/binary/records/stretch_dibits.rb +42 -0
  129. data/lib/emf/emr/binary/records/stroke_and_fill_path.rb +16 -0
  130. data/lib/emf/emr/binary/records/stroke_path.rb +16 -0
  131. data/lib/emf/emr/binary/records/transparent_blt.rb +17 -0
  132. data/lib/emf/emr/binary/records/widen_path.rb +16 -0
  133. data/lib/emf/emr/binary/records.rb +258 -0
  134. data/lib/emf/emr/binary/type_codes.rb +132 -0
  135. data/lib/emf/emr/binary/with_bounds.rb +15 -0
  136. data/lib/emf/emr/binary.rb +13 -0
  137. data/lib/emf/emr/parser.rb +185 -0
  138. data/lib/emf/emr/path_association.rb +16 -0
  139. data/lib/emf/emr/serializer.rb +24 -0
  140. data/lib/emf/emr.rb +10 -0
  141. data/lib/emf/error.rb +19 -0
  142. data/lib/emf/model/emr/header.rb +93 -0
  143. data/lib/emf/model/emr/records.rb +48 -0
  144. data/lib/emf/model/emr.rb +10 -0
  145. data/lib/emf/model/geometry/color.rb +67 -0
  146. data/lib/emf/model/geometry/matrix.rb +52 -0
  147. data/lib/emf/model/geometry/point.rb +41 -0
  148. data/lib/emf/model/geometry/point_f.rb +33 -0
  149. data/lib/emf/model/geometry/point_s.rb +33 -0
  150. data/lib/emf/model/geometry/rect.rb +57 -0
  151. data/lib/emf/model/geometry/rect_s.rb +49 -0
  152. data/lib/emf/model/geometry/size.rb +33 -0
  153. data/lib/emf/model/geometry.rb +16 -0
  154. data/lib/emf/model/metafile.rb +34 -0
  155. data/lib/emf/model/record.rb +19 -0
  156. data/lib/emf/model/visitor.rb +42 -0
  157. data/lib/emf/model.rb +11 -0
  158. data/lib/emf/version.rb +5 -0
  159. data/lib/emf/visitors/dump.rb +57 -0
  160. data/lib/emf/visitors/stats.rb +63 -0
  161. data/lib/emf/visitors.rb +8 -0
  162. data/lib/emf/wmf/binary.rb +9 -0
  163. data/lib/emf/wmf/parser.rb +13 -0
  164. data/lib/emf/wmf/serializer.rb +13 -0
  165. data/lib/emf/wmf.rb +9 -0
  166. data/lib/emf.rb +56 -0
  167. metadata +226 -0
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class FrameRgn < Emf::Emr::Binary::Record
11
+ uint32 :ih_brush
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: preserves full body bytes. Full layout lands with TODO 10.
11
+ class GlsBoundedRecord < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: preserves full body bytes. Full layout lands with TODO 10.
11
+ class GlsRecord < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class GradientFill < Emf::Emr::Binary::WithBounds
11
+ uint32 :n_ver
12
+ uint32 :n_tri
13
+ uint32 :ul_mode
14
+ rest :body
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class IntersectClipRect < Emf::Emr::Binary::Record
11
+ rectl :rcl_clip
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class InvertRgn < Emf::Emr::Binary::Record
11
+ uint32 :ih_brush
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class LineTo < Emf::Emr::Binary::Record
11
+ point_l :origin
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: leading fields per MS-EMF, body captures remaining bytes.
11
+ class MaskBlt < Emf::Emr::Binary::WithBounds
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class ModifyWorldTransform < Emf::Emr::Binary::Record
11
+ x_form :xform
12
+ uint32 :modify_mode
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class MoveToEx < Emf::Emr::Binary::Record
11
+ point_l :origin
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: preserves full body bytes. Full layout lands with TODO 10.
11
+ class NamedEscape < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class OffsetClipRgn < Emf::Emr::Binary::Record
11
+ point_l :ptl_offset
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PaintRgn < Emf::Emr::Binary::Record
11
+ uint32 :ih_brush
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # EMR_PIE: emr + rclBox + ptlStart + ptlEnd (no rclBounds).
11
+ class Pie < Emf::Emr::Binary::Record
12
+ rectl :rcl_box
13
+ point_l :ptl_start
14
+ point_l :ptl_end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # EMR_PIXELFORMAT: header + body. Stub preserves bytes verbatim.
11
+ class PixelFormat < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: leading fields per MS-EMF, body captures remaining bytes.
11
+ class PlgBlt < Emf::Emr::Binary::WithBounds
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyBezier < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyBezier16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyBezierTo < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyBezierTo16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyDraw < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ array :ab_types, type: :uint8, initial_length: :cptl
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyDraw16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ array :ab_types, type: :uint8, initial_length: :cpts
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyPolygon < Emf::Emr::Binary::WithBounds
11
+ uint32 :n_polys
12
+ uint32 :c_ptl_total
13
+ array :a_poly_counts, type: :uint32le, initial_length: :n_polys
14
+ array :aptl, type: :point_l, initial_length: :c_ptl_total
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyPolygon16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :n_polys
12
+ uint32 :c_pts_total
13
+ array :a_poly_counts, type: :uint32le, initial_length: :n_polys
14
+ array :apts, type: :point_s, initial_length: :c_pts_total
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyPolyline < Emf::Emr::Binary::WithBounds
11
+ uint32 :n_polys
12
+ uint32 :c_ptl_total
13
+ array :a_poly_counts, type: :uint32le, initial_length: :n_polys
14
+ array :aptl, type: :point_l, initial_length: :c_ptl_total
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolyPolyline16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :n_polys
12
+ uint32 :c_pts_total
13
+ array :a_poly_counts, type: :uint32le, initial_length: :n_polys
14
+ array :apts, type: :point_s, initial_length: :c_pts_total
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: preserves full body bytes. Full layout lands with TODO 10.
11
+ class PolyTextOutA < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ # Stub: preserves full body bytes. Full layout lands with TODO 10.
11
+ class PolyTextOutW < Emf::Emr::Binary::Record
12
+ rest :body
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class Polygon < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class Polygon16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class Polyline < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class Polyline16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolylineTo < Emf::Emr::Binary::WithBounds
11
+ uint32 :cptl
12
+ array :aptl, type: :point_l, initial_length: :cptl
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/with_bounds"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class PolylineTo16 < Emf::Emr::Binary::WithBounds
11
+ uint32 :cpts
12
+ array :apts, type: :point_s, initial_length: :cpts
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+
5
+ module Emf
6
+ module Emr
7
+ module Binary
8
+ module Records
9
+ # Preserves unknown record bytes verbatim for round-trip safety.
10
+ class Raw < BinData::Record
11
+ endian :little
12
+ uint32 :i_type
13
+ uint32 :n_size
14
+ rest :payload
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bindata"
4
+ require "emf/emr/binary/record"
5
+
6
+ module Emf
7
+ module Emr
8
+ module Binary
9
+ module Records
10
+ class RealizePalette < Emf::Emr::Binary::Record
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end