19 if (!
ELEM(degrees, 90, 180, 270)) {
23 const int size_x = ibuf->
x;
24 const int size_y = ibuf->
y;
28 float *orig_float_pixels =
static_cast<float *
>(
MEM_dupallocN(float_pixels));
31 std::swap(ibuf->
x, ibuf->
y);
32 for (
int y = 0; y < size_y; y++) {
33 for (
int x = 0; x < size_x; x++) {
34 const float *source_pixel = &orig_float_pixels[(y * size_x +
x) * channels];
35 memcpy(&float_pixels[(y + ((size_x - x - 1) * size_y)) * channels],
37 sizeof(
float) * channels);
41 else if (degrees == 180) {
42 for (
int y = 0; y < size_y; y++) {
43 for (
int x = 0; x < size_x; x++) {
44 const float *source_pixel = &orig_float_pixels[(y * size_x +
x) * channels];
45 memcpy(&float_pixels[(((size_y - y - 1) * size_x) + (size_x - x - 1)) * channels],
47 sizeof(
float) * channels);
51 else if (degrees == 270) {
52 std::swap(ibuf->
x, ibuf->
y);
53 for (
int y = 0; y < size_y; y++) {
54 for (
int x = 0; x < size_x; x++) {
55 const float *source_pixel = &orig_float_pixels[(y * size_x +
x) * channels];
56 memcpy(&float_pixels[((size_y - y - 1) + (x * size_y)) * channels],
58 sizeof(
float) * channels);
71 std::swap(ibuf->
x, ibuf->
y);
72 for (
int y = 0; y < size_y; y++) {
73 for (
int x = 0; x < size_x; x++) {
74 const uchar *source_pixel = &orig_char_pixels[(y * size_x +
x) * 4];
76 &char_pixels[(y + ((size_x - x - 1) * size_y)) * 4], source_pixel,
sizeof(
uchar[4]));
80 else if (degrees == 180) {
81 for (
int y = 0; y < size_y; y++) {
82 for (
int x = 0; x < size_x; x++) {
83 const uchar *source_pixel = &orig_char_pixels[(y * size_x +
x) * 4];
84 memcpy(&char_pixels[(((size_y - y - 1) * size_x) + (size_x - x - 1)) * 4],
90 else if (degrees == 270) {
91 std::swap(ibuf->
x, ibuf->
y);
92 for (
int y = 0; y < size_y; y++) {
93 for (
int x = 0; x < size_x; x++) {
94 const uchar *source_pixel = &orig_char_pixels[(y * size_x +
x) * 4];
96 &char_pixels[((size_y - y - 1) + (x * size_y)) * 4], source_pixel,
sizeof(
uchar[4]));
108 size_t x_size, y_size;
110 if (ibuf ==
nullptr) {
120 const size_t stride = x_size *
sizeof(
int);
123 bottom = top + ((y_size - 1) * x_size);
128 for (; y_size > 0; y_size--) {
129 memcpy(line, top, stride);
130 memcpy(top, bottom, stride);
131 memcpy(bottom, line, stride);
140 float *topf =
nullptr, *bottomf =
nullptr, *linef =
nullptr;
145 const size_t stride = x_size * 4 *
sizeof(
float);
148 bottomf = topf + 4 * ((y_size - 1) * x_size);
149 linef =
static_cast<float *
>(
MEM_mallocN(stride,
"linebuf"));
153 for (; y_size > 0; y_size--) {
154 memcpy(linef, topf, stride);
155 memcpy(topf, bottomf, stride);
156 memcpy(bottomf, linef, stride);
157 bottomf -= 4 * x_size;
167 int x,
y, xr, xl, yi;
170 if (ibuf ==
nullptr) {
179 for (yi = y - 1; yi >= 0; yi--) {
180 const size_t x_offset = size_t(x) * yi;
181 for (xr = x - 1, xl = 0; xr >= xl; xr--, xl++) {
182 std::swap(rect[x_offset + xr], rect[x_offset + xl]);
189 for (yi = y - 1; yi >= 0; yi--) {
190 const size_t x_offset = size_t(x) * yi;
191 for (xr = x - 1, xl = 0; xr >= xl; xr--, xl++) {
192 memcpy(&px_f, &rect_float[(x_offset + xr) * 4],
sizeof(
float[4]));
194 &rect_float[(x_offset + xr) * 4], &rect_float[(x_offset + xl) * 4],
sizeof(
float[4]));
195 memcpy(&rect_float[(x_offset + xl) * 4], &px_f,
sizeof(
float[4]));
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int