/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/docs-6.1.1/include/rppi_color_model_conversions.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/docs-6.1.1/include/rppi_color_model_conversions.h Source File#

RPP: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rpp/checkouts/docs-6.1.1/include/rppi_color_model_conversions.h Source File
rppi_color_model_conversions.h
Go to the documentation of this file.
1 /*
2 MIT License
3 
4 Copyright (c) 2019 - 2024 Advanced Micro Devices, Inc.
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
25 #ifndef RPPI_COLOR_MODEL_CONVERSIONS_H
26 #define RPPI_COLOR_MODEL_CONVERSIONS_H
27 
28 #include "rppdefs.h"
29 #include "rpp.h"
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
46 /******************** hue ********************/
47 
48 // Adjusts hue of a batch of images
49 
50 // *param[in] srcPtr Input image batch
51 // *param[in] srcSize Array containing an RppiSize for each image in the batch
52 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
53 // *param[out] dstPtr Output image batch
54 // *param[in] hueShift Array containing an Rpp32f hue shift angle inn degrees for each image in the batch (hueShift[n] >= 0)
55 // *param[in] nbatchSize Batch size or the number of images in the batch
56 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
57 // *returns a RppStatus enumeration.
58 // *retval RPP_SUCCESS : No error, Succesful completion
59 // *retval RPP_ERROR : Error
60 
61 RppStatus rppi_hueRGB_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *hueShift, Rpp32u nbatchSize, rppHandle_t rppHandle);
62 RppStatus rppi_hueRGB_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *hueShift, Rpp32u nbatchSize, rppHandle_t rppHandle);
63 #ifdef GPU_SUPPORT
64 RppStatus rppi_hueRGB_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *hueShift, Rpp32u nbatchSize, rppHandle_t rppHandle);
65 RppStatus rppi_hueRGB_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *hueShift, Rpp32u nbatchSize, rppHandle_t rppHandle);
66 #endif // GPU_SUPPORT
67 
68 /******************** saturation ********************/
69 
70 // Adjusts saturation of a batch of images
71 
72 // *param[in] srcPtr Input image batch
73 // *param[in] srcSize Array containing an RppiSize for each image in the batch
74 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
75 // *param[out] dstPtr Output image batch
76 // *param[in] saturationFactor Array containing an Rpp32f saturation factor for each image in the batch (saturationFactor[n] >= 0)
77 // *param[in] nbatchSize Batch size or the number of images in the batch
78 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
79 // *returns a RppStatus enumeration.
80 // *retval RPP_SUCCESS : No error, Succesful completion
81 // *retval RPP_ERROR : Error
82 
83 RppStatus rppi_saturationRGB_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *saturationFactor, Rpp32u nbatchSize, rppHandle_t rppHandle);
84 RppStatus rppi_saturationRGB_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *saturationFactor, Rpp32u nbatchSize, rppHandle_t rppHandle);
85 #ifdef GPU_SUPPORT
86 RppStatus rppi_saturationRGB_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *saturationFactor, Rpp32u nbatchSize, rppHandle_t rppHandle);
87 RppStatus rppi_saturationRGB_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *saturationFactor, Rpp32u nbatchSize, rppHandle_t rppHandle);
88 #endif // GPU_SUPPORT
89 
90 /******************** color_convert ********************/
91 
92 // Converts from Rpp8u RGB to Rpp32f HSV or vice versa for a batch of images
93 
94 // *param[in] srcPtr Input image batch
95 // *param[in] srcSize Array containing an RppiSize for each image in the batch
96 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
97 // *param[out] dstPtr Output image batch
98 // *param[in] convert_mode A RppiColorConvertMode convert mode specified for the whole batch (convert_mode = RGB_HSV / HSV_RGB)
99 // *param[in] nbatchSize Batch size or the number of images in the batch
100 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
101 // *returns a RppStatus enumeration.
102 // *retval RPP_SUCCESS : No error, Succesful completion
103 // *retval RPP_ERROR : Error
104 
105 RppStatus rppi_color_convert_u8_pln3_batchPS_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, RppiColorConvertMode convert_mode, Rpp32u nbatchSize, rppHandle_t rppHandle);
106 RppStatus rppi_color_convert_u8_pkd3_batchPS_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, RppiColorConvertMode convert_mode, Rpp32u nbatchSize, rppHandle_t rppHandle);
107 #ifdef GPU_SUPPORT
108 RppStatus rppi_color_convert_u8_pln3_batchPS_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, RppiColorConvertMode convert_mode, Rpp32u nbatchSize, rppHandle_t rppHandle);
109 RppStatus rppi_color_convert_u8_pkd3_batchPS_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, RppiColorConvertMode convert_mode, Rpp32u nbatchSize, rppHandle_t rppHandle);
110 #endif // GPU_SUPPORT
111 
112 /******************** color_temperature ********************/
113 
114 // Adjusts color temperature of a batch of images
115 
116 // *param[in] srcPtr Input image batch
117 // *param[in] srcSize Array containing an RppiSize for each image in the batch
118 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
119 // *param[out] dstPtr Output image batch
120 // *param[in] adjustmentValue Array containing an Rpp3s adjustment values for each image in the batch (-100 <= adjustmentValue[n] <= 100)
121 // *param[in] nbatchSize Batch size or the number of images in the batch
122 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
123 // *returns a RppStatus enumeration.
124 // *retval RPP_SUCCESS : No error, Succesful completion
125 // *retval RPP_ERROR : Error
126 
127 RppStatus rppi_color_temperature_u8_pln1_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
128 RppStatus rppi_color_temperature_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
129 RppStatus rppi_color_temperature_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
130 #ifdef GPU_SUPPORT
131 RppStatus rppi_color_temperature_u8_pln1_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
132 RppStatus rppi_color_temperature_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
133 RppStatus rppi_color_temperature_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32s *adjustmentValue, Rpp32u nbatchSize, rppHandle_t rppHandle);
134 #endif // GPU_SUPPORT
135 
136 /******************** vignette ********************/
137 
138 // Applies the vignette effect to a batch of images
139 
140 // *param[in] srcPtr Input image batch
141 // *param[in] srcSize Array containing an RppiSize for each image in the batch
142 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
143 // *param[out] dstPtr Output image batch
144 // *param[in] stdDev Array containing an Rpp32f standard deviation for each image in the batch (stdDev[n] >= 0)
145 // *param[in] nbatchSize Batch size or the number of images in the batch
146 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
147 // *returns a RppStatus enumeration.
148 // *retval RPP_SUCCESS : No error, Succesful completion
149 // *retval RPP_ERROR : Error
150 
151 RppStatus rppi_vignette_u8_pln1_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
152 RppStatus rppi_vignette_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
153 RppStatus rppi_vignette_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
154 #ifdef GPU_SUPPORT
155 RppStatus rppi_vignette_u8_pln1_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
156 RppStatus rppi_vignette_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
157 RppStatus rppi_vignette_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32f *stdDev, Rpp32u nbatchSize, rppHandle_t rppHandle);
158 #endif // GPU_SUPPORT
159 
160 /******************** channel_extract ********************/
161 
162 // Extracts a single channel from 3 channel inputs, for a batch of images
163 
164 // *param[in] srcPtr Input image batch
165 // *param[in] srcSize Array containing an RppiSize for each image in the batch
166 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
167 // *param[out] dstPtr Output image batch
168 // *param[in] extractChannelNumber Array containing an Rpp32u channel number to extract, for each image in the batch (0 <= extractChannelNumber[n] <= 2)
169 // *param[in] nbatchSize Batch size or the number of images in the batch
170 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
171 // *returns a RppStatus enumeration.
172 // *retval RPP_SUCCESS : No error, Succesful completion
173 // *retval RPP_ERROR : Error
174 
175 RppStatus rppi_channel_extract_u8_pln1_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
176 RppStatus rppi_channel_extract_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
177 RppStatus rppi_channel_extract_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
178 #ifdef GPU_SUPPORT
179 RppStatus rppi_channel_extract_u8_pln1_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
180 RppStatus rppi_channel_extract_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
181 RppStatus rppi_channel_extract_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u *extractChannelNumber, Rpp32u nbatchSize, rppHandle_t rppHandle);
182 #endif // GPU_SUPPORT
183 
184 /******************** channel_combine ********************/
185 
186 // Combines 3 independent channnels to form a single 3 channnel output, for a batch of images
187 
188 // *param[in] srcPtr1 Input image1 batch
189 // *param[in] srcPtr2 Input image2 batch
190 // *param[in] srcPtr3 Input image3 batch
191 // *param[in] srcSize Array containing an RppiSize for each image in the batch
192 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
193 // *param[out] dstPtr Output image batch
194 // *param[in] nbatchSize Batch size or the number of images in the batch
195 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
196 // *returns a RppStatus enumeration.
197 // *retval RPP_SUCCESS : No error, Succesful completion
198 // *retval RPP_ERROR : Error
199 
200 RppStatus rppi_channel_combine_u8_pln1_batchPD_host(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
201 RppStatus rppi_channel_combine_u8_pln3_batchPD_host(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
202 RppStatus rppi_channel_combine_u8_pkd3_batchPD_host(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
203 #ifdef GPU_SUPPORT
204 RppStatus rppi_channel_combine_u8_pln1_batchPD_gpu(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
205 RppStatus rppi_channel_combine_u8_pln3_batchPD_gpu(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
206 RppStatus rppi_channel_combine_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RppPtr_t srcPtr3, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
207 #endif // GPU_SUPPORT
208 
209 /******************** look_up_table ********************/
210 
211 // Performs a table look-up for each pixel in a batch of images
212 
213 // *param[in] srcPtr Input image batch
214 // *param[in] srcSize Array containing an RppiSize for each image in the batch
215 // *param[in] maxSrcSize A single RppiSize which is the maxWidth and maxHeight for all images in the batch
216 // *param[out] dstPtr Output image batch
217 // *param[in] lutPtr Array containing an Rpp8u* look up table of length 256, for each image in the batch
218 // *param[in] nbatchSize Batch size or the number of images in the batch
219 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
220 // *returns a RppStatus enumeration.
221 // *retval RPP_SUCCESS : No error, Succesful completion
222 // *retval RPP_ERROR : Error
223 
224 RppStatus rppi_look_up_table_u8_pln1_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
225 RppStatus rppi_look_up_table_u8_pln3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
226 RppStatus rppi_look_up_table_u8_pkd3_batchPD_host(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
227 #ifdef GPU_SUPPORT
228 RppStatus rppi_look_up_table_u8_pln1_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
229 RppStatus rppi_look_up_table_u8_pln3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
230 RppStatus rppi_look_up_table_u8_pkd3_batchPD_gpu(RppPtr_t srcPtr, RppiSize *srcSize, RppiSize maxSrcSize, RppPtr_t dstPtr, Rpp8u* lutPtr, Rpp32u nbatchSize, rppHandle_t rppHandle);
231 #endif // GPU_SUPPORT
232 
233 /******************** tensor_table_lookup ********************/
234 
235 // Performs a table look-up for each pixel in an tensor
236 
237 // *param[in] srcPtr Input tensor
238 // *param[out] dstPtr Output tensor
239 // *param[in] lutPtr Array containing an Rpp8u* look up table of length 256
240 // *param[in] tensorDimension Number of dimensions in the tensor
241 // *param[in] tensorDimensionValues Array of length - "tensorDimension", containing size of each dimension in the tensor
242 // *param[in] nbatchSize Batch size or the number of images in the batch
243 // *param[in] rppHandle OpenCL-handle/HIP-handle for "_gpu" variants and Host-handle for "_host" variants
244 // *returns a RppStatus enumeration.
245 // *retval RPP_SUCCESS : No error, Succesful completion
246 // *retval RPP_ERROR : Error
247 
248 RppStatus rppi_tensor_look_up_table_u8_host(RppPtr_t srcPtr, RppPtr_t dstPtr, RppPtr_t lutPtr, Rpp32u tensorDimension, RppPtr_t tensorDimensionValues);
249 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #endif
unsigned int Rpp32u
32 bit unsigned int
Definition: rppdefs.h:62
int Rpp32s
32 bit signed int
Definition: rppdefs.h:64
unsigned char Rpp8u
8 bit unsigned char
Definition: rppdefs.h:54
void * RppPtr_t
void pointer
Definition: rppdefs.h:74
RppStatus
RPP RppStatus type enums.
Definition: rppdefs.h:82
RppiColorConvertMode
RPPI Image color convert mode type enum.
Definition: rppdefs.h:222
float Rpp32f
32 bit float
Definition: rppdefs.h:70
RPP top-level header with RPP handle API.
RPP common HOST/GPU typedef, enum and structure definitions.
RPPI Image size(Width/Height dimensions) type struct.
Definition: rppdefs.h:291