Module Raster.Sample
Sample semantics and formats.
Sample semantics
type semantics=[|`Other of string * int|`Color of Color.profile * bool]The type for sample semantics.
`Color (p, alpha)is for color samples from the color profilep.alphaindicates if there's an alpha component on the right of the color components.`Other(label, dim)is for samples ofdimdimension identified bylabel.
val rgb_l : semanticsrgb_lis for linear RGB samples from theColor.p_rgb_lprofile.
val rgba_l : semanticsrgba_lis for linear RGB samples from theColor.p_rgb_lprofile with an alpha component.
val gray_l : semanticsgray_lis for linear Gray samples from theColor.p_gray_lprofile.
val graya_l : semanticsgraya_lis for linear Gray samples from theColor.p_gray_lluminance with an alpha component.
val pp_semantics : Stdlib.Format.formatter -> semantics -> unitpp_sample_semantics ppf semprints a textual representation ofsemonppf.
Sample format
type pack=[|`PU8888|`FourCC of string * Ba.scalar_type option|`Other of string * Ba.scalar_type option]The type for sample packs. A sample pack describes storage for samples that do not use one scalar per component.
`PU8888. An arbitrary 4D sample X, Y, Z, W with unsigned 8 bits components packed in a single`UInt32scalar as0xXXYYZZWWl.`FourCC(code, restrict). A sample is stored according to the format specified by the FourCCcode, a string of length 4. Ifrestrictis specified the pack can only be used with the corresponding scalar type. For example`FourCC("DXT5", Some `UInt64)can be used to specify a buffer of DXT5 compressed data.`FourCCcan also be used to describe the numerous YUV packed pixel formats.`Other(label, restrict). A sample is stored in some other packing scheme identified bylabel,restricthas the same meaning as in`FourCC.
val pp_pack : Stdlib.Format.formatter -> pack -> unitpp_pack ppf packprints a textual representation ofpackonppf.
val format : ?pack:pack -> semantics -> Ba.scalar_type -> formatformat pack sem stis a sample format with semanticssemand scalar typest. Ifpackis absent one scalar of typestper sample component is used. If present, seeSample.pack.- raises Invalid_argument
if
packis incompatible withst, seeSample.packor if apack`FourCCcode is not made of 4 bytes.
val scalar_type : format -> Ba.scalar_typescalar_type sfissf's buffer scalar type
val dim : format -> intdim sfissf's sample dimension.
val scalar_count : ?first:int -> ?w_stride:int -> ?h_stride:int -> [ `D1 of size1 | `D2 of size2 | `D3 of size3 ] -> format -> intsf_scalar_count first w_stride h_stride size sfis the minimal number of scalars needed to hold a raster data with the corresponding parameters, seevfor their description.- raises Invalid_argument
if
sfis packed.
val pp_format : Stdlib.Format.formatter -> format -> unitpp_format ppf sfprints a textual representation ofsfonppf.