def render_showcase(range, sheet, showcase)
      out_width = range.size * ((@width - 2 * sheet.trim) * showcase.scale * showcase.offset) + 2 * sheet.margin
      out_height = showcase.reflect_offset + (1.0 + showcase.reflect_percent) * (@height - 2 * sheet.trim) + 2 * sheet.margin
      out_cc = Cairo::Context.new(Cairo::ImageSurface.new(out_width, out_height))
      wrapper = Squib::Graphics::CairoContextWrapper.new(out_cc)
      wrapper.set_source_squibcolor(sheet.fill_color)
      wrapper.paint

      cards = range.collect { |i| @cards[i] }
      cards.each_with_index do |card, i|
        trimmed = trim_rounded(card.cairo_surface, sheet.trim, sheet.trim_radius)
        reflected = reflect(trimmed, showcase.reflect_offset, showcase.reflect_percent, showcase.reflect_strength)
        perspectived = perspective(reflected, showcase.scale, showcase.face_right?)
        out_cc.set_source(perspectived, sheet.margin + i * perspectived.width * showcase.offset, sheet.margin)
        out_cc.paint
      end
      out_cc.target.write_to_png("#{sheet.dir}/#{sheet.file}")
    end
def render_showcase(range, sheet, showcase)
      out_width = range.size * ((@width - 2 * sheet.trim) * showcase.scale * showcase.offset) + 2 * sheet.margin
      out_height = showcase.reflect_offset + (1.0 + showcase.reflect_percent) * (@height - 2 * sheet.trim) + 2 * sheet.margin
      out_cc = Cairo::Context.new(Cairo::ImageSurface.new(out_width, out_height))
      wrapper = Squib::Graphics::CairoContextWrapper.new(out_cc)
      wrapper.set_source_squibcolor(sheet.fill_color)
      wrapper.paint

      cards = range.collect { |i| @cards[i] }
      cards.each_with_index do |card, i|
        trimmed = trim_rounded(card.cairo_surface, sheet.trim, sheet.trim_radius)
        reflected = reflect(trimmed, showcase.reflect_offset, showcase.reflect_percent, showcase.reflect_strength)
        perspectived = perspective(reflected, showcase.scale, showcase.face_right?)
        out_cc.set_source(perspectived, sheet.margin + i * perspectived.width * showcase.offset, sheet.margin)
        out_cc.paint
      end
      out_cc.target.write_to_png("#{sheet.dir}/#{sheet.file}")
    end
So the Cairo people have said over and over again that they won't support the 3x3 matrices that would handle perspective transforms.
 Since our perspective transform needs are a bit simpler, we can use a "striping method" that does the job for us.
 It's a little bit involved, but it works well enough for limited ranges of our parameters.
 These were also helpful:
  http://kapo-cpp.blogspot.com/2008/01/perspective-effect-using-cairo.html
  http://zetcode.com/gui/pygtk/drawingII/
 :nodoc:
 @api private