BRL-CAD
pix.c File Reference
#include "icv.h"
#include "bu/malloc.h"
#include "bu/log.h"
Include dependency graph for pix.c:

Go to the source code of this file.

Functions

double * uchar2double (unsigned char *data, long int size)
 
unsigned char * data2uchar (const icv_image_t *bif)
 
int pix_write (icv_image_t *bif, const char *filename)
 
icv_image_tpix_read (const char *filename, int width, int height)
 

Detailed Description

Contains routines related to pix format.

Definition in file pix.c.

Function Documentation

double* uchar2double ( unsigned char *  data,
long int  size 
)

Referenced by pix_read().

unsigned char* data2uchar ( const icv_image_t bif)

Converts double data of icv_image to unsigned char data. This function also does gamma correction using the gamma_corr parameter of the image structure.

This is mainly used for saving pix, bw and ppm type images. Gamma correction prevents bad color aliasing.

Definition at line 79 of file encoding.c.

Referenced by pix_write().

int pix_write ( icv_image_t bif,
const char *  filename 
)

Definition at line 34 of file pix.c.

References bu_log(), icv_image::color_space, data, data2uchar(), icv_image::height, ICV_COLOR_SPACE_GRAY, ICV_COLOR_SPACE_RGB, icv_gray2rgb(), and icv_image::width.

Referenced by icv_write().

Here is the call graph for this function:

icv_image_t* pix_read ( const char *  filename,
int  width,
int  height 
)

Definition at line 67 of file pix.c.

References BU_ALLOC, bu_free(), bu_log(), bu_malloc(), bu_realloc(), icv_image::channels, icv_image::color_space, data, icv_image::data, icv_image::height, ICV_COLOR_SPACE_RGB, ICV_IMAGE_INIT, ICV_IMAGE_MAGIC, icv_image::magic, uchar2double(), icv_image::width, and OSL::Strings::width.

Referenced by icv_read().

Here is the call graph for this function: