Class: PDF::Inspector::Graphics::Color

Inherits:
PDF::Inspector show all
Defined in:
lib/pdf/inspector/graphics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PDF::Inspector

analyze, analyze_file, parse

Constructor Details

#initializeColor

Returns a new instance of Color.



62
63
64
65
66
# File 'lib/pdf/inspector/graphics.rb', line 62

def initialize
  @stroke_color_count = 0
  @fill_color_count   = 0
  @stroke_color_space_count   = {:DeviceCMYK => 0, :DeviceRGB => 0}
end

Instance Attribute Details

#color_spaceObject (readonly)

Returns the value of attribute color_space.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def color_space
  @color_space
end

#fill_colorObject (readonly)

Returns the value of attribute fill_color.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def fill_color
  @fill_color
end

#fill_color_countObject (readonly)

Returns the value of attribute fill_color_count.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def fill_color_count
  @fill_color_count
end

#stroke_colorObject (readonly)

Returns the value of attribute stroke_color.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def stroke_color
  @stroke_color
end

#stroke_color_countObject (readonly)

Returns the value of attribute stroke_color_count.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def stroke_color_count
  @stroke_color_count
end

#stroke_color_space_countObject (readonly)

Returns the value of attribute stroke_color_space_count.



59
60
61
# File 'lib/pdf/inspector/graphics.rb', line 59

def stroke_color_space_count
  @stroke_color_space_count
end

Instance Method Details

#set_color_for_nonstroking_and_special(*params) ⇒ Object



73
74
75
76
# File 'lib/pdf/inspector/graphics.rb', line 73

def set_color_for_nonstroking_and_special(*params)
  @fill_color_count += 1
  @fill_color = params
end

#set_color_for_stroking_and_special(*params) ⇒ Object



68
69
70
71
# File 'lib/pdf/inspector/graphics.rb', line 68

def set_color_for_stroking_and_special(*params)
  @stroke_color_count += 1
  @stroke_color = params
end

#set_stroke_color_space(*params) ⇒ Object



78
79
80
81
# File 'lib/pdf/inspector/graphics.rb', line 78

def set_stroke_color_space(*params)
  @stroke_color_space_count[params[0]] += 1
  @color_space = params[0]
end