@@ -192,6 +192,7 @@ const TEST_TEMPLATE = {
192
192
// For each test, copy this template and replace the number by the appropriate
193
193
// number for this type
194
194
testInput : [ MIN , BIAS , MAX , MIN , HALF , NEGATIVE_HALF , BIAS , MAX , BIAS , BIAS ] ,
195
+ testInterleavedResult : [ MIN , NEGATIVE_HALF , BIAS , BIAS , MAX , MAX , MIN , BIAS , HALF , BIAS ] ,
195
196
testVectorInterleavedResult : [
196
197
[ MIN , MAX , HALF , BIAS , BIAS ] ,
197
198
[ BIAS , MIN , NEGATIVE_HALF , MAX , BIAS ] ,
@@ -274,6 +275,10 @@ function get_type_values(type) {
274
275
cloned . testInput ,
275
276
idx => TEST_VALUES [ type ] [ idx ]
276
277
) ;
278
+ cloned . testInterleavedResult = Array . from (
279
+ cloned . testInterleavedResult ,
280
+ idx => TEST_VALUES [ type ] [ idx ]
281
+ ) ;
277
282
cloned . testVectorInterleavedResult = Array . from (
278
283
cloned . testVectorInterleavedResult ,
279
284
c => {
@@ -418,7 +423,15 @@ function conversionTest(sourceType, destinationType) {
418
423
"planar channel 1" ,
419
424
assert_func
420
425
) ;
421
- // Planar to interleaved isn't supported
426
+ // Copy to interleaved from planar: all channels are copied
427
+ data . copyTo ( destInterleaved , { planeIndex : 0 , format : destinationType } ) ;
428
+ check_array_equality (
429
+ destInterleaved ,
430
+ result . testInterleavedResult ,
431
+ sourceType ,
432
+ "planar to interleaved" ,
433
+ assert_func
434
+ ) ;
422
435
} , `Test conversion of ${ sourceType } to ${ destinationType } ` ) ;
423
436
}
424
437
0 commit comments