/// <summary> /// Decodes a RGBE formatted image into a plain floating-point image /// </summary> /// <param name="_Source">The source RGBE formatted image</param> /// <param name="_bSourceIsXYZ">Tells if the source image is encoded as XYZE rather than RGBE</param> /// <param name="_bTargetNeedsXYZ">Tells if the target needs to be in CIE XYZ space (true) or RGB (false)</param> /// <param name="_ColorProfile">The color profile for the image</param> /// <returns>A HDR image as floats</returns> public static Vector4[,] DecodeRGBEImage( PF_RGBE[,] _Source, bool _bSourceIsXYZ, bool _bTargetNeedsXYZ ) { if ( _Source == null ) return null; Vector4[,] Result = new Vector4[_Source.GetLength( 0 ), _Source.GetLength( 1 )]; DecodeRGBEImage( _Source, _bSourceIsXYZ, Result, _bTargetNeedsXYZ ); return Result; }
/// <summary> /// Decodes a RGBE formatted image into a plain floating-point image /// </summary> /// <param name="_Source">The source RGBE formatted image</param> /// <param name="_bSourceIsXYZ">Tells if the source image is encoded as XYZE rather than RGBE</param> /// <param name="_Target">The target Vector4 image</param> /// <param name="_bTargetNeedsXYZ">Tells if the target needs to be in CIE XYZ space (true) or RGB (false)</param> /// <param name="_ColorProfile">The color profile for the image</param> public static void DecodeRGBEImage( PF_RGBE[,] _Source, bool _bSourceIsXYZ, Vector4D[,] _Target, bool _bTargetNeedsXYZ ) { for ( int Y = 0; Y < _Source.GetLength( 1 ); Y++ ) for ( int X = 0; X < _Source.GetLength( 0 ); X++ ) _Target[X, Y] = _Source[X, Y].DecodedColorAsVector; }