pike.git / lib / modules / _Image_PSD.pmod

version» Context lines:

pike.git/lib/modules/_Image_PSD.pmod:205:    switch( mode )    {    case "norm": return "normal";    case "mul ": return "multiply";    case "add ": return "add";    case "diff": return "difference";    case "sub ": return "subtract";    case "diss": return "dissolve";    case "scrn": return "screen";    case "over": return "overlay"; -  +     case "dark": return "min";    case "lite": return "max"; -  +     case "hue ": return "hue"; -  case "sat ": return "saturation"; -  case "colr": return "color"; -  case "lum ": return "value"; +  case "div ": return "idivide"; +  case "hLit": return "hardlight";    -  +  case "colr": return "color"; // Not 100% like photoshop. +  case "lum ": return "value"; // Not 100% like photoshop. +  case "sat ": return "saturation";// Not 100% like photoshop. +  +  // Colorburn, not really multiply, but the best aproximation soo far. +  case "idiv": +  return "multiply"; +  +  // Exclusion. Not really difference, but very close. +  case "smud": +  return "difference"; +  +  // Soft light. Not really supported yet. For now, use hardlight with lower +  // opacity. Gives a rather good aproximation. +  case "sLit": +  return "hardlight"; +     default:    werror("WARNING: PSD: Unsupported mode: "+mode+". Skipping layer\n"); - // werror("Skipping layer\n"); +     return 0;    }   }      array decode_layers( string|mapping what, mapping|void opts )   {    if(!opts) opts = ([]);       if(!mappingp( what ) )    what = __decode( what );
pike.git/lib/modules/_Image_PSD.pmod:274:    {    if( !(l->flags & LAYER_FLAG_INVISIBLE) || opts->draw_all_layers )    {    if( string m = translate_mode( l->mode ) )    {    lay = Image.Layer( l->image, l->alpha, m );       lay->set_misc_value( "visible", !(l->flags & LAYER_FLAG_INVISIBLE) );    lay->set_misc_value( "name", l->name );    lay->set_misc_value( "image_guides", what->resources->guides ); +  if( l->mode == "sLit" ) +  l->opacity /= 3;       l->image = 0; l->alpha = 0;       if( l->opacity != 255 )    { -  float lo = 1.0 - l->opacity / 255.0; +  float lo = l->opacity / 255.0;    if( lay->alpha() )    lay->set_image( lay->image(), lay->alpha()*lo );    else    lay->set_image( lay->image(), Image.Image( lay->xsize(),    lay->yszize(),    (int)(255*lo),    (int)(255*lo),    (int)(255*lo)));    }    lay->set_offset( l->xoffset, l->yoffset );    layers += ({ lay });    }    }    } -  werror("%O\n", layers ); + // werror("%O\n", layers );    return layers;   }      mapping _decode( string|mapping what, mapping|void opts )   {    mapping data;    if(!opts) opts = ([]);    if(mappingp(what))    data = what;    else