private static float GetIndex(PaintShopSourceChannel channel) { switch (channel) { case PaintShopSourceChannel.Red: return(0f); case PaintShopSourceChannel.Green: return(1f); case PaintShopSourceChannel.Blue: return(2f); case PaintShopSourceChannel.Alpha: return(3f); case PaintShopSourceChannel.Zero: return(-2f); case PaintShopSourceChannel.One: return(-1f); default: throw new ArgumentOutOfRangeException(nameof(channel), channel, null); } }
public PaintShopDestination InheritExtendedPropertiesFrom(PaintShopDestination baseDestination) { RedAdjustment = baseDestination.RedAdjustment; GreenAdjustment = baseDestination.GreenAdjustment; BlueAdjustment = baseDestination.BlueAdjustment; AlphaAdjustment = baseDestination.AlphaAdjustment; RedFrom = baseDestination.RedFrom; GreenFrom = baseDestination.GreenFrom; BlueFrom = baseDestination.BlueFrom; AlphaFrom = baseDestination.AlphaFrom; return(this); }
public PaintShopSource MapChannels([CanBeNull] string postfix) { if (!string.IsNullOrWhiteSpace(postfix)) { postfix = postfix.ToLowerInvariant(); var last = postfix[postfix.Length - 1]; RedFrom = (PaintShopSourceChannel)postfix.ElementAtOr(0, last); GreenFrom = (PaintShopSourceChannel)postfix.ElementAtOr(1, last); BlueFrom = (PaintShopSourceChannel)postfix.ElementAtOr(2, last); AlphaFrom = (PaintShopSourceChannel)postfix.ElementAtOr(3, (char)PaintShopSourceChannel.Alpha); } return(this); }