Closed dodoma closed 8 years ago
hi, liuliu
#define ccv_get_dense_matrix_cell_by(type, x, row, col, ch) \ (((type) & CCV_32S) ? (void*)((x)->data.i32 + ((row) * (x)->cols + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_32F) ? (void*)((x)->data.f32+ ((row) * (x)->cols + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_64S) ? (void*)((x)->data.i64+ ((row) * (x)->cols + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_64F) ? (void*)((x)->data.f64 + ((row) * (x)->cols + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (void*)((x)->data.u8 + (row) * (x)->step + (col) * CCV_GET_CHANNEL(type) + (ch))))))
should be this ?
#define ccv_get_dense_matrix_cell_by(type, x, row, col, ch) \ (((type) & CCV_32S) ? (void*)((x)->data.i32 + ((row) * (x)->step + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_32F) ? (void*)((x)->data.f32+ ((row) * (x)->step + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_64S) ? (void*)((x)->data.i64+ ((row) * (x)->step + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (((type) & CCV_64F) ? (void*)((x)->data.f64 + ((row) * (x)->step + (col)) * CCV_GET_CHANNEL(type) + (ch)) : \ (void*)((x)->data.u8 + (row) * (x)->step + (col) * CCV_GET_CHANNEL(type) + (ch))))))
E.g.
consider a 3 channel 32F matrix, with 100 rows, 200 cols, There should be 200 * 3 * 4 bytes per row, not 200 * 4 bytes.
The original code is correct. i32 and f32 are (int) or (float) type, therefore, it is not counting by bytes.
hi, liuliu
should be this ?
E.g.
consider a 3 channel 32F matrix, with 100 rows, 200 cols, There should be 200 * 3 * 4 bytes per row, not 200 * 4 bytes.