Class: Pdfrb::Model::Type::HalftoneType5

Inherits:
Halftone show all
Defined in:
lib/pdfrb/model/type/halftone_type5.rb

Overview

Type 5 halftone: a dictionary mapping colorant name → HalftoneType1.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Halftone

#halftone_name, #halftone_type, #type10?, #type16?, #type1?, #type5?, #type6?

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#colorant_countObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/pdfrb/model/type/halftone_type5.rb', line 11

def colorant_count
  return 0 unless halftones

  obj = if halftones.is_a?(Pdfrb::Model::Reference) && document
          document.object(halftones)
        else
          halftones
        end
  obj.is_a?(Pdfrb::Model::Cos::Dictionary) ? obj.value.size : obj&.size || 0
end

#defaultObject



9
# File 'lib/pdfrb/model/type/halftone_type5.rb', line 9

def default; self[:Default]; end

#halftonesObject



8
# File 'lib/pdfrb/model/type/halftone_type5.rb', line 8

def halftones; self[:Halftones]; end