Home
last modified time | relevance | path

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

1234567

/external/pdfium/third_party/libtiff/
Dtif_pixarlog.c964 #define CLAMP(v) ( (v<(float)0.) ? 0 \ in horizontalDifferenceF() macro
972 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
973 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
974 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
980 r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1; in horizontalDifferenceF()
981 g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1; in horizontalDifferenceF()
982 b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1; in horizontalDifferenceF()
985 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
986 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
987 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
[all …]
Dtif_color.c177 #define CLAMP(f,min,max) ((f)<(min)?(min):(f)>(max)?(max):(f)) macro
188 Cb = CLAMP(Cb, 0, 255); in TIFFYCbCrtoRGB()
189 Cr = CLAMP(Cr, 0, 255); in TIFFYCbCrtoRGB()
192 *r = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
195 *g = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
197 *b = CLAMP(i, 0, 255); in TIFFYCbCrtoRGB()
256 { float f1 = 2-2*LumaRed; int32 D1 = FIX(CLAMP(f1,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
257 float f2 = LumaRed*f1/LumaGreen; int32 D2 = -FIX(CLAMP(f2,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
258 float f3 = 2-2*LumaBlue; int32 D3 = FIX(CLAMP(f3,0.0F,2.0F)); in TIFFYCbCrToRGBInit()
259 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.c268 value |= ((uint32_t)(CLAMP(src[2], 0, 1) * 0x3ff)) & 0x3ff; in emit_B10G10R10A2_UNORM()
269 value |= (((uint32_t)(CLAMP(src[1], 0, 1) * 0x3ff)) & 0x3ff) << 10; in emit_B10G10R10A2_UNORM()
270 value |= (((uint32_t)(CLAMP(src[0], 0, 1) * 0x3ff)) & 0x3ff) << 20; in emit_B10G10R10A2_UNORM()
271 value |= ((uint32_t)(CLAMP(src[3], 0, 1) * 0x3)) << 30; in emit_B10G10R10A2_UNORM()
280 value |= ((uint32_t)CLAMP(src[2], 0, 1023)) & 0x3ff; in emit_B10G10R10A2_USCALED()
281 value |= (((uint32_t)CLAMP(src[1], 0, 1023)) & 0x3ff) << 10; in emit_B10G10R10A2_USCALED()
282 value |= (((uint32_t)CLAMP(src[0], 0, 1023)) & 0x3ff) << 20; in emit_B10G10R10A2_USCALED()
283 value |= ((uint32_t)CLAMP(src[3], 0, 3)) << 30; in emit_B10G10R10A2_USCALED()
292 value |= (uint32_t)(((uint32_t)(CLAMP(src[2], -1, 1) * 0x1ff)) & 0x3ff) ; in emit_B10G10R10A2_SNORM()
293 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.c149 diffuseColor[3] = CLAMP( in shade_rastpos()
263 Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); in shade_rastpos()
264 Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); in shade_rastpos()
265 Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); in shade_rastpos()
266 Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); in shade_rastpos()
267 Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); in shade_rastpos()
268 Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); in shade_rastpos()
269 Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); in shade_rastpos()
270 Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); in shade_rastpos()
450 ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3], in _mesa_RasterPos()
[all …]
Dfog.c150 ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F); in _mesa_Fogfv()
151 ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F); in _mesa_Fogfv()
152 ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F); in _mesa_Fogfv()
153 ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F); in _mesa_Fogfv()
Dtexparam.c415 texObj->MaxLevel = CLAMP(params[0], texObj->BaseLevel, in set_tex_parameteri()
698 texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
765 texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
766 texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F); in set_tex_parameterf()
767 texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F); in set_tex_parameterf()
768 texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F); in set_tex_parameterf()
2169 params[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F); in get_tex_parameterfv()
2170 params[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F); in get_tex_parameterfv()
2171 params[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F); in get_tex_parameterfv()
2172 params[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F); in get_tex_parameterfv()
[all …]
Dformat_utils.h177 return CLAMP(src, MIN_INT(dst_size), MAX_INT(dst_size)); in _mesa_signed_to_signed()
183 return CLAMP(src, 0, MAX_UINT(dst_size)); in _mesa_signed_to_unsigned()
Daccum.c44 tmp[0] = CLAMP( red, -1.0F, 1.0F ); in _mesa_ClearAccum()
45 tmp[1] = CLAMP( green, -1.0F, 1.0F ); in _mesa_ClearAccum()
46 tmp[2] = CLAMP( blue, -1.0F, 1.0F ); in _mesa_ClearAccum()
47 tmp[3] = CLAMP( alpha, -1.0F, 1.0F ); in _mesa_ClearAccum()
/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/libkmsxx/kms++util/src/
Dcolor.cpp117 #define CLAMP(a) ((a) > (CF_ONE - 1) ? (CF_ONE - 1) : (a) < 0 ? 0 : (a)) macro
153 return CLAMP(((YUVcoef[tidx][0][0] * r + YUVcoef[tidx][0][1] * g + in MAKE_YUV_Y()
163 return CLAMP(((YUVcoef[tidx][1][0] * r + YUVcoef[tidx][1][1] * g + in MAKE_YUV_U()
173 return CLAMP(((YUVcoef[tidx][2][0] * r + YUVcoef[tidx][2][1] * g + in MAKE_YUV_V()
/external/mesa3d/src/mesa/swrast/
Ds_fog.c50 return CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
54 f = CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
59 f = CLAMP(f, 0.0F, 1.0F); in _swrast_z_to_fogfactor()
98 f = CLAMP(f, 0.0F, 1.0F); \
115 f = CLAMP(f, 0.0F, 1.0F); \
/external/mesa3d/src/util/format/
Du_format_yuv.h117 *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/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()
406 const float u = CLAMP(t, min, max) - 0.5F; in wrap_linear_mirror_clamp_to_border()
420 *icoord = CLAMP(i + offset, 0, (int) size-1); in wrap_nearest_unorm_clamp()
430 *icoord = util_ifloor( CLAMP(s + offset, -0.5F, (float) size + 0.5F) ); in wrap_nearest_unorm_clamp_to_border()
440 *icoord = util_ifloor( CLAMP(s + offset, 0.5F, (float) size - 0.5F) ); in wrap_nearest_unorm_clamp_to_edge()
452 const float u = CLAMP(s + offset - 0.5F, 0.0f, (float) size - 1.0f); in wrap_linear_unorm_clamp()
466 const float u = CLAMP(s + offset, -0.5F, (float) size + 0.5F) - 0.5F; in wrap_linear_unorm_clamp_to_border()
482 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.c214 lod_max = CLAMP(lod_max, 0, 15); in nv10_emit_tex_obj()
215 lod_min = CLAMP(lod_min, 0, 15); in nv10_emit_tex_obj()
216 lod_bias = CLAMP(lod_bias, 0, 15); in nv10_emit_tex_obj()
Dnv20_state_tex.c260 lod_max = CLAMP(lod_max, 0, 15); in nv20_emit_tex_obj()
261 lod_min = CLAMP(lod_min, 0, 15); in nv20_emit_tex_obj()
262 lod_bias = CLAMP(lod_bias, 0, 15); in nv20_emit_tex_obj()
/external/mesa3d/src/mesa/state_tracker/
Dst_atom_rasterizer.c204 raster->point_size = CLAMP(ctx->Point.Size, in st_update_rasterizer()
213 raster->line_width = CLAMP(ctx->Line.Width, in st_update_rasterizer()
218 raster->line_width = CLAMP(ctx->Line.Width, in st_update_rasterizer()
Dst_atom_msaa.c86 loc = roundf(CLAMP(x * 16.0f, 0.0f, 15.0f)); in update_sample_locations()
87 loc |= (int)roundf(CLAMP(y * 16.0f, 0.0f, 15.0f)) << 4; in update_sample_locations()
/external/OpenCL-CTS/test_conformance/conversions/
Dbasic_test_conversions.cpp850 #define CLAMP( _lo, _x, _hi ) ( (_x) < (_lo) ? (_lo) : ((_x) > (_hi) ? (_hi) : (_x))) macro
880 …*out, void *in){ cl_short s = ((cl_short*) in)[0]; ((cl_uchar*) out)[0] = CLAMP( 0, s, CL_UCHAR_MA… in short2uchar_sat()
881 … *out, void *in){ cl_short s = ((cl_short*) in)[0]; ((cl_char*) out)[0] = CLAMP( CL_CHAR_MIN, s, C… in short2char_sat()
889 …d *out, void *in){ cl_uint u = ((cl_uint*) in)[0]; ((cl_uchar*) out)[0] = CLAMP( 0, u, CL_UCHAR_MA… in uint2uchar_sat()
890 …d *out, void *in){ cl_uint u = ((cl_uint*) in)[0]; ((cl_char*) out)[0] = CLAMP( 0, u, CL_CHAR_MAX… in uint2char_sat()
891 …*out, void *in){ cl_uint u = ((cl_uint*) in)[0]; ((cl_ushort*) out)[0] = CLAMP( 0, u, CL_USHRT_MA… in uint2ushort_sat()
892 … *out, void *in){ cl_uint u = ((cl_uint*) in)[0]; ((cl_short*) out)[0] = CLAMP( 0, u, CL_SHRT_MAX… in uint2short_sat()
893 …id *out, void *in){ cl_uint u = ((cl_uint*) in)[0]; ((cl_int*) out)[0] = CLAMP( 0, u, CL_INT_MAX)… in uint2int_sat()
898 …oid *out, void *in){ cl_int i = ((cl_int*) in)[0]; ((cl_uchar*) out)[0] = CLAMP( 0, i, CL_UCHAR_MA… in int2uchar_sat()
899 …void *out, void *in){ cl_int i = ((cl_int*) in)[0]; ((cl_char*) out)[0] = CLAMP( CL_CHAR_MIN, i, C… in int2char_sat()
[all …]
/external/mesa3d/src/gallium/drivers/radeonsi/
Dsi_state_viewport.c177 out->minx = CLAMP(scissor->minx, 0, SI_MAX_SCISSOR); in si_clamp_scissor()
178 out->miny = CLAMP(scissor->miny, 0, SI_MAX_SCISSOR); in si_clamp_scissor()
179 out->maxx = CLAMP(scissor->maxx, 0, SI_MAX_SCISSOR); in si_clamp_scissor()
180 out->maxy = CLAMP(scissor->maxy, 0, SI_MAX_SCISSOR); in si_clamp_scissor()
278 hw_screen_offset_x = CLAMP(hw_screen_offset_x, 0, MAX_PA_SU_HARDWARE_SCREEN_OFFSET); in si_emit_guardband()
279 hw_screen_offset_y = CLAMP(hw_screen_offset_y, 0, MAX_PA_SU_HARDWARE_SCREEN_OFFSET); in si_emit_guardband()
/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()
/external/mesa3d/src/mesa/swrast_setup/
Dss_tritmp.h150 oz0 = CLAMP(v[0]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max); in TAG()
151 oz1 = CLAMP(v[1]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max); in TAG()
152 oz2 = CLAMP(v[2]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max); in TAG()
/external/mesa3d/src/gallium/drivers/v3d/
Dv3dx_state.c635 border.f[i] = CLAMP(border.f[i], 0, 1); in v3d_upload_sampler_state_variant()
645 border.f[i] = CLAMP(border.f[i], -1, 1); in v3d_upload_sampler_state_variant()
649 border.ui[0] = CLAMP(border.ui[0], in v3d_upload_sampler_state_variant()
651 border.ui[1] = CLAMP(border.ui[1], in v3d_upload_sampler_state_variant()
653 border.ui[2] = CLAMP(border.ui[2], in v3d_upload_sampler_state_variant()
655 border.ui[3] = CLAMP(border.ui[3], in v3d_upload_sampler_state_variant()
661 border.ui[i] = CLAMP(border.ui[i], in v3d_upload_sampler_state_variant()
667 border.i[i] = CLAMP(border.i[i], in v3d_upload_sampler_state_variant()
673 border.ui[i] = CLAMP(border.ui[i], in v3d_upload_sampler_state_variant()
679 border.i[i] = CLAMP(border.i[i], in v3d_upload_sampler_state_variant()

1234567