Home
last modified time | relevance | path

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

12345

/external/pdfium/third_party/libtiff/
Dtif_pixarlog.c940 #define CLAMP(v) ( (v<(float)0.) ? 0 \ in horizontalDifferenceF() macro
948 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
949 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
950 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
956 r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; in horizontalDifferenceF()
957 g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; in horizontalDifferenceF()
958 b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; in horizontalDifferenceF()
961 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
962 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
963 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
189 Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), 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()
274 #undef CLAMP
/external/opencv3/3rdparty/libtiff/
Dtif_pixarlog.c924 #define CLAMP(v) ( (v<(float)0.) ? 0 \ in horizontalDifferenceF() macro
932 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
933 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
934 b2 = wp[2] = (uint16) CLAMP(ip[2]); in horizontalDifferenceF()
940 r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; in horizontalDifferenceF()
941 g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; in horizontalDifferenceF()
942 b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; in horizontalDifferenceF()
945 r2 = wp[0] = (uint16) CLAMP(ip[0]); in horizontalDifferenceF()
946 g2 = wp[1] = (uint16) CLAMP(ip[1]); in horizontalDifferenceF()
947 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
189 Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), 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()
274 #undef CLAMP
/external/mesa3d/src/mesa/main/
Dpack.c494 #define SRC_CONVERT(x) CLAMP((int)x, -32768, 32767)
510 #define SRC_CONVERT(x) CLAMP((int)x, -128, 127)
560 dst[i] = (CLAMP(rgba[i][RCOMP], 0, 7) << 5) in _mesa_pack_rgba_span_from_uints()
561 | (CLAMP(rgba[i][GCOMP], 0, 7) << 2) in _mesa_pack_rgba_span_from_uints()
562 | (CLAMP(rgba[i][BCOMP], 0, 3) ); in _mesa_pack_rgba_span_from_uints()
572 dst[i] = (CLAMP(rgba[i][RCOMP], 0, 7) ) in _mesa_pack_rgba_span_from_uints()
573 | (CLAMP(rgba[i][GCOMP], 0, 7) << 3) in _mesa_pack_rgba_span_from_uints()
574 | (CLAMP(rgba[i][BCOMP], 0, 3) << 6); in _mesa_pack_rgba_span_from_uints()
584 dst[i] = (CLAMP(rgba[i][RCOMP], 0, 31) << 11) in _mesa_pack_rgba_span_from_uints()
585 | (CLAMP(rgba[i][GCOMP], 0, 63) << 5) in _mesa_pack_rgba_span_from_uints()
[all …]
Dpixeltransfer.c92 GLfloat r = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
93 GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
94 GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); in _mesa_map_rgba()
95 GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); in _mesa_map_rgba()
137 depthValues[i] = CLAMP(d, 0.0F, 1.0F); in _mesa_scale_and_bias_depth()
152 d = CLAMP(d, 0.0, max); in _mesa_scale_and_bias_depth_uint()
182 rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
183 rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
184 rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
185 rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F); in _mesa_apply_rgba_transfer_ops()
Dformat_pack.c1390 du = FLOAT_TO_BYTE(CLAMP(src[0], 0.0F, 1.0F)); in pack_float_DUDV8()
1391 dv = FLOAT_TO_BYTE(CLAMP(src[1], 0.0F, 1.0F)); in pack_float_DUDV8()
1428 *d = FLOAT_TO_BYTE(CLAMP(src[RCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_R8()
1440 GLbyte r = FLOAT_TO_BYTE(CLAMP(src[RCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RG88_REV()
1441 GLbyte g = FLOAT_TO_BYTE(CLAMP(src[GCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RG88_REV()
1454 GLbyte r = FLOAT_TO_BYTE(CLAMP(src[RCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RGBX8888()
1455 GLbyte g = FLOAT_TO_BYTE(CLAMP(src[GCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RGBX8888()
1456 GLbyte b = FLOAT_TO_BYTE(CLAMP(src[BCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RGBX8888()
1470 GLbyte r = FLOAT_TO_BYTE(CLAMP(src[RCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RGBA8888()
1471 GLbyte g = FLOAT_TO_BYTE(CLAMP(src[GCOMP], -1.0f, 1.0f)); in pack_float_SIGNED_RGBA8888()
[all …]
Drastpos.c234 z2 = CLAMP(z, 0.0F, 1.0F) * (ctx->Viewport.Far - ctx->Viewport.Near) in window_pos3f()
252 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F); in window_pos3f()
254 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F); in window_pos3f()
256 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F); in window_pos3f()
258 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F); in window_pos3f()
260 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F); in window_pos3f()
262 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F); in window_pos3f()
264 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F); in window_pos3f()
266 = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F); in window_pos3f()
Ddepth.c50 depth = CLAMP( depth, 0.0, 1.0 ); in _mesa_ClearDepth()
145 zmin = CLAMP(zmin, 0.0, 1.0); in _mesa_DepthBoundsEXT()
146 zmax = CLAMP(zmax, 0.0, 1.0); in _mesa_DepthBoundsEXT()
Dfog.c159 ctx->Fog.Color[0] = CLAMP(params[0], 0.0F, 1.0F); in _mesa_Fogfv()
160 ctx->Fog.Color[1] = CLAMP(params[1], 0.0F, 1.0F); in _mesa_Fogfv()
161 ctx->Fog.Color[2] = CLAMP(params[2], 0.0F, 1.0F); in _mesa_Fogfv()
162 ctx->Fog.Color[3] = CLAMP(params[3], 0.0F, 1.0F); in _mesa_Fogfv()
Dtexparam.c566 texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
617 texObj->Sampler.BorderColor.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F); in set_tex_parameterf()
618 texObj->Sampler.BorderColor.f[GCOMP] = CLAMP(params[1], 0.0F, 1.0F); in set_tex_parameterf()
619 texObj->Sampler.BorderColor.f[BCOMP] = CLAMP(params[2], 0.0F, 1.0F); in set_tex_parameterf()
620 texObj->Sampler.BorderColor.f[ACOMP] = CLAMP(params[3], 0.0F, 1.0F); in set_tex_parameterf()
1319 params[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F); in _mesa_GetTexParameterfv()
1320 params[1] = CLAMP(obj->Sampler.BorderColor.f[1], 0.0F, 1.0F); in _mesa_GetTexParameterfv()
1321 params[2] = CLAMP(obj->Sampler.BorderColor.f[2], 0.0F, 1.0F); in _mesa_GetTexParameterfv()
1322 params[3] = CLAMP(obj->Sampler.BorderColor.f[3], 0.0F, 1.0F); in _mesa_GetTexParameterfv()
1505 b[0] = CLAMP(obj->Sampler.BorderColor.f[0], 0.0F, 1.0F); in _mesa_GetTexParameteriv()
[all …]
/external/mesa3d/src/gallium/auxiliary/translate/
Dtranslate_generic.c265 value |= ((uint32_t)(CLAMP(src[2], 0, 1) * 0x3ff)) & 0x3ff; in emit_B10G10R10A2_UNORM()
266 value |= (((uint32_t)(CLAMP(src[1], 0, 1) * 0x3ff)) & 0x3ff) << 10; in emit_B10G10R10A2_UNORM()
267 value |= (((uint32_t)(CLAMP(src[0], 0, 1) * 0x3ff)) & 0x3ff) << 20; in emit_B10G10R10A2_UNORM()
268 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()
295 value |= (uint32_t)(((uint32_t)(CLAMP(src[2], -1, 1) * 0x1ff)) & 0x3ff) ; in emit_B10G10R10A2_SNORM()
296 value |= (uint32_t)((((uint32_t)(CLAMP(src[1], -1, 1) * 0x1ff)) & 0x3ff) << 10) ; in emit_B10G10R10A2_SNORM()
[all …]
/external/mesa3d/src/mesa/tnl/
Dt_rasterpos.c127 diffuseColor[3] = CLAMP( in shade_rastpos()
238 Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); in shade_rastpos()
239 Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); in shade_rastpos()
240 Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); in shade_rastpos()
241 Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); in shade_rastpos()
242 Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); in shade_rastpos()
243 Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); in shade_rastpos()
244 Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); in shade_rastpos()
245 Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); in shade_rastpos()
422 ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3], in _tnl_RasterPos()
/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.h96 #define CHAN_TO_USHORT(c) ((GLushort) (CLAMP((c), 0.0f, 1.0f) * 65535.0))
97 #define CHAN_TO_SHORT(c) ((GLshort) (CLAMP((c), 0.0f, 1.0f) * 32767.0))
/external/mesa3d/src/gallium/drivers/softpipe/
Dsp_tex_sample.c279 float u = CLAMP(s, 0.0F, 1.0F); in wrap_linear_clamp()
291 float u = CLAMP(s, 0.0F, 1.0F); in wrap_linear_clamp_to_edge()
309 float u = CLAMP(s, min, max); in wrap_linear_clamp_to_border()
399 *icoord = CLAMP(i, 0, (int) size-1); in wrap_nearest_unorm_clamp()
409 *icoord = util_ifloor( CLAMP(s, -0.5F, (float) size + 0.5F) ); in wrap_nearest_unorm_clamp_to_border()
419 *icoord = util_ifloor( CLAMP(s, 0.5F, (float) size - 0.5F) ); in wrap_nearest_unorm_clamp_to_edge()
431 float u = CLAMP(s - 0.5F, 0.0f, (float) size - 1.0f); in wrap_linear_unorm_clamp()
445 float u = CLAMP(s, -0.5F, (float) size + 0.5F); in wrap_linear_unorm_clamp_to_border()
462 float u = CLAMP(s, +0.5F, (float) size - 0.5F); in wrap_linear_unorm_clamp_to_edge()
479 *layer = CLAMP(c, 0, size - 1); in wrap_array_layer()
[all …]
/external/mesa3d/src/gallium/auxiliary/draw/
Ddraw_vs_exec.c166 output[slot][0] = CLAMP(machine->Outputs[slot].xyzw[0].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
167 output[slot][1] = CLAMP(machine->Outputs[slot].xyzw[1].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
168 output[slot][2] = CLAMP(machine->Outputs[slot].xyzw[2].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
169 output[slot][3] = CLAMP(machine->Outputs[slot].xyzw[3].f[j], 0.0f, 1.0f); in vs_exec_run_linear()
Ddraw_pipe_offset.c102 v0[2] = CLAMP(v0[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
103 v1[2] = CLAMP(v1[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
104 v2[2] = CLAMP(v2[2] + zoffset, 0.0f, 1.0f); in do_offset_tri()
/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()
/external/mesa3d/src/mesa/drivers/dri/i965/
Dgen7_sampler_state.c146 sampler->ss0.lod_bias = S_FIXED(CLAMP(texUnit->LodBias + in gen7_update_sampler_state()
161 sampler->ss1.max_lod = U_FIXED(CLAMP(gl_sampler->MaxLod, 0, 13), 8); in gen7_update_sampler_state()
162 sampler->ss1.min_lod = U_FIXED(CLAMP(gl_sampler->MinLod, 0, 13), 8); in gen7_update_sampler_state()
Dgen7_sf_state.c251 uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7); in upload_sf_state()
278 point_size = CLAMP(ctx->Point.Size, ctx->Point.MinSize, ctx->Point.MaxSize); in upload_sf_state()
281 dw3 |= U_FIXED(CLAMP(point_size, 0.125, 255.875), 3); in upload_sf_state()
Dgen6_sf_state.c222 uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7); in upload_sf_state()
243 point_size = CLAMP(ctx->Point.Size, ctx->Point.MinSize, ctx->Point.MaxSize); in upload_sf_state()
246 dw4 |= U_FIXED(CLAMP(point_size, 0.125, 255.875), 3); in upload_sf_state()
/external/mesa3d/src/mesa/state_tracker/
Dst_atom_rasterizer.c208 raster->point_size = CLAMP(ctx->Point.Size, in update_raster_state()
217 raster->line_width = CLAMP(ctx->Line.Width, in update_raster_state()
222 raster->line_width = CLAMP(ctx->Line.Width, in update_raster_state()

12345