Class: Shibainus::Image
- Inherits:
-
Pixelart::Image
- Object
- Pixelart::Image
- Shibainus::Image
- Defined in:
- lib/shibainus.rb
Constant Summary collapse
- BEFORE_PATCH =
before callback/patch for hats
->(img, ) { ## hack for doge hats - cut off / clean top (ears) if ['beanie', 'cap', 'capforward', 'cowboyhat', 'fedora', 'bandana', 'tophat', 'knittedcap'].include?( .name ) puts " apply doge headwear (for hats & more) hack before '#{.name}' - wipe-out pixel lines 3,4,5 (top e.g. doge ears)..." ## "wipe-out" pixel lines 3,4,5 (top) [3,4,5].each do |y| img.width.times do |x| img[ x, y ] = 0 # transparent color end end end }
- NAMES =
['doge', 'doges', 'shiba', 'shibas', 'shibainu', 'shibainus']
- DEFAULT_ATTRIBUTES =
['Classic']
Class Method Summary collapse
Class Method Details
.generate(*values) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/shibainus.rb', line 50 def self.generate( *values ) img = Shibainus.generator.generate( *values, before: BEFORE_PATCH ) ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now) new( 24, 24, img.image ) end |