Method for color space conversion from HSL to RGB
A technology of color space conversion and calibration method, which is applied in the field of HSL to RGB color space conversion, can solve the problems of poor compatibility and low efficiency of floating-point operation, and achieve the effects of improving efficiency, reducing system cost, and expanding the scope of application
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0032] Take an 8-bit microcontroller to realize color space conversion as an example, such as figure 1 shown, including the following steps:
[0033] 1) Calibrate the HSL, the range is between 0 and 240;
[0034] 2) If S=0, then RGB is equal, and the fixed-point calculation is calibrated, and the range of RGB is between 0 and 255;
[0035] 3) If S≠0, then calculate p, q, hk at fixed point; initialize tR, tG, tB at fixed point; calculate tc corresponding to each color at fixed point; calculate corresponding color according to tc, p, q; calibrate RGB, the range of RGB is Between 0 and 255.
[0036] The specific process is as follows:
[0037] void hsl2rgb(u8 h,u8 s,u8 l,u8 *r,u8 *g,u8 *b)
[0038] {
[0039] unsigned short R, G, B;
[0040] unsigned char i;
[0041] if(s == 0)
[0042] {
[0043] R = G = B = l*255 / 240;
[0044] }
[0045] else
[0046] {
[0047] unsigned char q = (l<120)?((unsigned short)(l * (240+s...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com