← Documents Documentation/userspace-api/media/v4l/pixfmt-packed-hsv.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

Packed HSV 형식

HSV24와 HSV32의 component 값과 memory byte 순서를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/pixfmt-packed-hsv.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

pixfmt-packed-hsv.rst:1-157

HSV24는 h·s·v 세 byte를, HSV32는 padding 뒤 h·s·v 세 byte를 저장하며 bit 7이 각 component의 MSB입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _packed-hsv:
4
5 ******************
6 Packed HSV formats
7 ******************
8
9 Description
10 ===========
11
12 The *hue* (h) is measured in degrees, the equivalence between degrees and LSBs
13 depends on the hsv-encoding used, see :ref:`colorspaces`.
14 The *saturation* (s) and the *value* (v) are measured in percentage of the
15 cylinder: 0 being the smallest value and 255 the maximum.
16
17
18 The values are packed in 24 or 32 bit formats.
19
20
21 .. raw:: latex
22
23 \begingroup
24 \tiny
25 \setlength{\tabcolsep}{2pt}
26
27 .. tabularcolumns:: |p{2.6cm}|p{0.8cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|
28
29 .. _packed-hsv-formats:
30
31 .. flat-table:: Packed HSV Image Formats
32 :header-rows: 2
33 :stub-columns: 0
34
35 * - Identifier
36 - Code
37 -
38 - :cspan:`7` Byte 0 in memory
39 - :cspan:`7` Byte 1
40 - :cspan:`7` Byte 2
41 - :cspan:`7` Byte 3
42 * -
43 -
44 - Bit
45 - 7
46 - 6
47 - 5
48 - 4
49 - 3
50 - 2
51 - 1
52 - 0
53
54 - 7
55 - 6
56 - 5
57 - 4
58 - 3
59 - 2
60 - 1
61 - 0
62
63 - 7
64 - 6
65 - 5
66 - 4
67 - 3
68 - 2
69 - 1
70 - 0
71
72 - 7
73 - 6
74 - 5
75 - 4
76 - 3
77 - 2
78 - 1
79 - 0
80 * .. _V4L2-PIX-FMT-HSV32:
81
82 - ``V4L2_PIX_FMT_HSV32``
83 - 'HSV4'
84 -
85 -
86 -
87 -
88 -
89 -
90 -
91 -
92 -
93
94 - h\ :sub:`7`
95 - h\ :sub:`6`
96 - h\ :sub:`5`
97 - h\ :sub:`4`
98 - h\ :sub:`3`
99 - h\ :sub:`2`
100 - h\ :sub:`1`
101 - h\ :sub:`0`
102
103 - s\ :sub:`7`
104 - s\ :sub:`6`
105 - s\ :sub:`5`
106 - s\ :sub:`4`
107 - s\ :sub:`3`
108 - s\ :sub:`2`
109 - s\ :sub:`1`
110 - s\ :sub:`0`
111
112 - v\ :sub:`7`
113 - v\ :sub:`6`
114 - v\ :sub:`5`
115 - v\ :sub:`4`
116 - v\ :sub:`3`
117 - v\ :sub:`2`
118 - v\ :sub:`1`
119 - v\ :sub:`0`
120 * .. _V4L2-PIX-FMT-HSV24:
121
122 - ``V4L2_PIX_FMT_HSV24``
123 - 'HSV3'
124 -
125 - h\ :sub:`7`
126 - h\ :sub:`6`
127 - h\ :sub:`5`
128 - h\ :sub:`4`
129 - h\ :sub:`3`
130 - h\ :sub:`2`
131 - h\ :sub:`1`
132 - h\ :sub:`0`
133
134 - s\ :sub:`7`
135 - s\ :sub:`6`
136 - s\ :sub:`5`
137 - s\ :sub:`4`
138 - s\ :sub:`3`
139 - s\ :sub:`2`
140 - s\ :sub:`1`
141 - s\ :sub:`0`
142
143 - v\ :sub:`7`
144 - v\ :sub:`6`
145 - v\ :sub:`5`
146 - v\ :sub:`4`
147 - v\ :sub:`3`
148 - v\ :sub:`2`
149 - v\ :sub:`1`
150 - v\ :sub:`0`
151 -
152
153 .. raw:: latex
154
155 \endgroup
156
157 Bit 7 is the most significant bit.
158

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Hue·saturation·value 범위

1-20

Hue `h`는 degree로 측정하며 degree와 LSB의 대응은 선택한 HSV encoding에 따라 달라집니다. 정확한 변환은 colorspace 절의 hsv-encoding 정의를 따라야 합니다.

Saturation `s`와 value `v`는 HSV cylinder에서의 백분율을 8-bit 값으로 나타냅니다. 0이 최소이고 255가 최대입니다. 세 값은 24-bit 또는 32-bit packed 형식으로 저장됩니다.

HSV component
항목설명
hHue degree를 선택한 hsv-encoding의 8-bit LSB 단위로 변환
sSaturation 0~255, 0은 최소, 255는 최대
vValue 0~255, 0은 최소, 255는 최대

각 component의 수치 의미입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

.. _packed-hsv:

******************
Packed HSV formats
******************

Description
===========

The *hue* (h) is measured in degrees, the equivalence between degrees and LSBs
depends on the hsv-encoding used, see :ref:`colorspaces`.
The *saturation* (s) and the *value* (v) are measured in percentage of the
cylinder: 0 being the smallest value and 255 the maximum.


The values are packed in 24 or 32 bit formats.

HSV24와 HSV32 memory byte 배치

21-157
Packed HSV image 형식
Identifier / CodeByte 0..3 in memory
`V4L2_PIX_FMT_HSV32` / `HSV4`Byte 0은 비어 있는 padding, Byte 1=`h[7:0]`, Byte 2=`s[7:0]`, Byte 3=`v[7:0]`
`V4L2_PIX_FMT_HSV24` / `HSV3`Byte 0=`h[7:0]`, Byte 1=`s[7:0]`, Byte 2=`v[7:0]`; Byte 3은 존재하지 않음

표의 Byte 0은 memory에서 가장 먼저 오는 byte이며 bit 7이 MSB입니다.

Component packing
HSV24: `h` → `s` → `v`HSV32: padding byte → `h` → `s` → `v`각 component 안에서는 bit 7이 most significant bit

두 형식의 실제 memory 순서를 비교합니다.

`V4L2_PIX_FMT_HSV32`의 첫 byte는 component data를 담지 않고 뒤 세 byte에 h, s, v가 차례로 옵니다. `V4L2_PIX_FMT_HSV24`는 padding 없이 h, s, v 세 byte만 연속 저장합니다.

.. raw:: latex

    \begingroup
    \tiny
    \setlength{\tabcolsep}{2pt}

.. tabularcolumns:: |p{2.6cm}|p{0.8cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|

.. _packed-hsv-formats:

.. flat-table:: Packed HSV Image Formats
    :header-rows:  2
    :stub-columns: 0

    * - Identifier
      - Code
      -
      - :cspan:`7` Byte 0 in memory
      - :cspan:`7` Byte 1
      - :cspan:`7` Byte 2
      - :cspan:`7` Byte 3
    * -
      -
      - Bit
      - 7
      - 6
      - 5
      - 4
      - 3
      - 2
      - 1
      - 0

      - 7
      - 6
      - 5
      - 4
      - 3
      - 2
      - 1
      - 0

      - 7
      - 6
      - 5
      - 4
      - 3
      - 2
      - 1
      - 0

      - 7
      - 6
      - 5
      - 4
      - 3
      - 2
      - 1
      - 0
    * .. _V4L2-PIX-FMT-HSV32:

      - ``V4L2_PIX_FMT_HSV32``
      - 'HSV4'
      -
      -
      -
      -
      -
      -
      -
      -
      -

      - h\ :sub:`7`
      - h\ :sub:`6`
      - h\ :sub:`5`
      - h\ :sub:`4`
      - h\ :sub:`3`
      - h\ :sub:`2`
      - h\ :sub:`1`
      - h\ :sub:`0`

      - s\ :sub:`7`
      - s\ :sub:`6`
      - s\ :sub:`5`
      - s\ :sub:`4`
      - s\ :sub:`3`
      - s\ :sub:`2`
      - s\ :sub:`1`
      - s\ :sub:`0`

      - v\ :sub:`7`
      - v\ :sub:`6`
      - v\ :sub:`5`
      - v\ :sub:`4`
      - v\ :sub:`3`
      - v\ :sub:`2`
      - v\ :sub:`1`
      - v\ :sub:`0`
    * .. _V4L2-PIX-FMT-HSV24:

      - ``V4L2_PIX_FMT_HSV24``
      - 'HSV3'
      -
      - h\ :sub:`7`
      - h\ :sub:`6`
      - h\ :sub:`5`
      - h\ :sub:`4`
      - h\ :sub:`3`
      - h\ :sub:`2`
      - h\ :sub:`1`
      - h\ :sub:`0`

      - s\ :sub:`7`
      - s\ :sub:`6`
      - s\ :sub:`5`
      - s\ :sub:`4`
      - s\ :sub:`3`
      - s\ :sub:`2`
      - s\ :sub:`1`
      - s\ :sub:`0`

      - v\ :sub:`7`
      - v\ :sub:`6`
      - v\ :sub:`5`
      - v\ :sub:`4`
      - v\ :sub:`3`
      - v\ :sub:`2`
      - v\ :sub:`1`
      - v\ :sub:`0`
      -

.. raw:: latex

    \endgroup

Bit 7 is the most significant bit.