15 delete[]
image->buffer;
29 (*image)(
y,
x, k) = (
float)
buffer[
a++] / 255.0f;
51 for (
int y = 0,
a = 0;
y <
image.Height();
y++) {
52 for (
int x = 0;
x <
image.Width();
x++) {
53 for (
int k = 0; k <
image.Depth(); k++) {
62 for (
int y = 0,
a = 0;
y <
image.Height();
y++) {
63 for (
int x = 0;
x <
image.Width();
x++) {
64 for (
int k = 0; k <
image.Depth(); k++) {
76 const char* file_name) {
79 FILE* fp = fopen(file_name,
"wb");
86 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
NULL,
NULL,
NULL);
87 info_ptr = png_create_info_struct(png_ptr);
89 if (setjmp(png_jmpbuf(png_ptr))) {
94 png_init_io(png_ptr, fp);
97 if (setjmp(png_jmpbuf(png_ptr))) {
102 png_set_IHDR(png_ptr,
109 PNG_COMPRESSION_TYPE_BASE,
110 PNG_FILTER_TYPE_BASE);
112 png_write_info(png_ptr, info_ptr);
115 if (setjmp(png_jmpbuf(png_ptr))) {
120 png_write_image(png_ptr, row_pointers);
123 if (setjmp(png_jmpbuf(png_ptr))) {
128 png_write_end(png_ptr,
NULL);
139 png_bytep* row_pointers;
141 assert(
image.Depth() == 1);
143 row_pointers =
new png_bytep[
image.Height()];
145 for (
y = 0;
y <
image.Height();
y++) {
146 row_pointers[
y] =
new png_byte[4 *
image.Width()];
148 for (
x = 0;
x <
image.Width();
x++) {
149 if (x0 ==
x &&
image.Height() - y0 - 1 ==
y) {
150 row_pointers[
y][
x * 4 + 0] = 255;
151 row_pointers[
y][
x * 4 + 1] = 0;
152 row_pointers[
y][
x * 4 + 2] = 0;
153 row_pointers[
y][
x * 4 + 3] = 255;
156 row_pointers[
y][
x * 4 + 0] = pixel * 255;
157 row_pointers[
y][
x * 4 + 1] = pixel * 255;
158 row_pointers[
y][
x * 4 + 2] = pixel * 255;
159 row_pointers[
y][
x * 4 + 3] = 255;
164 static int image_counter = 0;
167 file_name,
sizeof(file_name),
"%s_%02d.png", prefix, ++image_counter);
175 for (
y = 0;
y <
image.Height();
y++) {
176 delete[] row_pointers[
y];
178 delete[] row_pointers;
193 double* warped_position_x,
194 double* warped_position_y) {
195 FloatImage libmv_image, libmv_patch, libmv_mask;
202 libmv_mask_for_sample = &libmv_mask;
210 libmv_mask_for_sample,
227 unsigned char* patch,
228 double* warped_position_x,
229 double* warped_position_y) {
237 libmv_mask_for_sample = &libmv_mask;
245 libmv_mask_for_sample,
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
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
3D array (row, column, channel).
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
bool libmv_saveImage(const FloatImage &image, const char *prefix, int x0, int y0)
static bool savePNGImage(png_bytep *row_pointers, int width, int height, int depth, int color_type, const char *file_name)
void libmv_floatBufferToFloatImage(const float *buffer, int width, int height, int channels, FloatImage *image)
void libmv_samplePlanarPatchFloat(const float *image, int width, int height, int channels, const double *xs, const double *ys, int num_samples_x, int num_samples_y, const float *mask, float *patch, double *warped_position_x, double *warped_position_y)
void libmv_samplePlanarPatchByte(const unsigned char *image, int width, int height, int channels, const double *xs, const double *ys, int num_samples_x, int num_samples_y, const float *mask, unsigned char *patch, double *warped_position_x, double *warped_position_y)
void libmv_floatImageToFloatBuffer(const FloatImage &image, float *buffer)
void libmv_floatImageDestroy(libmv_FloatImage *image)
void libmv_floatImageToByteBuffer(const libmv::FloatImage &image, unsigned char *buffer)
void libmv_byteBufferToFloatImage(const unsigned char *buffer, int width, int height, int channels, FloatImage *image)
ccl_global float * buffer
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
bool SamplePlanarPatch(const FloatImage &image, const double *xs, const double *ys, int num_samples_x, int num_samples_y, FloatImage *mask, FloatImage *patch, double *warped_position_x, double *warped_position_y)