lib/ruby_on_rays/perspective_camera.rb
# Yields image samples with their corresponding rays.
# @yield [<Point2, Ray3>]
# @return [Enumerator<:each_with_ray>] if no block given.
# @return [self] f a block is given.
Yields image samples with their corresponding rays.
Yields image samples with their corresponding rays .
def each_sample_with_ray
      unless block_given?
        return enum_for(:each_sample_with_ray) { @width * @height }
      end
      (0...@height).each do |y|
        (0...@width).each do |x|
          p_film = Point2.new(x, y)
          yield p_film, ray_for_point(p_film)
        end
      end
      self
    end
def each_sample_with_ray unless block_given? return enum_for ( :each_sample_with_ray ) { @width * @height } end ( 0 ... @height ) . each do | y | ( 0 ... @width ) . each do | x | p_film = Point2 . new ( x , y ) yield p_film , ray_for_point ( p_film ) end end self end
Yields image samples with their corresponding rays.
Yields image samples with their corresponding rays .
if no block given.
if no block given .
Enumerator<:each_with_ray>
f a block is given.
f a block is given .
self
]
<not_specific>
None