Method: Vissen::Output::PixelBuffer#initialize

Defined in:
lib/vissen/output/pixel_buffer.rb

#initialize(context, filters = []) ⇒ PixelBuffer

Returns a new instance of PixelBuffer.

Parameters:

  • context (Context)

    the context in which the pixel buffer exists.

  • filters (Array<Filter>) (defaults to: [])

    the output filters to apply when finalizing the buffer.

Raises:

  • (ContextError)

    if any of the filters does not share the same context.



20
21
22
23
24
25
26
27
28
# File 'lib/vissen/output/pixel_buffer.rb', line 20

def initialize(context, filters = [])
  super context, Pixel
  # Verify that all filters share the same context
  # before adding them.
  filters.each { |f| raise ContextError unless share_context? f }
  @filters = filters

  freeze
end