Class: Dvi::Opcode::Post

Inherits:
Base
  • Object
show all
Defined in:
lib/dvi/opcode.rb

Overview

Post is a class for post opcode.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

range, set_range

Constructor Details

#initialize(pointer, num, den, mag, l, u, stack_depth, total_pages) ⇒ Post

Returns a new instance of Post.



461
462
463
464
465
466
467
468
469
470
# File 'lib/dvi/opcode.rb', line 461

def initialize(pointer, num, den, mag, l, u, stack_depth, total_pages)
  @final_bop = pointer # final bop pointer
  @num = num           # same as preamble
  @den = den           # same as preamble
  @mag = mag           # same as preamble
  @l = l               # height plus depth of the tallest page
  @u = u               # width of the widest page
  @stack_depth = stack_depth # maximum stack depth
  @total_pages = total_pages # total number of pages
end

Instance Attribute Details

#denObject (readonly)

Returns the value of attribute den.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def den
  @den
end

#final_bopObject (readonly)

Returns the value of attribute final_bop.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def final_bop
  @final_bop
end

#lObject (readonly)

Returns the value of attribute l.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def l
  @l
end

#magObject (readonly)

Returns the value of attribute mag.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def mag
  @mag
end

#numObject (readonly)

Returns the value of attribute num.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def num
  @num
end

#pagesObject (readonly)

Returns the value of attribute pages.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def pages
  @pages
end

#stack_depathObject (readonly)

Returns the value of attribute stack_depath.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def stack_depath
  @stack_depath
end

#uObject (readonly)

Returns the value of attribute u.



459
460
461
# File 'lib/dvi/opcode.rb', line 459

def u
  @u
end

Class Method Details

.read(cmd, io) ⇒ Object



472
473
474
475
476
477
478
479
480
481
482
# File 'lib/dvi/opcode.rb', line 472

def self.read(cmd, io)
  pointer = io.read_uint4
  num = io.read_uint4
  den = io.read_uint4
  mag = io.read_uint4
  l = io.read_uint4
  u = io.read_uint4
  stack_size = io.read_uint2
  pages = io.read_uint2
  return self.new(pointer, num, den, mag, l, u, stack_size, pages)
end

Instance Method Details

#interpret(ps) ⇒ Object



484
485
486
# File 'lib/dvi/opcode.rb', line 484

def interpret(ps)
  ps.total_pages = @total_pages
end