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

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

Overview

Implementation of the ‘k’ operator.

See: PDF1.7 s8.6.8

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetDeviceCMYKNonStrokingColor

Creates the operator.



522
523
524
# File 'lib/hexapdf/content/operator.rb', line 522

def initialize
  super('k')
end

Instance Method Details

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

:nodoc:



526
527
528
529
# File 'lib/hexapdf/content/operator.rb', line 526

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:



531
532
533
534
# File 'lib/hexapdf/content/operator.rb', line 531

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