Class: EideticPDF::GraphWriter

Inherits:
BaseWriter show all
Defined in:
lib/epdfsw.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from BaseWriter

#f, #g

Constructor Details

#initialize(stream) ⇒ GraphWriter

Returns a new instance of GraphWriter.



79
80
81
# File 'lib/epdfsw.rb', line 79

def initialize(stream)
  @stream = stream
end

Instance Method Details

#clipObject

use nonzero winding number rule



176
177
178
# File 'lib/epdfsw.rb', line 176

def clip
  @stream << "W\n"
end

#close_pathObject



135
136
137
# File 'lib/epdfsw.rb', line 135

def close_path
  @stream << "h\n"
end

#close_path_and_strokeObject



147
148
149
# File 'lib/epdfsw.rb', line 147

def close_path_and_stroke
  @stream << "s\n"
end

#close_path_eo_fill_and_strokeObject



171
172
173
# File 'lib/epdfsw.rb', line 171

def close_path_eo_fill_and_stroke
  @stream << "b*\n"
end

#close_path_fill_and_strokeObject



163
164
165
# File 'lib/epdfsw.rb', line 163

def close_path_fill_and_stroke
  @stream << "b\n"
end

#concat_matrix(a, b, c, d, x, y) ⇒ Object



91
92
93
# File 'lib/epdfsw.rb', line 91

def concat_matrix(a, b, c, d, x, y)
  @stream << "%s %s %s %s %s %s cm\n" % [g(a), g(b), g(c), g(d), g(x), g(y)]
end

#curve_to(x1, y1, x2, y2, x3, y3) ⇒ Object



127
128
129
# File 'lib/epdfsw.rb', line 127

def curve_to(x1, y1, x2, y2, x3, y3)
  @stream << "%s %s %s %s %s %s c\n" % [g(x1), g(y1), g(x2), g(y2), g(x3), g(y3)]
end

#eo_clipObject

use even-odd rule



181
182
183
# File 'lib/epdfsw.rb', line 181

def eo_clip
  @stream << "W*\n"
end

#eo_fillObject



155
156
157
# File 'lib/epdfsw.rb', line 155

def eo_fill
  @stream << "f*\n"
end

#eo_fill_and_strokeObject



167
168
169
# File 'lib/epdfsw.rb', line 167

def eo_fill_and_stroke
  @stream << "B*\n"
end

#fillObject



151
152
153
# File 'lib/epdfsw.rb', line 151

def fill
  @stream << "f\n"
end

#fill_and_strokeObject



159
160
161
# File 'lib/epdfsw.rb', line 159

def fill_and_stroke
  @stream << "B\n"
end

#line_to(x, y) ⇒ Object



123
124
125
# File 'lib/epdfsw.rb', line 123

def line_to(x, y)
  @stream << "%s %s l\n" % [g(x), g(y)]
end

#make_line_dash_pattern(pattern, phase) ⇒ Object



185
186
187
# File 'lib/epdfsw.rb', line 185

def make_line_dash_pattern(pattern, phase)
  "[%s] %d" % [pattern.join(' '), phase]
end

#move_to(x, y) ⇒ Object



119
120
121
# File 'lib/epdfsw.rb', line 119

def move_to(x, y)
  @stream << "%s %s m\n" % [g(x), g(y)]
end

#new_pathObject



139
140
141
# File 'lib/epdfsw.rb', line 139

def new_path
  @stream << "n\n"
end

#rectangle(x, y, width, height) ⇒ Object



131
132
133
# File 'lib/epdfsw.rb', line 131

def rectangle(x, y, width, height)
  @stream << "%s %s %s %s re\n" % [g(x), g(y), g(width), g(height)]
end

#restore_graphics_stateObject



87
88
89
# File 'lib/epdfsw.rb', line 87

def restore_graphics_state
  @stream << "Q\n"
end

#save_graphics_stateObject



83
84
85
# File 'lib/epdfsw.rb', line 83

def save_graphics_state
  @stream << "q\n"
end

#set_flatness(flatness) ⇒ Object



95
96
97
# File 'lib/epdfsw.rb', line 95

def set_flatness(flatness)
  @stream << "%d i\n" % flatness
end

#set_line_cap_style(line_cap_style) ⇒ Object



99
100
101
# File 'lib/epdfsw.rb', line 99

def set_line_cap_style(line_cap_style)
  @stream << "%d J\n" % line_cap_style
end

#set_line_dash_pattern(line_dash_pattern) ⇒ Object



103
104
105
# File 'lib/epdfsw.rb', line 103

def set_line_dash_pattern(line_dash_pattern)
  @stream << "%s d\n" % line_dash_pattern
end

#set_line_join_style(line_join_style) ⇒ Object



107
108
109
# File 'lib/epdfsw.rb', line 107

def set_line_join_style(line_join_style)
  @stream << "%d j\n" % line_join_style
end

#set_line_width(line_width) ⇒ Object



111
112
113
# File 'lib/epdfsw.rb', line 111

def set_line_width(line_width)
  @stream << "%s w\n" % g(line_width)
end

#set_miter_limit(miter_limit) ⇒ Object



115
116
117
# File 'lib/epdfsw.rb', line 115

def set_miter_limit(miter_limit)
  @stream << "%s M\n" % g(miter_limit)
end

#strokeObject



143
144
145
# File 'lib/epdfsw.rb', line 143

def stroke
  @stream << "S\n"
end