Blame view

3rdparty/boost_1_81_0/libs/gil/doc/naming.rst 1.56 KB
977ed18d   Hu Chunming   提交三方库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  Naming Conventions
  ==================
  
  Description of established naming conventions used in source code of GIL,
  tests and examples.
  
  Concrete Types
  --------------
  
  Concrete (non-generic) GIL types follow this naming convention::
  
    ColorSpace + BitDepth + [f | s]+ [c] + [_planar] + [_step] + ClassType + _t
  
  where:
  
  - ``ColorSpace`` indicates layout and ordering of components.
    For example, ``rgb``, ``bgr``, ``cmyk``, ``rgba``.
  
  - ``BitDepth`` indicates the bit depth of the color channel.
    For example, ``8``,``16``,``32``.
  
  - By default, type of channel is unsigned integral.
    The ``s`` tag indicates signed integral.
    The ``f`` tag indicates a floating point type, which is always signed.
  
  - By default, objects operate on mutable pixels.
    The ``c`` tag indicates object operating over immutable pixels.
  
  - ``_planar`` indicates planar organization (as opposed to interleaved).
  
  - ``_step`` indicates special image views, locators and iterators which
    traverse the data in non-trivial way. For example, backwards or every other
    pixel.
  
  - ``ClassType`` is ``_image`` (image), ``_view`` (image view), ``_loc`` (pixel
    2D locator) ``_ptr`` (pixel iterator), ``_ref`` (pixel reference),
    ``_pixel`` (pixel value).
  
  - ``_t`` suffix indicaes it is a name of a type.
  
  For example:
  
  .. code-block:: cpp
  
    bgr8_image_t             a;    // 8-bit interleaved BGR image
    cmyk16_pixel_t           b;    // 16-bit CMYK pixel value;
    cmyk16c_planar_ref_t     c(b); // const reference to a 16-bit planar CMYK pixel.
    rgb32f_planar_step_ptr_t d;    // step pointer to a 32-bit planar RGB pixel.