43: def make_logo
44:
45: bgimage = RS::Graphics::RSImageX.new 'images/bg.jpg'
46: headlist = RS::Graphics::RSImageList.new
47: filter = RS::Graphics::RSFilter.new 'CISourceAtopCompositing', true
48: rectangle = RS::Geometry::RSRectangle.new(
49: 0.0, 0.0, nil,
50: bgimage.width, bgimage.height
51: )
52: 4.times do |i|
53: headlist << RS::Graphics::RSImageX.new("images/k#{i+1}.png")
54: headlist.last.draw_on(
55: rectangle,
56: RS::Geometry::RSPoint.new(
57: (bgimage.width-headlist.last.width)/2.0,
58: (bgimage.height-headlist.last.height)/2.0
59: )
60: )
61: filter.inputImage = headlist.last
62: filter.inputBackgroundImage = bgimage
63: headlist.last.apply_filters! filter
64: end
65:
66: 4.times do |i|
67: headlist.unshift RS::Graphics::RSImageX.new('images/k1.png')
68: headlist.first.draw_on(
69: rectangle,
70: RS::Geometry::RSPoint.new(
71: (bgimage.width-headlist.first.width)/2.0,
72: (i+1)*bgimage.height/4
73: )
74: )
75: filter.inputImage = headlist.first
76: filter.inputBackgroundImage = bgimage
77: headlist.first.apply_filters! filter
78: end
79:
80: scalefilter = RS::Graphics::RSFilter.new 'CILanczosScaleTransform', true
81: headlist.each do |e|
82: scalefilter.inputScale = 0.5
83: scalefilter.inputImage = e
84: e.apply_filters! scalefilter
85: end
86:
87: temp = headlist.reverse
88: temp.delete_at 0
89: temp.delete_at temp.length-1
90: headlist.concat temp
91:
92: converter = RS::Converter::RSConverter.new
93: rmlist = converter.convert(headlist, Magick::ImageList)
94: rmlist.each { |e| e.delay = 10 }
95: rmlist.first.delay = 250
96: rmlist.write 'ani.gif'
97:
98: end