Class: Belle::Image

Inherits:
Pixelart::Image
  • Object
show all
Defined in:
lib/belles.rb

Constant Summary collapse

BEFORE_PATCH =

before callback/patch for hats

->(img, meta) {
    ## hack for hats & hair - clip head "overflow"
    ##  quick hack for headwear
    ##   cut-off/clean top overflow hair/head
    if meta.name.start_with?( 'beret' ) ||
       meta.name.start_with?( 'snap_back' )
         img[6,4] = 0
         img[7,3] = 0
         puts "  apply beau/belle hat & hair hack before '#{meta.name}' - clip head pixels..."
    elsif meta.name.start_with?( 'beanie' ) ||
          meta.name.start_with?( 'dreads' )
        img[6,4] = 0
        puts "  apply beau/belle hat & hair hack before '#{meta.name}' - clip head pixels..."
    else
        # do nothing; pass through as-is
    end
}
NAMES =
['belle', 'belles',
'bella', 'bellas',
'beau', 'beaus',
'beaux']
DEFAULT_ATTRIBUTES =
['Head 1',
'Shades Large Dark', 'Earring',
'Beanie Yellow', 'Pout 1', 'Turtleneck Rust']

Class Method Summary collapse

Class Method Details

.generate(*names) ⇒ Object



68
69
70
# File 'lib/belles.rb', line 68

def self.generate( *names )
    generator.generate( *names, before: BEFORE_PATCH )
end

.generatorObject



34
35
36
37
# File 'lib/belles.rb', line 34

def self.generator
  @generator ||= Artfactory.use(  Belle::Sheet.builtin,
                                  image_class: Image )
end