Lines Matching full:r
33 static inline void PetscHlsToRgb(double h, double l, double s, double *r, double *g, double *b) in PetscHlsToRgb() argument
38 *r = PetscHlsHelper(m1, m2, h + 1 / 3.); in PetscHlsToRgb()
43 *r = *g = *b = l; in PetscHlsToRgb()
47 static inline void PetscGammaCorrect(double *r, double *g, double *b) in PetscGammaCorrect() argument
50 *r = (double)PetscPowReal((PetscReal)*r, igamma); in PetscGammaCorrect()
55 static PetscErrorCode PetscDrawCmap_Hue(int mapsize, unsigned char R[], unsigned char G[], unsigned… in PetscDrawCmap_Hue() argument
62 double hue = maxhue * (double)i / (mapsize - 1), r, g, b; in PetscDrawCmap_Hue() local
63 PetscHlsToRgb(hue, lightness, saturation, &r, &g, &b); in PetscDrawCmap_Hue()
64 PetscGammaCorrect(&r, &g, &b); in PetscDrawCmap_Hue()
65 R[i] = (unsigned char)(255 * PetscMin(r, 1.0)); in PetscDrawCmap_Hue()
72 static PetscErrorCode PetscDrawCmap_Gray(int mapsize, unsigned char R[], unsigned char G[], unsigne… in PetscDrawCmap_Gray() argument
75 …for (int i = 0; i < mapsize; i++) R[i] = G[i] = B[i] = (unsigned char)((255.0 * i) / (mapsize - 1)… in PetscDrawCmap_Gray()
79 static PetscErrorCode PetscDrawCmap_Jet(int mapsize, unsigned char R[], unsigned char G[], unsigned… in PetscDrawCmap_Jet() argument
87 double m, r = 0, g = 0, b = 0; in PetscDrawCmap_Jet() local
93 r = 0; in PetscDrawCmap_Jet()
98 r = 0; in PetscDrawCmap_Jet()
103 r = m; in PetscDrawCmap_Jet()
108 r = 1; in PetscDrawCmap_Jet()
113 r = 1 - m / 2; in PetscDrawCmap_Jet()
118 R[i] = (unsigned char)(255 * PetscMin(r, 1.0)); in PetscDrawCmap_Jet()
125 static PetscErrorCode PetscDrawCmap_Hot(int mapsize, unsigned char R[], unsigned char G[], unsigned… in PetscDrawCmap_Hot() argument
133 double m, r = 0, g = 0, b = 0; in PetscDrawCmap_Hot() local
139 r = m; in PetscDrawCmap_Hot()
144 r = 1; in PetscDrawCmap_Hot()
149 r = 1; in PetscDrawCmap_Hot()
154 R[i] = (unsigned char)(255 * PetscMin(r, 1.0)); in PetscDrawCmap_Hot()
161 static PetscErrorCode PetscDrawCmap_Bone(int mapsize, unsigned char R[], unsigned char G[], unsigne… in PetscDrawCmap_Bone() argument
164 (void)PetscDrawCmap_Hot(mapsize, R, G, B); in PetscDrawCmap_Bone()
167 double r = (7 * u + B[i] / 255.0) / 8; in PetscDrawCmap_Bone() local
169 double b = (7 * u + R[i] / 255.0) / 8; in PetscDrawCmap_Bone()
170 R[i] = (unsigned char)(255 * PetscMin(r, 1.0)); in PetscDrawCmap_Bone()
202 PetscErrorCode PetscDrawUtilitySetCmap(const char colormap[], int mapsize, unsigned char R[], unsig… in PetscDrawUtilitySetCmap() argument
223 PetscCall(PetscDrawCmapTable[id].cmap(mapsize, R, G, B)); in PetscDrawUtilitySetCmap()
228 R[i] = rgb[i][0]; in PetscDrawUtilitySetCmap()
244 SWAP(R, i, j); in PetscDrawUtilitySetCmap()
256 PetscReal r = PetscPowReal((PetscReal)R[i] / 255, gamma); in PetscDrawUtilitySetCmap() local
259 R[i] = (unsigned char)(255 * PetscMin(r, (PetscReal)1.0)); in PetscDrawUtilitySetCmap()