Skip to content

Commit

Permalink
Merge pull request #109 from JakeAstonReed/master
Browse files Browse the repository at this point in the history
Add support for Gray16 and Gray8
  • Loading branch information
radek-k committed Apr 5, 2022
2 parents cb4973f + 6795890 commit 327955c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion FFMediaToolkit/Graphics/ImageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ private static int GetBitsPerPixel(ImagePixelFormat format)
return 16;
case ImagePixelFormat.Yuv444:
return 24;
case ImagePixelFormat.Gray16:
return 16;
case ImagePixelFormat.Gray8:
return 8;
default:
return 0;
}
}
}
}
}
12 changes: 11 additions & 1 deletion FFMediaToolkit/Graphics/ImagePixelFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,15 @@ public enum ImagePixelFormat
/// Represents a YUV 12bpp 4:2:0 video pixel format.
/// </summary>
Yuv420 = AVPixelFormat.AV_PIX_FMT_YUV420P,

/// <summary>
/// Represents a Gray 16bpp little-endian video pixel format.
/// </summary>
Gray16 = AVPixelFormat.AV_PIX_FMT_GRAY16LE,

/// <summary>
/// Represents a Gray 8bpp video pixel format.
/// </summary>
Gray8 = AVPixelFormat.AV_PIX_FMT_GRAY8,
}
}
}

0 comments on commit 327955c

Please sign in to comment.