bw.c File Reference
#include "bu/log.h"
#include "bu/malloc.h"
#include "icv.h"
Include dependency graph for bw.c:

Go to the source code of this file.


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

Detailed Description

This file contains routines related to bw format.

Definition in file bw.c.

Function Documentation

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

Referenced by bw_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 bw_write().

int bw_write ( icv_image_t bif,
const char *  filename 

Definition at line 35 of file bw.c.

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

Referenced by icv_write().

Here is the call graph for this function:

icv_image_t* bw_read ( const char *  filename,
int  width,
int  height 

Definition at line 74 of file bw.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::gamma_corr, icv_image::height, ICV_COLOR_SPACE_GRAY, 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: