Class: Pdfrb::Color::CalGray
- Inherits:
-
CIEBasedColorSpace
- Object
- ColorSpace
- CIEBasedColorSpace
- Pdfrb::Color::CalGray
- Defined in:
- lib/pdfrb/color/color_space.rb
Instance Attribute Summary collapse
-
#black_point ⇒ Object
readonly
Returns the value of attribute black_point.
-
#gamma ⇒ Object
readonly
Returns the value of attribute gamma.
-
#white_point ⇒ Object
readonly
Returns the value of attribute white_point.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(white_point:, black_point: nil, gamma: nil) ⇒ CalGray
constructor
A new instance of CalGray.
- #parameters_array ⇒ Object
Methods inherited from CIEBasedColorSpace
Methods inherited from ColorSpace
[], names, register, register_as, registry
Constructor Details
#initialize(white_point:, black_point: nil, gamma: nil) ⇒ CalGray
Returns a new instance of CalGray.
90 91 92 93 94 |
# File 'lib/pdfrb/color/color_space.rb', line 90 def initialize(white_point:, black_point: nil, gamma: nil) @white_point = white_point @black_point = black_point @gamma = gamma end |
Instance Attribute Details
#black_point ⇒ Object (readonly)
Returns the value of attribute black_point.
88 89 90 |
# File 'lib/pdfrb/color/color_space.rb', line 88 def black_point @black_point end |
#gamma ⇒ Object (readonly)
Returns the value of attribute gamma.
88 89 90 |
# File 'lib/pdfrb/color/color_space.rb', line 88 def gamma @gamma end |
#white_point ⇒ Object (readonly)
Returns the value of attribute white_point.
88 89 90 |
# File 'lib/pdfrb/color/color_space.rb', line 88 def white_point @white_point end |
Class Method Details
.pdf_name ⇒ Object
97 |
# File 'lib/pdfrb/color/color_space.rb', line 97 def pdf_name; :CalGray; end |
Instance Method Details
#parameters_array ⇒ Object
100 101 102 103 104 105 |
# File 'lib/pdfrb/color/color_space.rb', line 100 def parameters_array dict = { WhitePoint: Pdfrb::Model::PdfArray.new(@white_point) } dict[:BlackPoint] = Pdfrb::Model::PdfArray.new(@black_point) if @black_point dict[:Gamma] = @gamma if @gamma dict end |