Пример #1
0
 public PixColor this[int index]
 {
     get
     {
         int color;
         if (Interop.LeptonicaApi.Native.pixcmapGetColor32(handle, index, out color) == 0)
         {
             return(PixColor.FromRgb((uint)color));
         }
         else
         {
             throw new InvalidOperationException("Failed to retrieve color.");
         }
     }
     set
     {
         if (Interop.LeptonicaApi.Native.pixcmapResetColor(handle, index, value.Red, value.Green, value.Blue) != 0)
         {
             throw new InvalidOperationException("Failed to reset color.");
         }
     }
 }
Пример #2
0
 public bool AddColor(PixColor color)
 {
     return(Interop.LeptonicaApi.Native.pixcmapAddColor(handle, color.Red, color.Green, color.Blue) == 0);
 }
Пример #3
0
 public bool AddNearestColor(PixColor color, out int index)
 {
     return(Interop.LeptonicaApi.Native.pixcmapAddNearestColor(handle, color.Red, color.Green, color.Blue, out index) == 0);
 }