20 const bool is_preview_render)
32 if (
b_image.source() != BL::Image::source_TILED) {
36 assert(
b_image.source() != BL::Image::source_SEQUENCE);
47 metadata.
width = b_udim_tile.size()[0];
48 metadata.
height = b_udim_tile.size()[1];
49 metadata.
channels = b_udim_tile.channels();
97 const size_t out_pixels_size,
98 const bool associate_alpha)
100 const size_t num_pixels = ((size_t)metadata.
width) * metadata.
height;
107 if (in_pixels && num_pixels *
channels == out_pixels_size) {
109 memcpy(out_pixels, in_pixels, out_pixels_size *
sizeof(
float));
114 memset(out_pixels, 0, num_pixels *
sizeof(
float));
117 const size_t num_pixels_safe = out_pixels_size /
channels;
118 float *out_pixel = (
float *)out_pixels;
119 for (
int i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
140 if (in_pixels && num_pixels *
channels == out_pixels_size) {
142 const uchar *in_pixel = in_pixels;
143 half *out_pixel = (
half *)out_pixels;
144 if (associate_alpha &&
channels == 4) {
145 for (
size_t i = 0; i < num_pixels; i++, in_pixel += 4, out_pixel += 4) {
154 for (
size_t i = 0; i < num_pixels; i++) {
155 for (
int c = 0; c <
channels; c++, in_pixel++, out_pixel++) {
164 memset(out_pixels, 0, num_pixels *
sizeof(
half));
167 const size_t num_pixels_safe = out_pixels_size /
channels;
168 half *out_pixel = (
half *)out_pixels;
169 for (
int i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
188 if (in_pixels && num_pixels *
channels == out_pixels_size) {
190 memcpy(out_pixels, in_pixels, out_pixels_size *
sizeof(
unsigned char));
192 if (associate_alpha &&
channels == 4) {
194 unsigned char *out_pixel = (
unsigned char *)out_pixels;
195 for (
size_t i = 0; i < num_pixels; i++, out_pixel += 4) {
196 out_pixel[0] = (out_pixel[0] * out_pixel[3]) / 255;
197 out_pixel[1] = (out_pixel[1] * out_pixel[3]) / 255;
198 out_pixel[2] = (out_pixel[2] * out_pixel[3]) / 255;
205 memset(out_pixels, 0, out_pixels_size *
sizeof(
unsigned char));
208 const size_t num_pixels_safe = out_pixels_size /
channels;
209 unsigned char *out_pixel = (
unsigned char *)out_pixels;
210 for (
size_t i = 0; i < num_pixels_safe; i++, out_pixel +=
channels) {
236 return BL::Image(
b_image).name();
254 BL::ShaderNodeTexPointDensity
b_node)
296 return BL::ShaderNodeTexPointDensity(
b_node).name();
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 Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves 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 Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
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)
static float * image_get_float_pixels_for_frame(BL::Image &image, int frame, int tile)
static string get_enum_identifier(PointerRNA &ptr, const char *name)
static unsigned char * image_get_pixels_for_frame(BL::Image &image, int frame, int tile)
float util_image_cast_to_float(T value)
#define CCL_NAMESPACE_END
ccl_device_inline half float_to_half_image(float f)
void MEM_freeN(void *vmemh)