public static int CalcLineSize(SmPixelTypes pt, int width) { switch (pt) { case SmPixelTypes.Bgr24: return(3 * width); case SmPixelTypes.Bgr32: return(4 * width); } throw new ArgumentException("Unknown pixeltype."); }
public static int BytesPerPixel(SmPixelTypes pt) { switch (pt) { case SmPixelTypes.Bgr24: return(3); case SmPixelTypes.Bgr32: return(4); } throw new ArgumentException("Unknown pixeltype."); }