Branch: Tag:

2001-03-28

2001-03-28 00:29:24 by Per Hedbor <ph@opera.com>

Better aproximation of the layer modes.

Rev: lib/modules/_Image_PSD.pmod:1.15

212:    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;    }   }
281:    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
301:    }    }    } -  werror("%O\n", layers ); + // werror("%O\n", layers );    return layers;   }