18 const int tile_number,
19 const bool is_preview_render)
22 tile_number(tile_number),
25 free_cache(!is_preview_render && !b_image.has_data())
31 if (
b_image.source() != BL::Image::source_TILED) {
35 assert(
b_image.source() != BL::Image::source_SEQUENCE);
46 metadata.
width = b_udim_tile.size()[0];
47 metadata.
height = b_udim_tile.size()[1];
48 metadata.
channels = b_udim_tile.channels();
96 const size_t out_pixels_size,
97 const bool associate_alpha)
108 memcpy(out_pixels, in_pixels, out_pixels_size *
sizeof(
float));
113 memset(out_pixels, 0,
num_pixels *
sizeof(
float));
116 const size_t num_pixels_safe = out_pixels_size /
channels;
117 float *out_pixel = (
float *)out_pixels;
118 for (
int i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
141 const uchar *in_pixel = in_pixels;
142 half *out_pixel = (
half *)out_pixels;
143 if (associate_alpha &&
channels == 4) {
144 for (
size_t i = 0; i <
num_pixels; i++, in_pixel += 4, out_pixel += 4) {
154 for (
int c = 0;
c <
channels;
c++, in_pixel++, out_pixel++) {
166 const size_t num_pixels_safe = out_pixels_size /
channels;
167 half *out_pixel = (
half *)out_pixels;
168 for (
int i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
189 memcpy(out_pixels, in_pixels, out_pixels_size *
sizeof(
unsigned char));
191 if (associate_alpha &&
channels == 4) {
193 unsigned char *out_pixel = (
unsigned char *)out_pixels;
194 for (
size_t i = 0; i <
num_pixels; i++, out_pixel += 4) {
195 out_pixel[0] = (out_pixel[0] * out_pixel[3]) / 255;
196 out_pixel[1] = (out_pixel[1] * out_pixel[3]) / 255;
197 out_pixel[2] = (out_pixel[2] * out_pixel[3]) / 255;
204 memset(out_pixels, 0, out_pixels_size *
sizeof(
unsigned char));
207 const size_t num_pixels_safe = out_pixels_size /
channels;
208 unsigned char *out_pixel = (
unsigned char *)out_pixels;
209 for (
size_t i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
253 BL::ShaderNodeTexPointDensity b_node)
254 : b_depsgraph(b_depsgraph), b_node(b_node)
295 return BL::ShaderNodeTexPointDensity(
b_node).name();
struct Depsgraph Depsgraph
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
bool load_metadata(const ImageDeviceFeatures &features, ImageMetaData &metadata) override
bool load_pixels(const ImageMetaData &metadata, void *pixels, const size_t pixels_size, const bool associate_alpha) override
BlenderImageLoader(BL::Image b_image, const int frame, const int tile_number, const bool is_preview_render)
bool equals(const ImageLoader &other) const override
int get_tile_number() const override
string name() const override
bool equals(const ImageLoader &other) const override
BL::ShaderNodeTexPointDensity b_node
BlenderPointDensityLoader(BL::Depsgraph depsgraph, BL::ShaderNodeTexPointDensity b_node)
string name() const override
BL::Depsgraph b_depsgraph
bool load_metadata(const ImageDeviceFeatures &features, ImageMetaData &metadata) override
bool load_pixels(const ImageMetaData &metadata, void *pixels, const size_t pixels_size, const bool associate_alpha) override
void builtin_images_load()
void device_load_builtin(Device *device, Scene *scene, Progress &progress)
#define CCL_NAMESPACE_END
static unsigned char * image_get_pixels_for_frame(BL::Image &image, int frame, int tile)
static string get_enum_identifier(PointerRNA &ptr, const char *name)
static float * image_get_float_pixels_for_frame(BL::Image &image, int frame, int tile)
float util_image_cast_to_float(T value)
ccl_device_inline half float_to_half_image(float f)
ccl_gpu_kernel_postfix ccl_global float int num_pixels
void(* MEM_freeN)(void *vmemh)
T length(const vec_base< T, Size > &a)
static void free_cache(bNodeTree *ntree)
ImageManager * image_manager