Class: HexaPDF::Content::Operator::SetDeviceCMYKNonStrokingColor

Inherits:
BaseOperator
  • Object
show all
Defined in:
lib/hexapdf/content/operator.rb

Overview

Implementation of the ‘k’ operator.

See: PDF2.0 s8.6.8

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetDeviceCMYKNonStrokingColor

Creates the operator.



520
521
522
# File 'lib/hexapdf/content/operator.rb', line 520

def initialize
  super('k')
end

Instance Method Details

#invoke(processor, c, m, y, k) ⇒ Object

:nodoc:



524
525
526
527
# File 'lib/hexapdf/content/operator.rb', line 524

def invoke(processor, c, m, y, k) #:nodoc:
  processor.graphics_state.fill_color =
    processor.resources.color_space(:DeviceCMYK).prenormalized_color(c, m, y, k)
end

#serialize(serializer, c, m, y, k) ⇒ Object

:nodoc:



529
530
531
532
# File 'lib/hexapdf/content/operator.rb', line 529

def serialize(serializer, c, m, y, k) #:nodoc:
  "#{serializer.serialize_numeric(c)} #{serializer.serialize_numeric(m)} " \
    "#{serializer.serialize_numeric(y)} #{serializer.serialize_numeric(k)} k\n"
end