Module Avutil.Pixel_format

Formats for pixels.

type t = [
  1. | `None
  2. | `Yuv420p
  3. | `Yuyv422
  4. | `Rgb24
  5. | `Bgr24
  6. | `Yuv422p
  7. | `Yuv444p
  8. | `Yuv410p
  9. | `Yuv411p
  10. | `Gray8
  11. | `Monowhite
  12. | `Monoblack
  13. | `Pal8
  14. | `Yuvj420p
  15. | `Yuvj422p
  16. | `Yuvj444p
  17. | `Uyvy422
  18. | `Uyyvyy411
  19. | `Bgr8
  20. | `Bgr4
  21. | `Bgr4_byte
  22. | `Rgb8
  23. | `Rgb4
  24. | `Rgb4_byte
  25. | `Nv12
  26. | `Nv21
  27. | `Argb
  28. | `Rgba
  29. | `Abgr
  30. | `Bgra
  31. | `Gray16be
  32. | `Gray16le
  33. | `Yuv440p
  34. | `Yuvj440p
  35. | `Yuva420p
  36. | `Rgb48be
  37. | `Rgb48le
  38. | `Rgb565be
  39. | `Rgb565le
  40. | `Rgb555be
  41. | `Rgb555le
  42. | `Bgr565be
  43. | `Bgr565le
  44. | `Bgr555be
  45. | `Bgr555le
  46. | `Vaapi_moco
  47. | `Vaapi_idct
  48. | `Vaapi_vld
  49. | `Vaapi
  50. | `Yuv420p16le
  51. | `Yuv420p16be
  52. | `Yuv422p16le
  53. | `Yuv422p16be
  54. | `Yuv444p16le
  55. | `Yuv444p16be
  56. | `Dxva2_vld
  57. | `Rgb444le
  58. | `Rgb444be
  59. | `Bgr444le
  60. | `Bgr444be
  61. | `Ya8
  62. | `Y400a
  63. | `Gray8a
  64. | `Bgr48be
  65. | `Bgr48le
  66. | `Yuv420p9be
  67. | `Yuv420p9le
  68. | `Yuv420p10be
  69. | `Yuv420p10le
  70. | `Yuv422p10be
  71. | `Yuv422p10le
  72. | `Yuv444p9be
  73. | `Yuv444p9le
  74. | `Yuv444p10be
  75. | `Yuv444p10le
  76. | `Yuv422p9be
  77. | `Yuv422p9le
  78. | `Gbrp
  79. | `Gbr24p
  80. | `Gbrp9be
  81. | `Gbrp9le
  82. | `Gbrp10be
  83. | `Gbrp10le
  84. | `Gbrp16be
  85. | `Gbrp16le
  86. | `Yuva422p
  87. | `Yuva444p
  88. | `Yuva420p9be
  89. | `Yuva420p9le
  90. | `Yuva422p9be
  91. | `Yuva422p9le
  92. | `Yuva444p9be
  93. | `Yuva444p9le
  94. | `Yuva420p10be
  95. | `Yuva420p10le
  96. | `Yuva422p10be
  97. | `Yuva422p10le
  98. | `Yuva444p10be
  99. | `Yuva444p10le
  100. | `Yuva420p16be
  101. | `Yuva420p16le
  102. | `Yuva422p16be
  103. | `Yuva422p16le
  104. | `Yuva444p16be
  105. | `Yuva444p16le
  106. | `Vdpau
  107. | `Xyz12le
  108. | `Xyz12be
  109. | `Nv16
  110. | `Nv20le
  111. | `Nv20be
  112. | `Rgba64be
  113. | `Rgba64le
  114. | `Bgra64be
  115. | `Bgra64le
  116. | `Yvyu422
  117. | `Ya16be
  118. | `Ya16le
  119. | `Gbrap
  120. | `Gbrap16be
  121. | `Gbrap16le
  122. | `Qsv
  123. | `Mmal
  124. | `D3d11va_vld
  125. | `Cuda
  126. | `_0rgb
  127. | `Rgb0
  128. | `_0bgr
  129. | `Bgr0
  130. | `Yuv420p12be
  131. | `Yuv420p12le
  132. | `Yuv420p14be
  133. | `Yuv420p14le
  134. | `Yuv422p12be
  135. | `Yuv422p12le
  136. | `Yuv422p14be
  137. | `Yuv422p14le
  138. | `Yuv444p12be
  139. | `Yuv444p12le
  140. | `Yuv444p14be
  141. | `Yuv444p14le
  142. | `Gbrp12be
  143. | `Gbrp12le
  144. | `Gbrp14be
  145. | `Gbrp14le
  146. | `Yuvj411p
  147. | `Bayer_bggr8
  148. | `Bayer_rggb8
  149. | `Bayer_gbrg8
  150. | `Bayer_grbg8
  151. | `Bayer_bggr16le
  152. | `Bayer_bggr16be
  153. | `Bayer_rggb16le
  154. | `Bayer_rggb16be
  155. | `Bayer_gbrg16le
  156. | `Bayer_gbrg16be
  157. | `Bayer_grbg16le
  158. | `Bayer_grbg16be
  159. | `Xvmc
  160. | `Yuv440p10le
  161. | `Yuv440p10be
  162. | `Yuv440p12le
  163. | `Yuv440p12be
  164. | `Ayuv64le
  165. | `Ayuv64be
  166. | `Videotoolbox
  167. | `P010le
  168. | `P010be
  169. | `Gbrap12be
  170. | `Gbrap12le
  171. | `Gbrap10be
  172. | `Gbrap10le
  173. | `Mediacodec
  174. | `Gray12be
  175. | `Gray12le
  176. | `Gray10be
  177. | `Gray10le
  178. | `P016le
  179. | `P016be
  180. | `D3d11
  181. | `Gray9be
  182. | `Gray9le
  183. | `Gbrpf32be
  184. | `Gbrpf32le
  185. | `Gbrapf32be
  186. | `Gbrapf32le
  187. | `Drm_prime
  188. | `Opencl
  189. | `Gray14be
  190. | `Gray14le
  191. | `Grayf32be
  192. | `Grayf32le
  193. | `Yuva422p12be
  194. | `Yuva422p12le
  195. | `Yuva444p12be
  196. | `Yuva444p12le
  197. | `Nv24
  198. | `Nv42
  199. | `Vulkan
  200. | `Y210be
  201. | `Y210le
  202. | `X2rgb10le
  203. | `X2rgb10be
]

Pixels formats.

type flag = [
  1. | `Be
  2. | `Pal
  3. | `Bitstream
  4. | `Hwaccel
  5. | `Planar
  6. | `Rgb
  7. | `Pseudopal
  8. | `Alpha
  9. | `Bayer
  10. | `Float
]

Pixel format flags.

type component_descriptor = {
  1. plane : int;
  2. step : int;
  3. offset : int;
  4. shift : int;
  5. depth : int;
}

Pixel format component descriptor

type descriptor = private {
  1. name : string;
  2. nb_components : int;
  3. log2_chroma_w : int;
  4. log2_chroma_h : int;
  5. flags : flag list;
  6. comp : component_descriptor list;
  7. alias : string option;
}

Pixel format descriptor.

val descriptor : t -> descriptor

Return the pixel's format descriptor. Raises Not_found if descriptor could not be found.

val bits : descriptor -> int

Return the number of bits of the pixel format.

val planes : t -> int

Return the number of planes of the pixel format.

val to_string : t -> string option

Pixel_format.to_string f Return a string representation of the pixel format f if it exists

val of_string : string -> t

Pixel_format.of_string s Convert the string s into a Pixel_format.t. Raises Error if s is not a valid format.

val get_id : t -> int

Return the internal ID of the pixel format.

val find_id : int -> t

Find a sample pixel from its ID. Raises Not_found when none exist.