public override void ConvertToVersion(ImgVersion version) { foreach (var entity in Album.List) { entity.Load(); if (version <= ImgVersion.Ver2) { if (entity.Type == ColorBits.DXT_1) { entity.Type = ColorBits.ARGB_1555; } if (entity.Type == ColorBits.DXT_5) { entity.Type = ColorBits.ARGB_8888; } } else if (version == ImgVersion.Ver4) { entity.Type = ColorBits.ARGB_1555; } if (entity.CompressMode > CompressMode.ZLIB) { entity.CompressMode = CompressMode.ZLIB; } } }
public override void ConvertToVersion(ImgVersion version) { if (version == ImgVersion.Ver4 || version == ImgVersion.Ver6) { Album.List.ForEach(item => item.Type = ColorBits.ARGB_1555); } }
/// <summary> /// 注册版本处理器 /// </summary> /// <param name="version"></param> /// <param name="type"></param> public static void Regisity(ImgVersion version, Type type) { if (Dic.ContainsKey(version)) { Dic.Remove(version); } Dic.Add(version, type); }
public override void ConvertToVersion(ImgVersion version) { if (version <= ImgVersion.Ver2 || version == ImgVersion.Ver5) { foreach (var item in Album.List) { if (item.Type != ColorBits.LINK) { item.Type = ColorBits.ARGB_8888; } } } }
public override void ConvertToVersion(ImgVersion version) { if (version > ImgVersion.Ver2 && version != ImgVersion.Ver5) { return; } foreach (var item in Album.List) { if (item.Type != ColorBits.LINK) { item.Type = ColorBits.ARGB_8888; } } }
public static Handler CreateHandler(ImgVersion version, Album album) { var type = Dic[version]; return(type.CreateInstance(album) as Handler); }
public virtual void ConvertToVersion(ImgVersion version) { }