mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 00:07:13 +02:00
prefixed members rows and cols with m_ to avoid -Wshadow
This commit is contained in:
@ -3,20 +3,19 @@
|
||||
|
||||
template <typename DataType>
|
||||
Frame<DataType>::Frame(std::byte* bytes, ssize_t rows, ssize_t cols):
|
||||
rows(rows), cols(cols) {
|
||||
data = new DataType[rows*cols];
|
||||
std::memcpy(data, bytes, rows*cols*sizeof(DataType));
|
||||
m_rows(rows), m_cols(cols) {
|
||||
m_data = new DataType[rows*cols];
|
||||
std::memcpy(m_data, bytes, m_rows*m_cols*sizeof(DataType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename DataType>
|
||||
DataType Frame<DataType>::get(int row, int col) {
|
||||
if (row < 0 || row >= rows || col < 0 || col >= cols) {
|
||||
if (row < 0 || row >= m_rows || col < 0 || col >= m_cols) {
|
||||
std::cerr << "Invalid row or column index" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
return data[row*cols + col];
|
||||
return m_data[row*m_cols + col];
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user