#include <stridemap.h>
Definition at line 41 of file stridemap.h.
◆ StrideMap()
tesseract::StrideMap::StrideMap |
( |
| ) |
|
|
inline |
Definition at line 99 of file stridemap.h.
99 {
100 memset(shape_, 0, sizeof(shape_));
101 memset(t_increments_, 0, sizeof(t_increments_));
102 }
◆ ReduceWidthTo1()
void tesseract::StrideMap::ReduceWidthTo1 |
( |
| ) |
|
Definition at line 153 of file stridemap.cpp.
153 {
154 widths_.assign(widths_.size(), 1);
156 ComputeTIncrements();
157}
◆ ScaleXY()
void tesseract::StrideMap::ScaleXY |
( |
int |
x_factor, |
|
|
int |
y_factor |
|
) |
| |
Definition at line 144 of file stridemap.cpp.
144 {
145 for (int& height : heights_) height /= y_factor;
146 for (int& width : widths_) width /= x_factor;
149 ComputeTIncrements();
150}
◆ SetStride()
void tesseract::StrideMap::SetStride |
( |
const std::vector< std::pair< int, int > > & |
h_w_pairs | ) |
|
Definition at line 126 of file stridemap.cpp.
126 {
127 int max_height = 0;
128 int max_width = 0;
129 for (const std::pair<int, int>& hw : h_w_pairs) {
130 int height = hw.first;
131 int width = hw.second;
132 heights_.push_back(height);
133 widths_.push_back(width);
134 if (height > max_height) max_height = height;
135 if (width > max_width) max_width = width;
136 }
140 ComputeTIncrements();
141}
◆ Size()
Definition at line 114 of file stridemap.h.
114{ return shape_[dimension]; }
◆ TransposeXY()
void tesseract::StrideMap::TransposeXY |
( |
| ) |
|
Definition at line 160 of file stridemap.cpp.
160 {
162 std::swap(heights_, widths_);
163 ComputeTIncrements();
164}
◆ Width()
int tesseract::StrideMap::Width |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: