Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/buffers.cpp
| Show First 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| bool RenderBuffers::set_pass_rect(PassType type, int components, float *pixels) | |||||
| { | |||||
| if (buffer.data() == NULL) { | |||||
| return false; | |||||
| } | |||||
| int pass_offset = 0; | |||||
| for (size_t j = 0; j < params.passes.size(); j++) { | |||||
| Pass &pass = params.passes[j]; | |||||
| if (pass.type != type) { | |||||
| pass_offset += pass.components; | |||||
| continue; | |||||
| } | |||||
| float *out = buffer.data() + pass_offset; | |||||
| int pass_stride = params.get_passes_size(); | |||||
| int size = params.width * params.height; | |||||
| assert(pass.components == components); | |||||
| for (int i = 0; i < size; i++, out += pass_stride, pixels += components) { | |||||
| for (int j = 0; j < components; j++) { | |||||
| out[j] = pixels[j]; | |||||
| } | |||||
| } | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| /* Display Buffer */ | /* Display Buffer */ | ||||
| DisplayBuffer::DisplayBuffer(Device *device, bool linear) | DisplayBuffer::DisplayBuffer(Device *device, bool linear) | ||||
| : draw_width(0), | : draw_width(0), | ||||
| draw_height(0), | draw_height(0), | ||||
| transparent(true), /* todo: determine from background */ | transparent(true), /* todo: determine from background */ | ||||
| half_float(linear), | half_float(linear), | ||||
| rgba_byte(device, "display buffer byte"), | rgba_byte(device, "display buffer byte"), | ||||
| ▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines | |||||