@@ -124,9 +124,11 @@ public void AddDestination(IDestination dest)
124124
125125 private Color [ ] _gray2Colors ;
126126 private Color [ ] _gray4Colors ;
127+ private Color [ ] _gray6Colors ;
127128 private Color [ ] _gray8Colors ;
128129 private Color [ ] _gray2Palette ;
129130 private Color [ ] _gray4Palette ;
131+ private Color [ ] _gray6Palette ;
130132 private Color [ ] _gray8Palette ;
131133
132134 private IDisposable _idleRenderer ;
@@ -197,6 +199,7 @@ public void SetColor(Color color)
197199 {
198200 _gray2Colors = ColorUtil . GetPalette ( new [ ] { Colors . Black , color } , 4 ) ;
199201 _gray4Colors = ColorUtil . GetPalette ( new [ ] { Colors . Black , color } , 16 ) ;
202+ _gray6Colors = ColorUtil . GetPalette ( new [ ] { Colors . Black , color } , 64 ) ;
200203 _gray8Colors = ColorUtil . GetPalette ( new [ ] { Colors . Black , color } , 256 ) ;
201204
202205 Logger . Info ( $ "[RenderGraph] SetColor(0%: { _gray2Colors [ 0 ] } , 33%:{ _gray2Colors [ 1 ] } , 66%:{ _gray2Colors [ 2 ] } , 100%:{ _gray2Colors [ 3 ] } )") ;
@@ -210,6 +213,7 @@ public void SetPalette(Color[] colors)
210213 {
211214 _gray2Palette = ColorUtil . GetPalette ( colors , 4 ) ;
212215 _gray4Palette = ColorUtil . GetPalette ( colors , 16 ) ;
216+ _gray6Palette = ColorUtil . GetPalette ( colors , 64 ) ;
213217 _gray8Palette = ColorUtil . GetPalette ( colors , 256 ) ;
214218 }
215219
@@ -220,6 +224,7 @@ public void ClearPalette()
220224 {
221225 _gray2Palette = null ;
222226 _gray4Palette = null ;
227+ _gray6Palette = null ;
223228 _gray8Palette = null ;
224229 }
225230
@@ -655,6 +660,11 @@ public IDisposable StartRendering(Action onCompleted, Action<Exception> onError
655660 Connect ( Source , dest , FrameFormat . Gray4 , FrameFormat . Gray2 ) ;
656661 continue ;
657662 }
663+ // gray8 -> colored gray6
664+ if ( sourceGray8 != null && destColoredGray6 != null ) {
665+ Connect ( Source , dest , FrameFormat . Gray8 , FrameFormat . ColoredGray6 ) ;
666+ continue ;
667+ }
658668 // gray8 -> gray4
659669 if ( sourceGray8 != null && destGray4 != null ) {
660670 Connect ( Source , dest , FrameFormat . Gray8 , FrameFormat . Gray4 ) ;
@@ -1010,6 +1020,19 @@ private void Connect(ISource source, IDestination dest, FrameFormat from, FrameF
10101020 destGray8 . RenderGray8 ) ;
10111021 break ;
10121022
1023+ // gray8 -> colored gray6
1024+ case FrameFormat . ColoredGray6 :
1025+ AssertCompatibility ( source , sourceGray8 , dest , destColoredGray6 , from , to ) ;
1026+ Subscribe (
1027+ sourceGray8 . GetGray8Frames ( ! dest . NeedsDuplicateFrames ) ,
1028+ frame => frame
1029+ . TransformHdScaling ( destFixedSize , ScalerMode )
1030+ . ConvertGray8ToColoredGray6 ( _gray6Colors ?? _gray6Colors )
1031+ . Transform ( this , destFixedSize , destMultiSize ) ,
1032+ destColoredGray6 . RenderColoredGray6
1033+ ) ;
1034+ break ;
1035+
10131036 // gray8 -> rgb565
10141037 case FrameFormat . Rgb565 :
10151038 AssertCompatibility ( source , sourceGray8 , dest , destRgb565 , from , to ) ;
0 commit comments