5#include "testing/testing.h"
21 BLI_rcti_init(&rect, offset, offset + width, offset, offset + height);
38 const int buf_width = 5;
39 const int area_width = 1;
40 const int area_height = 3;
50 for (
int i = 0; i < buf_len; i++) {
58 for (
float *elem : area) {
72 for (
float *elem : area) {
73 for (
int ch = 0; ch < num_channels; ch++) {
74 const int buf_index =
y * buf_width * num_channels +
x * num_channels + ch;
75 EXPECT_NEAR(elem[ch], buf_index, FLT_EPSILON);
89 const int buf_width = 4;
90 const int buf_height = 5;
91 const int area_width = 2;
92 const int area_height = 3;
93 const int num_channels = 4;
95 float buf[num_channels];
97 BufferArea area(buf, buf_width, buf_height, stride);
102 BufferArea area(buf, buf_width, area_rect, stride);
109 const int buf_width = 4;
110 const int area_width = 2;
111 const int area_height = 3;
112 const int buf_height = (area_height + 1);
113 const int num_channels = 4;
114 const int buf_len = buf_height * buf_width * num_channels;
117 BufferArea area(buf, buf_width, buf_height, num_channels);
122 BufferArea area(buf, buf_width, area_rect, num_channels);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
bool BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
constexpr int height() const
constexpr const rcti & get_rect() const
constexpr int width() const
static void test_single_elem_iteration(float *buffer, BufferArea< float > area)
static rcti create_rect(int width, int height)
static void fill_buffer_with_indexes(float *buf, int buf_len)
static void test_full_buffer_iteration(float *buf, int buf_width, int buf_len, int num_channels, BufferArea< float > area)
TEST(BufferArea, BufferConstructor)