Apollo 10.0
自动驾驶开放平台
apollo::perception::base::Image8U类 参考

A wrapper around Blob holders serving as the basic computational unit for images. 更多...

#include <image_8u.h>

apollo::perception::base::Image8U 的协作图:

Public 成员函数

 Image8U ()
 
 Image8U (int rows, int cols, Color type, std::shared_ptr< Blob< uint8_t > > blob, int offset=0)
 
 Image8U (int rows, int cols, Color type)
 
 Image8U (const Image8U &src)
 
Image8Uoperator= (const Image8U &src)
 
 ~Image8U ()
 
uint8_t * mutable_cpu_data ()
 
uint8_t * mutable_gpu_data ()
 
const uint8_t * cpu_data () const
 
const uint8_t * gpu_data () const
 
const uint8_t * cpu_ptr (int row=0) const
 
const uint8_t * gpu_ptr (int row=0) const
 
uint8_t * mutable_cpu_ptr (int row=0)
 
uint8_t * mutable_gpu_ptr (int row=0)
 
Color type () const
 
int rows () const
 
int cols () const
 
int channels () const
 
int width_step () const
 
int total () const
 
Image8U operator() (const Rect< int > &roi) const
 
std::shared_ptr< Blob< uint8_t > > blob ()
 
std::shared_ptr< const Blob< uint8_t > > blob () const
 

Protected 属性

int rows_
 
int cols_
 
Color type_
 
int channels_
 
int width_step_
 
std::shared_ptr< Blob< uint8_t > > blob_
 
int offset_
 

详细描述

A wrapper around Blob holders serving as the basic computational unit for images.

TODO(dox): more thorough description.

在文件 image_8u.h44 行定义.

构造及析构函数说明

◆ Image8U() [1/4]

apollo::perception::base::Image8U::Image8U ( )
inline

◆ Image8U() [2/4]

apollo::perception::base::Image8U::Image8U ( int  rows,
int  cols,
Color  type,
std::shared_ptr< Blob< uint8_t > >  blob,
int  offset = 0 
)
inline

在文件 image_8u.h55 行定义.

57 : rows_(rows), cols_(cols), type_(type), blob_(blob), offset_(offset) {
59 CHECK_EQ(blob_->num_axes(), 3);
60 CHECK_EQ(blob_->shape(2), channels_);
61 CHECK_LE(offset_ + blob_->offset({rows - 1, cols - 1, channels_ - 1}),
62 (int)(blob_->count()));
63 width_step_ = blob_->offset({1, 0, 0}) * static_cast<int>(sizeof(uint8_t));
64 }
std::shared_ptr< Blob< uint8_t > > blob()
Definition image_8u.h:133
const std::map< Color, int > kChannelsMap
Definition image_8u.h:35

◆ Image8U() [3/4]

apollo::perception::base::Image8U::Image8U ( int  rows,
int  cols,
Color  type 
)
inline

在文件 image_8u.h66 行定义.

67 : rows_(rows), cols_(cols), type_(type), offset_(0) {
69 blob_.reset(new Blob<uint8_t>({rows_, cols_, channels_}));
70 width_step_ = blob_->offset({1, 0, 0}) * static_cast<int>(sizeof(uint8_t));
71 }

◆ Image8U() [4/4]

apollo::perception::base::Image8U::Image8U ( const Image8U src)
inline

在文件 image_8u.h73 行定义.

74 : rows_(src.rows_),
75 cols_(src.cols_),
76 type_(src.type_),
77 channels_(src.channels_),
78 width_step_(src.width_step_),
79 blob_(src.blob_),
80 offset_(src.offset_) {}

◆ ~Image8U()

apollo::perception::base::Image8U::~Image8U ( )
inline

在文件 image_8u.h93 行定义.

93{}

成员函数说明

◆ blob() [1/2]

std::shared_ptr< Blob< uint8_t > > apollo::perception::base::Image8U::blob ( )
inline

在文件 image_8u.h133 行定义.

133{ return blob_; }

◆ blob() [2/2]

std::shared_ptr< const Blob< uint8_t > > apollo::perception::base::Image8U::blob ( ) const
inline

在文件 image_8u.h136 行定义.

136{ return blob_; }

◆ channels()

int apollo::perception::base::Image8U::channels ( ) const
inline

在文件 image_8u.h122 行定义.

122{ return channels_; }

◆ cols()

int apollo::perception::base::Image8U::cols ( ) const
inline

在文件 image_8u.h121 行定义.

121{ return cols_; }

◆ cpu_data()

const uint8_t * apollo::perception::base::Image8U::cpu_data ( ) const
inline

在文件 image_8u.h99 行定义.

