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
  47. | `Yuv420p16le
  48. | `Yuv420p16be
  49. | `Yuv422p16le
  50. | `Yuv422p16be
  51. | `Yuv444p16le
  52. | `Yuv444p16be
  53. | `Dxva2_vld
  54. | `Rgb444le
  55. | `Rgb444be
  56. | `Bgr444le
  57. | `Bgr444be
  58. | `Ya8
  59. | `Y400a
  60. | `Gray8a
  61. | `Bgr48be
  62. | `Bgr48le
  63. | `Yuv420p9be
  64. | `Yuv420p9le
  65. | `Yuv420p10be
  66. | `Yuv420p10le
  67. | `Yuv422p10be
  68. | `Yuv422p10le
  69. | `Yuv444p9be
  70. | `Yuv444p9le
  71. | `Yuv444p10be
  72. | `Yuv444p10le
  73. | `Yuv422p9be
  74. | `Yuv422p9le
  75. | `Gbrp
  76. | `Gbr24p
  77. | `Gbrp9be
  78. | `Gbrp9le
  79. | `Gbrp10be
  80. | `Gbrp10le
  81. | `Gbrp16be
  82. | `Gbrp16le
  83. | `Yuva422p
  84. | `Yuva444p
  85. | `Yuva420p9be
  86. | `Yuva420p9le
  87. | `Yuva422p9be
  88. | `Yuva422p9le
  89. | `Yuva444p9be
  90. | `Yuva444p9le
  91. | `Yuva420p10be
  92. | `Yuva420p10le
  93. | `Yuva422p10be
  94. | `Yuva422p10le
  95. | `Yuva444p10be
  96. | `Yuva444p10le
  97. | `Yuva420p16be
  98. | `Yuva420p16le
  99. | `Yuva422p16be
  100. | `Yuva422p16le
  101. | `Yuva444p16be
  102. | `Yuva444p16le
  103. | `Vdpau
  104. | `Xyz12le
  105. | `Xyz12be
  106. | `Nv16
  107. | `Nv20le
  108. | `Nv20be
  109. | `Rgba64be
  110. | `Rgba64le
  111. | `Bgra64be
  112. | `Bgra64le
  113. | `Yvyu422
  114. | `Ya16be
  115. | `Ya16le
  116. | `Gbrap
  117. | `Gbrap16be
  118. | `Gbrap16le
  119. | `Qsv
  120. | `Mmal
  121. | `D3d11va_vld
  122. | `Cuda
  123. | `_0rgb
  124. | `Rgb0
  125. | `_0bgr
  126. | `Bgr0
  127. | `Yuv420p12be
  128. | `Yuv420p12le
  129. | `Yuv420p14be
  130. | `Yuv420p14le
  131. | `Yuv422p12be
  132. | `Yuv422p12le
  133. | `Yuv422p14be
  134. | `Yuv422p14le
  135. | `Yuv444p12be
  136. | `Yuv444p12le
  137. | `Yuv444p14be
  138. | `Yuv444p14le
  139. | `Gbrp12be
  140. | `Gbrp12le
  141. | `Gbrp14be
  142. | `Gbrp14le
  143. | `Yuvj411p
  144. | `Bayer_bggr8
  145. | `Bayer_rggb8
  146. | `Bayer_gbrg8
  147. | `Bayer_grbg8
  148. | `Bayer_bggr16le
  149. | `Bayer_bggr16be
  150. | `Bayer_rggb16le
  151. | `Bayer_rggb16be
  152. | `Bayer_gbrg16le
  153. | `Bayer_gbrg16be
  154. | `Bayer_grbg16le
  155. | `Bayer_grbg16be
  156. | `Xvmc
  157. | `Yuv440p10le
  158. | `Yuv440p10be
  159. | `Yuv440p12le
  160. | `Yuv440p12be
  161. | `Ayuv64le
  162. | `Ayuv64be
  163. | `Videotoolbox
  164. | `P010le
  165. | `P010be
  166. | `Gbrap12be
  167. | `Gbrap12le
  168. | `Gbrap10be
  169. | `Gbrap10le
  170. | `Mediacodec
  171. | `Gray12be
  172. | `Gray12le
  173. | `Gray10be
  174. | `Gray10le
  175. | `P016le
  176. | `P016be
  177. | `D3d11
  178. | `Gray9be
  179. | `Gray9le
  180. | `Gbrpf32be
  181. | `Gbrpf32le
  182. | `Gbrapf32be
  183. | `Gbrapf32le
  184. | `Drm_prime
  185. | `Opencl
  186. | `Gray14be
  187. | `Gray14le
  188. | `Grayf32be
  189. | `Grayf32le
  190. | `Yuva422p12be
  191. | `Yuva422p12le
  192. | `Yuva444p12be
  193. | `Yuva444p12le
  194. | `Nv24
  195. | `Nv42
  196. | `Vulkan
  197. | `Y210be
  198. | `Y210le
  199. | `X2rgb10le
  200. | `X2rgb10be
  201. | `X2bgr10le
  202. | `X2bgr10be
  203. | `P210be
  204. | `P210le
  205. | `P410be
  206. | `P410le
  207. | `P216be
  208. | `P216le
  209. | `P416be
  210. | `P416le
  211. | `Vuya
  212. | `Rgbaf16be
  213. | `Rgbaf16le
  214. | `Vuyx
  215. | `P012le
  216. | `P012be
  217. | `Y212be
  218. | `Y212le
  219. | `Xv30be
  220. | `Xv30le
  221. | `Xv36be
  222. | `Xv36le
  223. | `Rgbf32be
  224. | `Rgbf32le
  225. | `Rgbaf32be
  226. | `Rgbaf32le
  227. | `P212be
  228. | `P212le
  229. | `P412be
  230. | `P412le
  231. | `Gbrap14be
  232. | `Gbrap14le
]

Pixels formats.

type flag = [
  1. | `Be
  2. | `Pal
  3. | `Bitstream
  4. | `Hwaccel
  5. | `Planar
  6. | `Rgb
  7. | `Alpha
  8. | `Bayer
  9. | `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.