コード例 #1
0
 public static PixelData GetPixelData(BGRA* pixel, Types model)
 {
     Color clr = Color.FromArgb(pixel->red, pixel->green, pixel->blue);
     PixelData pd = new PixelData(0, 0, 0, clr.Name);
     switch (model)
     {
         case Types.RGB:
             pd.Ch1 = pixel->red;
             pd.Ch2 = pixel->green;
             pd.Ch3 = pixel->blue;
             break;
         case Types.HSV:
             pd = RGBToHSV(pixel);
             break;
         default:
             throw new Exception("Conversion not implemented");
     }
     pd.Name = clr.Name;
     return pd;
 }
コード例 #2
0
 public static PixelData RGBToHSV(BGRA* pixel)
 {
     return RGBToHSV(pixel->red, pixel->green, pixel->blue);
 }
コード例 #3
0
 private static float Min(BGRA* pixel)
 {
     return Min((float)pixel->red, (float)pixel->green, (float)pixel->blue);
 }