99{ return cpu_ptr(0); }
const uint8_t * cpu_ptr(int row=0) const
Definition image_8u.h:103

◆ cpu_ptr()

const uint8_t * apollo::perception::base::Image8U::cpu_ptr ( int  row = 0) const
inline

在文件 image_8u.h103 行定义.

103 {
104 return blob_->cpu_data() + blob_->offset({row, 0, 0}) + offset_;
105 }

◆ gpu_data()

const uint8_t * apollo::perception::base::Image8U::gpu_data ( ) const
inline

在文件 image_8u.h101 行定义.

101{ return gpu_ptr(0); }
const uint8_t * gpu_ptr(int row=0) const
Definition image_8u.h:107

◆ gpu_ptr()

const uint8_t * apollo::perception::base::Image8U::gpu_ptr ( int  row = 0) const
inline

在文件 image_8u.h107 行定义.

107 {
108 return blob_->gpu_data() + blob_->offset({row, 0, 0}) + offset_;
109 }

◆ mutable_cpu_data()

uint8_t * apollo::perception::base::Image8U::mutable_cpu_data ( )
inline

在文件 image_8u.h95 行定义.

95{ return mutable_cpu_ptr(0); }
uint8_t * mutable_cpu_ptr(int row=0)
Definition image_8u.h:111

◆ mutable_cpu_ptr()

uint8_t * apollo::perception::base::Image8U::mutable_cpu_ptr ( int  row = 0)
inline

在文件 image_8u.h111 行定义.

111 {
112 return blob_->mutable_cpu_data() + blob_->offset({row, 0, 0}) + offset_;
113 }

◆ mutable_gpu_data()

uint8_t * apollo::perception::base::Image8U::mutable_gpu_data ( )
inline

在文件 image_8u.h97 行定义.

97{ return mutable_gpu_ptr(0); }
uint8_t * mutable_gpu_ptr(int row=0)
Definition image_8u.h:115

◆ mutable_gpu_ptr()

uint8_t * apollo::perception::base::Image8U::mutable_gpu_ptr ( int  row = 0)
inline

在文件 image_8u.h115 行定义.

115 {
116 return blob_->mutable_gpu_data() + blob_->offset({row, 0, 0}) + offset_;
117 }

◆ operator()()

Image8U apollo::perception::base::Image8U::operator() ( const Rect< int > &  roi) const
inline

在文件 image_8u.h127 行定义.

127 {
128 int offset = offset_ + blob_->offset({roi.y, roi.x, 0});
129 // return Image8U(roi.height, roi.width, type_, blob_, offset);
130 return Image8U(roi.height, roi.width, type_, blob_, offset);
131 }

◆ operator=()

Image8U & apollo::perception::base::Image8U::operator= ( const Image8U src)
inline

在文件 image_8u.h82 行定义.

82 {
83 this->rows_ = src.rows_;
84 this->cols_ = src.cols_;
85 this->type_ = src.type_;
86 this->channels_ = src.channels_;
87 this->width_step_ = src.width_step_;
88 this->blob_ = src.blob_;
89 this->offset_ = src.offset_;
90 return *this;
91 }

◆ rows()

int apollo::perception::base::Image8U::rows ( ) const
inline

在文件 image_8u.h120 行定义.

120{ return rows_; }

◆ total()

int apollo::perception::base::Image8U::total ( ) const
inline

在文件 image_8u.h125 行定义.

125{ return rows_ * cols_ * channels_; }

◆ type()

Color apollo::perception::base::Image8U::type ( ) const
inline

在文件 image_8u.h119 行定义.

119{ return type_; }

◆ width_step()

int apollo::perception::base::Image8U::width_step ( ) const
inline

在文件 image_8u.h123 行定义.

123{ return width_step_; }

类成员变量说明

◆ blob_

std::shared_ptr<Blob<uint8_t> > apollo::perception::base::Image8U::blob_
protected

在文件 image_8u.h144 行定义.

◆ channels_

int apollo::perception::base::Image8U::channels_
protected

在文件 image_8u.h142 行定义.

◆ cols_

int apollo::perception::base::Image8U::cols_
protected

在文件 image_8u.h140 行定义.

◆ offset_

int apollo::perception::base::Image8U::offset_
protected

在文件 image_8u.h145 行定义.

◆ rows_

int apollo::perception::base::Image8U::rows_
protected

在文件 image_8u.h139 行定义.

◆ type_

Color apollo::perception::base::Image8U::type_
protected

在文件 image_8u.h141 行定义.

◆ width_step_

int apollo::perception::base::Image8U::width_step_
protected

在文件 image_8u.h143 行定义.


该类的文档由以下文件生成: