@@ -75,17 +75,17 @@ func TestClient(t *testing.T) {
75
75
injectCamera .ProjectorFunc = func (ctx context.Context ) (transform.Projector , error ) {
76
76
return projA , nil
77
77
}
78
- injectCamera .ImagesFunc = func (ctx context.Context ) ([]image. Image , time. Time , error ) {
79
- images := []image. Image {}
78
+ injectCamera .ImagesFunc = func (ctx context.Context ) ([]camera. NamedImage , resource. ResponseMetadata , error ) {
79
+ images := []camera. NamedImage {}
80
80
// one color image
81
81
color := rimage .NewImage (40 , 50 )
82
- images = append (images , color )
82
+ images = append (images , camera. NamedImage { color , "color" } )
83
83
// one depth image
84
84
depth := rimage .NewEmptyDepthMap (10 , 20 )
85
- images = append (images , depth )
85
+ images = append (images , camera. NamedImage { depth , "depth" } )
86
86
// a timestamp of 12345
87
87
ts := time .UnixMilli (12345 )
88
- return images , ts , nil
88
+ return images , resource. ResponseMetadata { ts } , nil
89
89
}
90
90
injectCamera .StreamFunc = func (ctx context.Context , errHandlers ... gostream.ErrorHandler ) (gostream.VideoStream , error ) {
91
91
return gostream .NewEmbeddedVideoStreamFromReader (gostream .VideoReaderFunc (func (ctx context.Context ) (image.Image , func (), error ) {
@@ -192,18 +192,20 @@ func TestClient(t *testing.T) {
192
192
test .That (t , propsB .SupportsPCD , test .ShouldBeTrue )
193
193
test .That (t , propsB .IntrinsicParams , test .ShouldResemble , intrinsics )
194
194
195
- images , ts , err := camera1Client .Images (context .Background ())
195
+ images , meta , err := camera1Client .Images (context .Background ())
196
196
test .That (t , err , test .ShouldBeNil )
197
- test .That (t , ts , test .ShouldEqual , time .UnixMilli (12345 ))
197
+ test .That (t , meta . CapturedAt , test .ShouldEqual , time .UnixMilli (12345 ))
198
198
test .That (t , len (images ), test .ShouldEqual , 2 )
199
- test .That (t , images [0 ].Bounds ().Dx (), test .ShouldEqual , 40 )
200
- test .That (t , images [0 ].Bounds ().Dy (), test .ShouldEqual , 50 )
201
- test .That (t , images [0 ], test .ShouldHaveSameTypeAs , & rimage.LazyEncodedImage {})
202
- test .That (t , images [0 ].ColorModel (), test .ShouldHaveSameTypeAs , color .RGBAModel )
203
- test .That (t , images [1 ].Bounds ().Dx (), test .ShouldEqual , 10 )
204
- test .That (t , images [1 ].Bounds ().Dy (), test .ShouldEqual , 20 )
205
- test .That (t , images [1 ], test .ShouldHaveSameTypeAs , & rimage.LazyEncodedImage {})
206
- test .That (t , images [1 ].ColorModel (), test .ShouldHaveSameTypeAs , color .Gray16Model )
199
+ test .That (t , images [0 ].SourceName , test .ShouldEqual , "color" )
200
+ test .That (t , images [0 ].Image .Bounds ().Dx (), test .ShouldEqual , 40 )
201
+ test .That (t , images [0 ].Image .Bounds ().Dy (), test .ShouldEqual , 50 )
202
+ test .That (t , images [0 ].Image , test .ShouldHaveSameTypeAs , & rimage.LazyEncodedImage {})
203
+ test .That (t , images [0 ].Image .ColorModel (), test .ShouldHaveSameTypeAs , color .RGBAModel )
204
+ test .That (t , images [1 ].SourceName , test .ShouldEqual , "depth" )
205
+ test .That (t , images [1 ].Image .Bounds ().Dx (), test .ShouldEqual , 10 )
206
+ test .That (t , images [1 ].Image .Bounds ().Dy (), test .ShouldEqual , 20 )
207
+ test .That (t , images [1 ].Image , test .ShouldHaveSameTypeAs , & rimage.LazyEncodedImage {})
208
+ test .That (t , images [1 ].Image .ColorModel (), test .ShouldHaveSameTypeAs , color .Gray16Model )
207
209
208
210
// Do
209
211
resp , err := camera1Client .DoCommand (context .Background (), testutils .TestCommand )
0 commit comments