lib/chunky_png/canvas/operations.rb
# Replaces pixels on this image by pixels from another pixels, on a given
# offset. This method will modify the current canvas.
#
# This will completely replace the pixels of the background image. If you
# want to blend them with semi-transparent pixels from the foreground
# image, see {#compose!}.
#
# @param [ChunkyPNG::Canvas] other The foreground canvas to get the
#   pixels from.
# @param [Integer] offset_x The x-offset to apply the new foreground on.
# @param [Integer] offset_y The y-offset to apply the new foreground on.
# @return [ChunkyPNG::Canvas] Returns itself, but with the other canvas
#   placed onto it.
# @raise [ChunkyPNG::OutOfBounds] when the other canvas doesn't fit on
#   this one, given the offset and size of the other canvas.
# @see #compose!
# @see #replace
Replaces pixels on this image by pixels from another pixels, on a given
offset. This method will modify the current canvas.

This will completely replace the pixels of the background image. If you
want to blend them with semi-transparent pixels from the foreground
image, see {#compose!}.
Replaces pixels on this image by pixels from another pixels on a given offset . This method will modify the current canvas . This will completely replace the pixels of the background image . If you want to blend them with semi - transparent pixels from the foreground image see { #compose! } .
def replace!(other, offset_x = 0, offset_y = 0)
        check_size_constraints!(other, offset_x, offset_y)
        for y in 0...other.height do
          for d in 0...other.width
            pixels[(y + offset_y) * width + offset_x + d] = other.pixels[y * other.width + d]
          end
        end
        self
      end
def replace! ( other , offset_x = 0 , offset_y = 0 ) check_size_constraints! ( other , offset_x , offset_y ) for y in 0 ... other . height do for d in 0 ... other . width pixels [ ( y + offset_y ) * width + offset_x + d ] = other . pixels [ y * other . width + d ] end end self end
Replaces pixels on this image by pixels from another pixels, on a given
offset.
Replaces pixels on this image by pixels from another pixels on a given offset .
Returns itself, but with the other canvas placed onto it.
Returns itself but with the other canvas placed onto it .
ChunkyPNG::Canvas
[ChunkyPNG::OutOfBounds] when the other canvas doesn't fit on this one, given the offset and size of the other canvas.
[ ChunkyPNG :: OutOfBounds ] when the other canvas doesn ' t fit on this one given the offset and size of the other canvas .
other
<not_specific>
offset_x
<not_specific>
offset_y
<not_specific>
<not_specific>
offset_y The y-offset to apply the new foreground on.
offset_y The y - offset to apply the new foreground on .
see
None
see
None