已关闭
色调调节修改文档 #138141
卡西莫多xqy创建于 4月8日关闭于 5月13日
色调调节修改文档 #138141
已关闭
从已删除 :qxu48色调调节合入到openharmony/docsmaster
共 2 个文件变更+127-0
| @@ -185,3 +185,85 @@ function getWhiteBalance(session: camera.PhotoSession | camera.VideoSession): nu | |||
| 185 | return whiteBalance; | 185 | return whiteBalance; |
| 186 | } | 186 | } |
| 187 | ``` | 187 | ``` |
| 188 | + | ||
| 189 | +## setColorTint<sup>20+</sup> | ||
| 190 | + | ||
| 191 | +setColorTint(colorTint: number): void | ||
| 192 | + | ||
| 193 | +获取当前手动白平衡的值。 | ||
| 194 | + | ||
| 195 | +**原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 | ||
| 196 | + | ||
| 197 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 198 | + | ||
| 199 | +**返回值:** | ||
| 200 | + | ||
| 201 | +| 类型 | 说明 | | ||
| 202 | +| ---------- | ----------------------------- | | ||
| 203 | +| number | 返回当前白平衡值。 | | ||
| 204 | + | ||
| 205 | +**错误码:** | ||
| 206 | + | ||
| 207 | +以下错误码的详细介绍请参见[Camera错误码](errorcode-camera.md)。 | ||
| 208 | + | ||
| 209 | +| 错误码ID | 错误信息 | | ||
| 210 | +| --------------- | --------------- | | ||
| 211 | +| 7400103 | Session not config. | | ||
| 212 | + | ||
| 213 | +**示例:** | ||
| 214 | + | ||
| 215 | +```ts | ||
| 216 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 217 | + | ||
| 218 | +function getWhiteBalance(session: camera.PhotoSession | camera.VideoSession): number { | ||
| 219 | + let whiteBalance: number = 0; | ||
| 220 | + try { | ||
| 221 | + whiteBalance = session.getWhiteBalance(); | ||
| 222 | + } catch (error) { | ||
| 223 | + let err = error as BusinessError; | ||
| 224 | + console.error(`The getWhiteBalance call failed. error code: ${err.code}`); | ||
| 225 | + } | ||
| 226 | + return whiteBalance; | ||
| 227 | +} | ||
| 228 | +``` | ||
| 229 | + | ||
| 230 | +## getColorTint<sup>20+</sup> | ||
| 231 | + | ||
| 232 | +getColorTint(): number | ||
| 233 | + | ||
| 234 | +获取当前手动白平衡的值。 | ||
| 235 | + | ||
| 236 | +**原子化服务API:** 从API version 20开始,该接口支持在原子化服务中使用。 | ||
| 237 | + | ||
| 238 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 239 | + | ||
| 240 | +**返回值:** | ||
| 241 | + | ||
| 242 | +| 类型 | 说明 | | ||
| 243 | +| ---------- | ----------------------------- | | ||
| 244 | +| number | 返回当前白平衡值。 | | ||
| 245 | + | ||
| 246 | +**错误码:** | ||
| 247 | + | ||
| 248 | +以下错误码的详细介绍请参见[Camera错误码](errorcode-camera.md)。 | ||
| 249 | + | ||
| 250 | +| 错误码ID | 错误信息 | | ||
| 251 | +| --------------- | --------------- | | ||
| 252 | +| 7400103 | Session not config. | | ||
| 253 | + | ||
| 254 | +**示例:** | ||
| 255 | + | ||
| 256 | +```ts | ||
| 257 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 258 | + | ||
| 259 | +function getWhiteBalance(session: camera.PhotoSession | camera.VideoSession): number { | ||
| 260 | + let whiteBalance: number = 0; | ||
| 261 | + try { | ||
| 262 | + whiteBalance = session.getWhiteBalance(); | ||
| 263 | + } catch (error) { | ||
| 264 | + let err = error as BusinessError; | ||
| 265 | + console.error(`The getWhiteBalance call failed. error code: ${err.code}`); | ||
| 266 | + } | ||
| 267 | + return whiteBalance; | ||
| 268 | +} | ||
| 269 | +``` | ||
| @@ -108,3 +108,48 @@ function getWhiteBalanceRange(session: camera.PhotoSession | camera.VideoSession | |||
| 108 | return range; | 108 | return range; |
| 109 | } | 109 | } |
| 110 | ``` | 110 | ``` |
| 111 | + | ||
| 112 | +## getColorTintRange<sup>20+</sup> | ||
| 113 | + | ||
| 114 | +getColorTintRange(): Array\<number\> | ||
| 115 | + | ||
| 116 | +获取支持的白平衡色调范围。 | ||
| 117 | + | ||
| 118 | +**起始版本:** 26.0.0 | ||
| 119 | + | ||
| 120 | +**模型约束:** ???????? | ||
| 121 | + | ||
| 122 | +**原子化服务API:** 从API version 26开始,该接口支持在原子化服务中使用。 | ||
| 123 | + | ||
| 124 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 125 | + | ||
| 126 | +**返回值:** | ||
| 127 | + | ||
| 128 | +| 类型 | 说明 | | ||
| 129 | +| ---------- | ----------------------------- | | ||
| 130 | +| Array\<number\> | 用于获取手动白平衡值的可调范围,如[2800,10000],单位为K(Kelvin,温度单位),实际情况根据底层能力返回为准。若接口调用失败,返回undefined。| | ||
| 131 | + | ||
| 132 | +**错误码:** | ||
| 133 | + | ||
| 134 | +以下错误码的详细介绍请参见[Camera错误码](errorcode-camera.md)。 | ||
| 135 | + | ||
| 136 | +| 错误码ID | 错误信息 | | ||
| 137 | +| --------------- | --------------- | | ||
| 138 | +| 7400103 | Session not config, only throw in session usage. | | ||
| 139 | + | ||
| 140 | +**示例:** | ||
| 141 | + | ||
| 142 | +```ts | ||
| 143 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 144 | + | ||
| 145 | +function getWhiteBalanceRange(session: camera.PhotoSession | camera.VideoSession): Array<number> { | ||
| 146 | + let range: Array<number> = []; | ||
| 147 | + try { | ||
| 148 | + range = session.getWhiteBalanceRange(); | ||
| 149 | + } catch (error) { | ||
| 150 | + let err = error as BusinessError; | ||
| 151 | + console.error(`The getWhiteBalanceRange call failed. error code: ${err.code}`); | ||
| 152 | + } | ||
| 153 | + return range; | ||
| 154 | +} | ||
| 155 | +``` | ||