Class: Pdfrb::Color::CalRGB
- Inherits:
-
CIEBasedColorSpace
- Object
- ColorSpace
- CIEBasedColorSpace
- Pdfrb::Color::CalRGB
- 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.
-
#matrix ⇒ Object
readonly
Returns the value of attribute matrix.
-
#white_point ⇒ Object
readonly
Returns the value of attribute white_point.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(white_point:, gamma: nil, matrix: nil, black_point: nil) ⇒ CalRGB
constructor
A new instance of CalRGB.
- #parameters_array ⇒ Object
Methods inherited from CIEBasedColorSpace
Methods inherited from ColorSpace
[], names, register, register_as, registry
Constructor Details
#initialize(white_point:, gamma: nil, matrix: nil, black_point: nil) ⇒ CalRGB
Returns a new instance of CalRGB.
112 113 114 115 116 117 |
# File 'lib/pdfrb/color/color_space.rb', line 112 def initialize(white_point:, gamma: nil, matrix: nil, black_point: nil) @white_point = white_point @gamma = gamma @matrix = matrix @black_point = black_point end |
Instance Attribute Details
#black_point ⇒ Object (readonly)
Returns the value of attribute black_point.
110 111 112 |
# File 'lib/pdfrb/color/color_space.rb', line 110 def black_point @black_point end |
#gamma ⇒ Object (readonly)
Returns the value of attribute gamma.
110 111 112 |
# File 'lib/pdfrb/color/color_space.rb', line 110 def gamma @gamma end |
#matrix ⇒ Object (readonly)
Returns the value of attribute matrix.
110 111 112 |
# File 'lib/pdfrb/color/color_space.rb', line 110 def matrix @matrix end |
#white_point ⇒ Object (readonly)
Returns the value of attribute white_point.
110 111 112 |
# File 'lib/pdfrb/color/color_space.rb', line 110 def white_point @white_point end |
Class Method Details
.pdf_name ⇒ Object
120 |
# File 'lib/pdfrb/color/color_space.rb', line 120 def pdf_name; :CalRGB; end |
Instance Method Details
#parameters_array ⇒ Object
123 124 125 126 127 128 129 |
# File 'lib/pdfrb/color/color_space.rb', line 123 def parameters_array dict = { WhitePoint: Pdfrb::Model::PdfArray.new(@white_point) } dict[:Gamma] = Pdfrb::Model::PdfArray.new(@gamma) if @gamma dict[:Matrix] = Pdfrb::Model::PdfArray.new(@matrix) if @matrix dict[:BlackPoint] = Pdfrb::Model::PdfArray.new(@black_point) if @black_point dict end |