<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __EncodedAttribute_encode_jpeg_rgb24(self, rgb24, width=0, height=0, quality=100.0):
 """Encode a 24 bit rgb color image as JPEG format. :param rgb24: an object containning image information :type rgb24: :py:obj:`str` or :class:`numpy.ndarray` or seq< seq<element> > :param width: image width. **MUST** be given if rgb24 is a string or if it is a :class:`numpy.ndarray` with ndims != 3. Otherwise it is calculated internally. :type width: :py:obj:`int` :param height: image height. **MUST** be given if rgb24 is a string or if it is a :class:`numpy.ndarray` with ndims != 3. Otherwise it is calculated internally. :type height: :py:obj:`int` :param quality: Quality of JPEG (0=poor quality 100=max quality) (default is 100.0) :type quality: :py:obj:`float` .. note:: When :class:`numpy.ndarray` is given: - rgb24 **MUST** be CONTIGUOUS, ALIGNED - if rgb24.ndims != 3, width and height **MUST** be given and rgb24.nbytes/3 **MUST** match width*height - if rgb24.ndims == 3, rgb24.itemsize **MUST** be 1 (typically, rgb24.dtype is one of `numpy.dtype.byte`, `numpy.dtype.ubyte`, `numpy.dtype.int8` or `numpy.dtype.uint8`) and shape **MUST** be (height, width, 3) Example:: def read_myattr(self, attr):
 enc = tango.EncodedAttribute() # create an 'image' where each pixel is R=0x01, G=0x01, B=0x01 arr = numpy.ones((10,10,3), dtype=numpy.uint8) enc.encode_jpeg_rgb24(data) attr.set_value(enc) """

    self._generic_encode_rgb24(rgb24, width=width, height=height, quality=quality, format=_ImageFormat.JpegImage)