| 379 | |
| 380 | template <typename T> |
| 381 | int SimpleTensor<T>::num_channels() const |
| 382 | { |
| 383 | switch (_format) |
| 384 | { |
| 385 | case Format::U8: |
| 386 | case Format::U16: |
| 387 | case Format::S16: |
| 388 | case Format::U32: |
| 389 | case Format::S32: |
| 390 | case Format::U64: |
| 391 | case Format::S64: |
| 392 | case Format::F16: |
| 393 | case Format::F32: |
| 394 | return 1; |
| 395 | // Because the U and V channels are subsampled |
| 396 | // these formats appear like having only 2 channels: |
| 397 | case Format::YUYV422: |
| 398 | case Format::UYVY422: |
| 399 | return 2; |
| 400 | case Format::UV88: |
| 401 | return 2; |
| 402 | case Format::RGB888: |
| 403 | return 3; |
| 404 | case Format::RGBA8888: |
| 405 | return 4; |
| 406 | case Format::UNKNOWN: |
| 407 | return _num_channels; |
| 408 | //Doesn't make sense for planar formats: |
| 409 | case Format::NV12: |
| 410 | case Format::NV21: |
| 411 | case Format::IYUV: |
| 412 | case Format::YUV444: |
| 413 | default: |
| 414 | return 0; |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | template <typename T> |
| 419 | int SimpleTensor<T>::num_elements() const |
no outgoing calls
no test coverage detected