Module Gg.Raster.Sample

module Sample: sig .. end
Sample semantics and formats.


Sample semantics


type semantics = [ `Color of Gg.Color.profile * bool | `Other of string * int ] 
The type for sample semantics.
val rgb_l : semantics
rgb_l is for linear RGB samples from the Gg.Color.p_rgb_l profile.
val rgba_l : semantics
rgba_l is for linear RGB samples from the Gg.Color.p_rgb_l profile with an alpha component.
val gray_l : semantics
gray_l is for linear Gray samples from the Gg.Color.p_gray_l profile.
val graya_l : semantics
graya_l is for linear Gray samples from the Gg.Color.p_gray_l luminance with an alpha component.
val pp_semantics : Format.formatter -> semantics -> unit
pp_sample_semantics ppf sem prints a textual representation of sem on ppf.

Sample format


type pack = [ `FourCC of string * Gg.Ba.scalar_type option
| `Other of string * Gg.Ba.scalar_type option
| `PU8888 ]
The type for sample packs. A sample pack describes storage for samples that do not use one scalar per component.
val pp_pack : Format.formatter -> pack -> unit
pp_pack ppf pack prints a textual representation of pack on ppf.
type format 
The type for sample formats.
val format : ?pack:pack ->
semantics -> Gg.Ba.scalar_type -> format
format pack sem st is a sample format with semantics sem and scalar type st. If pack is absent one scalar of type st per sample component is used. If present, see Gg.Raster.Sample.pack.
Raises Invalid_argument if pack is incompatible with st, see Gg.Raster.Sample.pack or if a pack `FourCC code is not made of 4 bytes.
val semantics : format -> semantics
semantics sf is sf's semantics.
val scalar_type : format -> Gg.Ba.scalar_type
scalar_type sf is sf's buffer scalar type
val pack : format -> pack option
pack sf is sf's sample pack, if any.
val dim : format -> int
dim sf is sf's sample dimension.
val scalar_count : ?first:int ->
?w_stride:int ->
?h_stride:int ->
[ `D1 of Gg.size1 | `D2 of Gg.size2 | `D3 of Gg.size3 ] ->
format -> int
sf_scalar_count first w_stride h_stride size sf is the minimal number of scalars needed to hold a raster data with the corresponding parameters, see Gg.Raster.v for their description.
Raises Invalid_argument if sf is packed.
val pp_format : Format.formatter -> format -> unit
pp_format ppf sf prints a textual representation of sf on ppf.