Home
last modified time | relevance | path

Searched refs:CLAMP (Results 1 – 25 of 136) sorted by relevance

123456

/external/pdfium/third_party/libtiff/
Dtif_pixarlog.c967 #define CLAMP(v) ( (v<(float)0.) ? 0 \ in horizontalDifferenceF() macro
975 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
976 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
977 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
983 r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1; in horizontalDifferenceF()
984 g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1; in horizontalDifferenceF()
985 b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1; in horizontalDifferenceF()
988 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
989 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
990 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
[all …]
Dtif_color.c179 #define CLAMP(f,min,max) ((f)<(min)?(min):(f)>(max)?(max):(f)) macro
190 Cb = CLAMP(Cb, 0, 255); in TIFFYCbCrtoRGB()
191 Cr = CLAMP(Cr, 0, 255); in TIFFYCbCrtoRGB()
194 *r = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
197 *g = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
199 *b = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
258 { float f1 = 2-2*LumaRed; int32 D1 = FIX(CLAMP(f1,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
259 float f2 = LumaRed*f1/LumaGreen; int32 D2 = -FIX(CLAMP(f2,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
260 float f3 = 2-2*LumaBlue; int32 D3 = FIX(CLAMP(f3,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
261 float f4 = LumaBlue*f3/LumaGreen; int32 D4 = -FIX(CLAMP(f4,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
[all …]
/external/mesa3d/src/gallium/auxiliary/translate/
Dtranslate_generic.c269 value |= ((uint32_t)(CLAMP(src[2], 0, 1) * 0x3ff)) & 0x3ff; in emit_B10G10R10A2_UNORM()
270 value |= (((uint32_t)(CLAMP(src[1], 0, 1) * 0x3ff)) & 0x3ff) << 10; in emit_B10G10R10A2_UNORM()
271 value |= (((uint32_t)(CLAMP(src[0], 0, 1) * 0x3ff)) & 0x3ff) << 20; in emit_B10G10R10A2_UNORM()
272 value |= ((uint32_t)(CLAMP(src[3], 0, 1) * 0x3)) << 30; in emit_B10G10R10A2_UNORM()
281 value |= ((uint32_t)CLAMP(src[2], 0, 1023)) & 0x3ff; in emit_B10G10R10A2_USCALED()
282 value |= (((uint32_t)CLAMP(src[1], 0, 1023)) & 0x3ff) << 10; in emit_B10G10R10A2_USCALED()
283 value |= (((uint32_t)CLAMP(src[0], 0, 1023)) & 0x3ff) << 20; in emit_B10G10R10A2_USCALED()
284 value |= ((uint32_t)CLAMP(src[3], 0, 3)) << 30; in emit_B10G10R10A2_USCALED()
293 value |= (uint32_t)(((uint32_t)(CLAMP(src[2], -1, 1) * 0x1ff)) & 0x3ff) ; in emit_B10G10R10A2_SNORM()
294 value |= (uint32_t)((((uint32_t)(CLAMP(src[1], -1, 1) * 0x1ff)) & 0x3ff) << 10) ; in emit_B10G10R10A2_SNORM()
[all …]
/external/mesa3d/src/mesa/main/
Dpixeltransfer.c94 GLfloat r = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
95 GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
96 GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
97 GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); in _mesa_map_rgba()
139 depthValues[i] = CLAMP(d, 0.0F, 1.0F); in _mesa_scale_and_bias_depth()
154 d = CLAMP(d, 0.0, max); in _mesa_scale_and_bias_depth_uint()
184 rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
185 rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
186 rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
187 rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
Drastpos.c131 diffuseColor[3] = CLAMP( in shade_rastpos()
245 Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); in shade_rastpos()
246 Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); in shade_rastpos()
247 Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); in shade_rastpos()
248 Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); in shade_rastpos()
249 Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); in shade_rastpos()
250 Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); in shade_rastpos()
251 Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); in shade_rastpos()
252 Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); in shade_rastpos()
424 ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3], in _mesa_RasterPos()
[all …]
Ddepth.c49 ctx->Depth.Clear = CLAMP( depth, 0.0, 1.0 ); in _mesa_ClearDepth()
154 zmin = CLAMP(zmin, 0.0, 1.0); in _mesa_DepthBoundsEXT()
155 zmax = CLAMP(zmax, 0.0, 1.0); in _mesa_DepthBoundsEXT()
Dfog.c164 ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F); in _mesa_Fogfv()
165 ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F); in _mesa_Fogfv()
166 ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F); in _mesa_Fogfv()
167 ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F); in _mesa_Fogfv()
Dtexparam.c436 texObj->MaxLevel = CLAMP(params[0], texObj->BaseLevel, in set_tex_parameteri()
715 texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
782 texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
783 texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F); in set_tex_parameterf()
784 texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F); in set_tex_parameterf()
785 texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F); in set_tex_parameterf()
1847 params[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F); in get_tex_parameterfv()
1848 params[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F); in get_tex_parameterfv()
1849 params[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F); in get_tex_parameterfv()
1850 params[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F); in get_tex_parameterfv()
[all …]
/external/mesa3d/src/amd/vulkan/
Dradv_formats.c950 clear_vals[0] = ((uint16_t)util_iround(CLAMP(value->float32[0], 0.0f, 1.0f) * 0xffff)) & 0xffff; in radv_format_pack_clear_color()
954 clear_vals[0] = ((uint16_t)util_iround(CLAMP(value->float32[0], 0.0f, 1.0f) * 0xffff)) & 0xffff; in radv_format_pack_clear_color()
955 clear_vals[0] |= ((uint16_t)util_iround(CLAMP(value->float32[1], 0.0f, 1.0f) * 0xffff)) << 16; in radv_format_pack_clear_color()
959 clear_vals[0] = ((uint16_t)util_iround(CLAMP(value->float32[0], 0.0f, 1.0f) * 0xffff)) & 0xffff; in radv_format_pack_clear_color()
960 clear_vals[0] |= ((uint16_t)util_iround(CLAMP(value->float32[1], 0.0f, 1.0f) * 0xffff)) << 16; in radv_format_pack_clear_color()
961 clear_vals[1] = ((uint16_t)util_iround(CLAMP(value->float32[2], 0.0f, 1.0f) * 0xffff)) & 0xffff; in radv_format_pack_clear_color()
962 clear_vals[1] |= ((uint16_t)util_iround(CLAMP(value->float32[3], 0.0f, 1.0f) * 0xffff)) << 16; in radv_format_pack_clear_color()
965 clear_vals[0] = ((uint16_t)util_iround(CLAMP(value->float32[0], -1.0f, 1.0f) * 0x7fff)) & 0xffff; in radv_format_pack_clear_color()
966 clear_vals[0] |= ((uint16_t)util_iround(CLAMP(value->float32[1], -1.0f, 1.0f) * 0x7fff)) << 16; in radv_format_pack_clear_color()
967 clear_vals[1] = ((uint16_t)util_iround(CLAMP(value->float32[2], -1.0f, 1.0f) * 0x7fff)) & 0xffff; in radv_format_pack_clear_color()
[all …]
/external/libkmsxx/kms++util/src/
Dcolor.cpp69 #define CLAMP(a) ((a) > (CF_ONE-1) ? (CF_ONE-1) : (a) < 0 ? 0 : (a)) macro
115 return CLAMP(((YUVcoef[tidx][0][0] * r + YUVcoef[tidx][0][1] * g + in MAKE_YUV_Y()
125 return CLAMP(((YUVcoef[tidx][1][0] * r + YUVcoef[tidx][1][1] * g + in MAKE_YUV_U()
135 return CLAMP(((YUVcoef[tidx][2][0] * r + YUVcoef[tidx][2][1] * g + in MAKE_YUV_V()
/external/mesa3d/src/gallium/auxiliary/util/
Du_format_yuv.h61 const float _r = CLAMP(r, 0.0f, 1.0f); in util_format_rgb_float_to_yuv()
62 const float _g = CLAMP(g, 0.0f, 1.0f); in util_format_rgb_float_to_yuv()
63 const float _b = CLAMP(b, 0.0f, 1.0f); in util_format_rgb_float_to_yuv()
117 *r = CLAMP(_r, 0, 255); in util_format_yuv_to_rgb_8unorm()
118 *g = CLAMP(_g, 0, 255); in util_format_yuv_to_rgb_8unorm()
119 *b = CLAMP(_b, 0, 255); in util_format_yuv_to_rgb_8unorm()
/external/mesa3d/src/mesa/swrast/
Ds_fog.c49 return CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
53 f = CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
58 f = CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
97 f = CLAMP(f, 0.0F, 1.0F); \
114 f = CLAMP(f, 0.0F, 1.0F); \
Ds_chan.h97 #define CHAN_TO_USHORT(c) ((GLushort) (CLAMP((c), 0.0f, 1.0f) * 65535.0))
98 #define CHAN_TO_SHORT(c) ((GLshort) (CLAMP((c), 0.0f, 1.0f) * 32767.0))
/external/strace/
Dubi.c62 CLAMP(mkvol.name_len, 0, in ubi_ioctl()
94 for (c = 0; c < CLAMP(rnvol.count, 0, UBI_MAX_RNVOL); ++c) { in ubi_ioctl()
101 CLAMP(rnvol.ents[c].name_len, 0, in ubi_ioctl()
/external/mesa3d/src/gallium/auxiliary/draw/
Ddraw_vs_exec.c177 output[slot][0] = CLAMP(machine->Outputs[slot].xyzw[0].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
178 output[slot][1] = CLAMP(machine->Outputs[slot].xyzw[1].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
179 output[slot][2] = CLAMP(machine->Outputs[slot].xyzw[2].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
180 output[slot][3] = CLAMP(machine->Outputs[slot].xyzw[3].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
Ddraw_pipe_offset.c123 v0[2] = CLAMP(v0[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
124 v1[2] = CLAMP(v1[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
125 v2[2] = CLAMP(v2[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
/external/mesa3d/src/gallium/drivers/softpipe/
Dsp_tex_sample.c294 const float u = CLAMP(s * size + offset, 0.0F, (float)size) - 0.5f; in wrap_linear_clamp()
306 const float u = CLAMP(s * size + offset, 0.0F, (float)size) - 0.5f; in wrap_linear_clamp_to_edge()
323 const float u = CLAMP(s * size + offset, min, max) - 0.5f; in wrap_linear_clamp_to_border()
392 const float u = CLAMP(t, min, max) - 0.5F; in wrap_linear_mirror_clamp_to_border()
406 *icoord = CLAMP(i + offset, 0, (int) size-1); in wrap_nearest_unorm_clamp()
416 *icoord = util_ifloor( CLAMP(s + offset, -0.5F, (float) size + 0.5F) ); in wrap_nearest_unorm_clamp_to_border()
426 *icoord = util_ifloor( CLAMP(s + offset, 0.5F, (float) size - 0.5F) ); in wrap_nearest_unorm_clamp_to_edge()
438 const float u = CLAMP(s + offset - 0.5F, 0.0f, (float) size - 1.0f); in wrap_linear_unorm_clamp()
452 const float u = CLAMP(s + offset, -0.5F, (float) size + 0.5F) - 0.5F; in wrap_linear_unorm_clamp_to_border()
468 const float u = CLAMP(s + offset, +0.5F, (float) size - 0.5F) - 0.5F; in wrap_linear_unorm_clamp_to_edge()
[all …]
/external/mesa3d/src/mesa/drivers/dri/nouveau/
Dnv04_state_tex.c81 lod_max = CLAMP(MIN2(sa->MaxLod, t->_MaxLambda), in nv04_emit_tex_obj()
84 lod_bias = CLAMP(ctx->Texture.Unit[i].LodBias + in nv04_emit_tex_obj()
Dnv10_state_tex.c213 lod_max = CLAMP(lod_max, 0, 15); in nv10_emit_tex_obj()
214 lod_min = CLAMP(lod_min, 0, 15); in nv10_emit_tex_obj()
215 lod_bias = CLAMP(lod_bias, 0, 15); in nv10_emit_tex_obj()
Dnv20_state_tex.c259 lod_max = CLAMP(lod_max, 0, 15); in nv20_emit_tex_obj()
260 lod_min = CLAMP(lod_min, 0, 15); in nv20_emit_tex_obj()
261 lod_bias = CLAMP(lod_bias, 0, 15); in nv20_emit_tex_obj()
/external/mesa3d/src/compiler/glsl/
Dir_constant_expression.cpp264 _mesa_lroundevenf(CLAMP(x, -1.0f, +1.0f) * 127.0f); in pack_snorm_1x8()
283 _mesa_lroundevenf(CLAMP(x, -1.0f, +1.0f) * 32767.0f); in pack_snorm_1x16()
301 return CLAMP((int8_t) u / 127.0f, -1.0f, +1.0f); in unpack_snorm_1x8()
319 return CLAMP((int16_t) u / 32767.0f, -1.0f, +1.0f); in unpack_snorm_1x16()
337 return (uint8_t) (int) _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 255.0f); in pack_unorm_1x8()
356 _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 65535.0f); in pack_unorm_1x16()
/external/mesa3d/src/mesa/state_tracker/
Dst_atom_rasterizer.c230 raster->point_size = CLAMP(ctx->Point.Size, in st_update_rasterizer()
239 raster->line_width = CLAMP(ctx->Line.Width, in st_update_rasterizer()
244 raster->line_width = CLAMP(ctx->Line.Width, in st_update_rasterizer()
/external/mesa3d/src/mesa/drivers/dri/i965/
Dbrw_meta_util.c371 override_color.f32[i] = CLAMP(override_color.f32[i], 0.0f, 1.0f); in brw_meta_convert_fast_clear_color()
376 override_color.f32[i] = CLAMP(override_color.f32[i], -1.0f, 1.0f); in brw_meta_convert_fast_clear_color()
395 override_color.i32[i] = CLAMP(override_color.i32[i], min, max); in brw_meta_convert_fast_clear_color()
/external/mesa3d/src/mesa/drivers/dri/i915/
Di830_texstate.c264 minlod_fixed = U_FIXED(CLAMP(sampler->MinLod, 0.0, 11), 4); in i830_update_tex_unit()
268 maxlod_fixed = U_FIXED(CLAMP(maxlod, 0.0, 11.75), 2); in i830_update_tex_unit()
273 maxlod_fixed = U_FIXED(CLAMP(maxlod, 0.0, 11), 0); in i830_update_tex_unit()
/external/mesa3d/src/gallium/drivers/nouveau/nv30/
Dnv30_texture.c50 NV30_WRAP(CLAMP); in wrap_mode()
178 so->max_lod = (int)(CLAMP(cso->max_lod, 0.0, max_lod) * 256.0); in nv30_sampler_state_create()
179 so->min_lod = (int)(CLAMP(cso->min_lod, 0.0, max_lod) * 256.0); in nv30_sampler_state_create()

123456