class_docstr: Mixin class to make a texture aware of color limits.
  
  This class contains the shared functionality for the CPU and GPU mixin
  classes below. In some cases this class provides a "generic"
  implementation of a specific method and is then overridden by one of the
  subclasses.
  
  Parameters
  ----------
  data : ndarray | tuple | None
      Texture data in the form of a numpy array. A tuple of the shape of the
      texture can also be given. However, some subclasses may benefit from
      or even require a numpy array to make decisions based on shape **and**
      dtype.
  **texture_kwargs
      Any other keyword arguments to pass to the parent TextureXD class.
class_docstr_tok: ["Mixin","class","to","make","a","texture","aware","of","color","limits",".","This","class","contains","the","shared","functionality","for","the","CPU","and","GPU","mixin","classes","below",".","In","some","cases","this","class","provides","a","``","generic","''","implementation","of","a","specific","method","and","is","then","overridden","by","one","of","the","subclasses",".","Parameters","--","--","--","--","--","data",":","ndarray","|","tuple","|","None","Texture","data","in","the","form","of","a","numpy","array",".","A","tuple","of","the","shape","of","the","texture","can","also","be","given",".","However",",","some","subclasses","may","benefit","from","or","even","require","a","numpy","array","to","make","decisions","based","on","shape","*","*","and","*","*","dtype",".","*","*","texture_kwargs","Any","other","keyword","arguments","to","pass","to","the","parent","TextureXD","class","."]
docstr: Normalize values to match in-shader representation of this shader.
  
  Parameters
  ----------
  val : int | float | ndarray
      Value(s) to normalize.
  input_data_dtype : numpy.dtype
      Data type of input data. The assumption is that the provided
      values to be normalized are in the same range as the input
      texture data and must be normalized in the same way.
docstr_tok: ["Normalize","values","to","match","in-shader","representation","of","this","shader",".","Parameters","--","--","--","--","--","val",":","int","|","float","|","ndarray","Value","(","s",")","to","normalize",".","input_data_dtype",":","numpy.dtype","Data","type","of","input","data",".","The","assumption","is","that","the","provided","values","to","be","normalized","are","in","the","same","range","as","the","input","texture","data","and","must","be","normalized","in","the","same","way","."]
code: def normalize_value(self, val, input_data_dtype):
      """Normalize values to match in-shader representation of this shader.
  
      Parameters
      ----------
      val : int | float | ndarray
          Value(s) to normalize.
      input_data_dtype : numpy.dtype
          Data type of input data. The assumption is that the provided
          values to be normalized are in the same range as the input
          texture data and must be normalized in the same way.
  
      """
      if not self.is_normalized:
          return val
      dtype_info = np.iinfo(input_data_dtype)
      dmin = dtype_info.min
      dmax = dtype_info.max
      val = (val - dmin) / (dmax - dmin)
      # XXX: Do we need to handle _snorm differently?
      #  Not currently supported in vispy.
      return val
  
imports: import warnings
  import numpy
  from vispy.gloo.texture import Texture2D, Texture3D, convert_dtype_and_clip
label_desc: Use image node_id 8 for calling the _ScaledTextureMixin obj's underlying member method code with example usage: obj.normalize_value(val, input_data_dtype) and returns: val, val