Module: MineSkin::Compositor Private
- Included in:
- Preview::Cape2D, Preview::Skin2D
- Defined in:
- lib/mineskin/compositor.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Composition tools
Instance Method Summary collapse
-
#composite_texture!(tex, x, y, old_unit, op: Magick::SrcOverCompositeOp) ⇒ Object
private
Puts texture to the specified region of @image.
-
#resize(img, old_unit) ⇒ Magick::Image
private
Resizes image.
Instance Method Details
#composite_texture!(tex, x, y, old_unit, op: Magick::SrcOverCompositeOp) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Puts texture to the specified region of @image
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mineskin/compositor.rb', line 23 def composite_texture!(tex, x, y, old_unit, op: Magick::SrcOverCompositeOp) @image.composite!( resize(tex.texture, old_unit), x * @unit, y * @unit, op ) @image.composite!( resize(tex., old_unit), x * @unit, y * @unit, op ) if tex. end |
#resize(img, old_unit) ⇒ Magick::Image
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resizes image
10 11 12 |
# File 'lib/mineskin/compositor.rb', line 10 def resize(img, old_unit) img.sample(@unit.to_f / old_unit.to_f) end |