Blender V2.61 - r43446
|
#include "cineonlib.h"
#include "cineonfile.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <string.h>
#include "BLI_utildefines.h"
#include "cin_debug_stuff.h"
#include "logmemfile.h"
Go to the source code of this file.
Functions | |
static void | fillCineonFileInfo (CineonFile *cineon, CineonFileInformation *fileInfo, const char *filename) |
static void | dumpCineonFileInfo (CineonFileInformation *fileInfo) |
static void | fillCineonChannelInfo (CineonFile *cineon, CineonChannelInformation *chan, int des) |
static void | dumpCineonChannelInfo (CineonChannelInformation *chan) |
static void | fillCineonImageInfo (CineonFile *cineon, CineonImageInformation *imageInfo) |
static void | dumpCineonImageInfo (CineonImageInformation *imageInfo) |
static void | fillCineonFormatInfo (CineonFile *cineon, CineonFormatInformation *formatInfo) |
static void | dumpCineonFormatInfo (CineonFormatInformation *formatInfo) |
static void | fillCineonOriginationInfo (CineonFile *cineon, CineonOriginationInformation *originInfo, CineonFileInformation *fileInfo) |
static void | dumpCineonOriginationInfo (CineonOriginationInformation *originInfo) |
static int | initCineonGenericHeader (CineonFile *cineon, CineonGenericHeader *header, const char *imagename) |
static void UNUSED_FUNCTION() | dumpCineonGenericHeader (CineonGenericHeader *header) |
void | cineonSetVerbose (int verbosity) |
static void | verboseMe (CineonFile *cineon) |
int | cineonGetRowBytes (CineonFile *cineon, unsigned short *row, int y) |
int | cineonSetRowBytes (CineonFile *cineon, const unsigned short *row, int y) |
int | cineonGetRow (CineonFile *cineon, unsigned short *row, int y) |
int | cineonSetRow (CineonFile *cineon, const unsigned short *row, int y) |
CineonFile * | cineonOpen (const char *filename) |
int | cineonIsMemFileCineon (unsigned char *mem) |
CineonFile * | cineonOpenFromMem (unsigned char *mem, unsigned int size) |
int | cineonGetSize (const CineonFile *cineon, int *width, int *height, int *depth) |
CineonFile * | cineonCreate (const char *filename, int width, int height, int depth) |
void | cineonClose (CineonFile *cineon) |
Variables | |
static int | verbose = 0 |
Definition in file cineonlib.c.
void cineonClose | ( | CineonFile * | cineon | ) |
Definition at line 791 of file cineonlib.c.
References _Log_Image_File_t_::file, addon::engine::free(), _Log_Image_File_t_::lineBuffer, and _Log_Image_File_t_::pixelBuffer.
Referenced by cineonCreate(), cineonOpen(), and cineonOpenFromMem().
CineonFile* cineonCreate | ( | const char * | filename, |
int | width, | ||
int | height, | ||
int | depth | ||
) |
Definition at line 708 of file cineonlib.c.
References _Log_Image_File_t_::bitsPerPixel, cineonClose(), cineonSetRowBytes(), _Log_Image_File_t_::close, d_printf, _Log_Image_File_t_::depth, _Log_Image_File_t_::file, _Log_Image_File_t_::fileYPos, _Log_Image_File_t_::getRow, _Log_Image_File_t_::height, _Log_Image_File_t_::imageOffset, initCineonGenericHeader(), _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, logImageGetByteConversionDefaults(), _Log_Image_File_t_::params, _Log_Image_File_t_::pixelBuffer, _Log_Image_File_t_::pixelBufferUsed, pixelsToLongs(), _Log_Image_File_t_::reading, _Log_Image_File_t_::setRow, setupLut(), verbose, and _Log_Image_File_t_::width.
Referenced by logImageCreate().
int cineonGetRow | ( | CineonFile * | cineon, |
unsigned short * | row, | ||
int | y | ||
) |
Definition at line 422 of file cineonlib.c.
References d_printf, _Log_Image_File_t_::fileYPos, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, logimage_fread(), logimage_fseek(), and verbose.
int cineonGetRowBytes | ( | CineonFile * | cineon, |
unsigned short * | row, | ||
int | y | ||
) |
Definition at line 317 of file cineonlib.c.
References d_printf, _Log_Image_File_t_::depth, LogImageByteConversionParameters::doLogarithm, _Log_Image_File_t_::fileYPos, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, logimage_fread(), logimage_fseek(), _Log_Image_File_t_::lut10_16, _Log_Image_File_t_::params, _Log_Image_File_t_::pixelBuffer, verbose, and _Log_Image_File_t_::width.
Referenced by cineonOpen(), and cineonOpenFromMem().
int cineonGetSize | ( | const CineonFile * | cineon, |
int * | width, | ||
int * | height, | ||
int * | depth | ||
) |
Definition at line 700 of file cineonlib.c.
References _Log_Image_File_t_::depth, _Log_Image_File_t_::height, and _Log_Image_File_t_::width.
int cineonIsMemFileCineon | ( | unsigned char * | mem | ) |
Definition at line 598 of file cineonlib.c.
References CINEON_FILE_MAGIC.
Referenced by imb_is_cineon().
CineonFile* cineonOpen | ( | const char * | filename | ) |
Definition at line 507 of file cineonlib.c.
References CineonChannelInformation::bits_per_pixel, _Log_Image_File_t_::bitsPerPixel, CineonImageInformation::channel, CineonImageInformation::channels_per_image, CINEON_FILE_MAGIC, cineonClose(), cineonGetRowBytes(), _Log_Image_File_t_::close, d_printf, _Log_Image_File_t_::depth, _Log_Image_File_t_::file, CineonGenericHeader::fileInfo, _Log_Image_File_t_::fileYPos, CineonGenericHeader::formatInfo, _Log_Image_File_t_::getRow, _Log_Image_File_t_::height, CineonFileInformation::image_offset, CineonGenericHeader::imageInfo, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, CineonChannelInformation::lines_per_image, logimage_fread(), logimage_fseek(), logImageGetByteConversionDefaults(), CineonFileInformation::magic_num, _Log_Image_File_t_::membuffer, _Log_Image_File_t_::membuffersize, _Log_Image_File_t_::memcursor, CineonFormatInformation::packing, _Log_Image_File_t_::params, _Log_Image_File_t_::pixelBuffer, _Log_Image_File_t_::pixelBufferUsed, CineonChannelInformation::pixels_per_line, pixelsToLongs(), _Log_Image_File_t_::reading, _Log_Image_File_t_::setRow, setupLut(), verbose, verboseMe(), and _Log_Image_File_t_::width.
Referenced by logImageOpen().
CineonFile* cineonOpenFromMem | ( | unsigned char * | mem, |
unsigned int | size | ||
) |
Definition at line 609 of file cineonlib.c.
References CineonChannelInformation::bits_per_pixel, _Log_Image_File_t_::bitsPerPixel, CineonImageInformation::channel, CineonImageInformation::channels_per_image, CINEON_FILE_MAGIC, cineonClose(), cineonGetRowBytes(), _Log_Image_File_t_::close, d_printf, _Log_Image_File_t_::depth, _Log_Image_File_t_::file, CineonGenericHeader::fileInfo, _Log_Image_File_t_::fileYPos, CineonGenericHeader::formatInfo, _Log_Image_File_t_::getRow, _Log_Image_File_t_::height, CineonFileInformation::image_offset, CineonGenericHeader::imageInfo, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, CineonChannelInformation::lines_per_image, logimage_fread(), logimage_fseek(), logImageGetByteConversionDefaults(), CineonFileInformation::magic_num, _Log_Image_File_t_::membuffer, _Log_Image_File_t_::membuffersize, _Log_Image_File_t_::memcursor, CineonFormatInformation::packing, _Log_Image_File_t_::params, _Log_Image_File_t_::pixelBuffer, _Log_Image_File_t_::pixelBufferUsed, CineonChannelInformation::pixels_per_line, pixelsToLongs(), _Log_Image_File_t_::reading, _Log_Image_File_t_::setRow, setupLut(), size(), verbose, verboseMe(), and _Log_Image_File_t_::width.
Referenced by logImageOpenFromMem().
int cineonSetRow | ( | CineonFile * | cineon, |
const unsigned short * | row, | ||
int | y | ||
) |
Definition at line 466 of file cineonlib.c.
References d_printf, _Log_Image_File_t_::file, _Log_Image_File_t_::fileYPos, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, logimage_fseek(), and verbose.
int cineonSetRowBytes | ( | CineonFile * | cineon, |
const unsigned short * | row, | ||
int | y | ||
) |
Definition at line 373 of file cineonlib.c.
References d_printf, _Log_Image_File_t_::depth, LogImageByteConversionParameters::doLogarithm, _Log_Image_File_t_::file, _Log_Image_File_t_::fileYPos, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBuffer, _Log_Image_File_t_::lineBufferLength, logimage_fseek(), _Log_Image_File_t_::lut16_16, _Log_Image_File_t_::params, _Log_Image_File_t_::pixelBuffer, verbose, and _Log_Image_File_t_::width.
Referenced by cineonCreate().
void cineonSetVerbose | ( | int | verbosity | ) |
static void dumpCineonChannelInfo | ( | CineonChannelInformation * | chan | ) | [static] |
Definition at line 103 of file cineonlib.c.
References CineonChannelInformation::bits_per_pixel, d_printf, CineonChannelInformation::designator1, CineonChannelInformation::designator2, CineonChannelInformation::lines_per_image, ntohf(), CineonChannelInformation::pixels_per_line, CineonChannelInformation::ref_high_data, CineonChannelInformation::ref_high_quantity, CineonChannelInformation::ref_low_data, and CineonChannelInformation::ref_low_quantity.
Referenced by dumpCineonImageInfo().
static void dumpCineonFileInfo | ( | CineonFileInformation * | fileInfo | ) | [static] |
Definition at line 74 of file cineonlib.c.
References CineonFileInformation::create_date, CineonFileInformation::create_time, d_printf, CineonFileInformation::file_name, CineonFileInformation::file_size, CineonFileInformation::gen_hdr_size, CineonFileInformation::image_offset, CineonFileInformation::ind_hdr_size, CineonFileInformation::magic_num, CineonFileInformation::user_data_size, and CineonFileInformation::vers.
Referenced by dumpCineonGenericHeader().
static void dumpCineonFormatInfo | ( | CineonFormatInformation * | formatInfo | ) | [static] |
Definition at line 205 of file cineonlib.c.
References CineonFormatInformation::channel_padding, d_printf, CineonFormatInformation::interleave, CineonFormatInformation::line_padding, CineonFormatInformation::packing, and CineonFormatInformation::signage.
Referenced by dumpCineonGenericHeader().
static void UNUSED_FUNCTION() dumpCineonGenericHeader | ( | CineonGenericHeader * | header | ) | [static] |
Definition at line 294 of file cineonlib.c.
References dumpCineonFileInfo(), dumpCineonFormatInfo(), dumpCineonImageInfo(), and dumpCineonOriginationInfo().
static void dumpCineonImageInfo | ( | CineonImageInformation * | imageInfo | ) | [static] |
Definition at line 158 of file cineonlib.c.
References CineonImageInformation::blue_primary_x, CineonImageInformation::blue_primary_y, CineonImageInformation::channel, CineonImageInformation::channels_per_image, d_printf, dumpCineonChannelInfo(), CineonImageInformation::green_primary_x, CineonImageInformation::green_primary_y, i, CineonImageInformation::label, ntohf(), CineonImageInformation::orientation, CineonImageInformation::red_primary_x, CineonImageInformation::red_primary_y, CineonImageInformation::white_point_x, and CineonImageInformation::white_point_y.
Referenced by dumpCineonGenericHeader().
static void dumpCineonOriginationInfo | ( | CineonOriginationInformation * | originInfo | ) | [static] |
Definition at line 267 of file cineonlib.c.
References CineonOriginationInformation::create_date, CineonOriginationInformation::create_time, d_printf, CineonOriginationInformation::file_name, CineonOriginationInformation::input_device, CineonOriginationInformation::input_device_gamma, CineonOriginationInformation::model_number, ntohf(), CineonOriginationInformation::serial_number, CineonOriginationInformation::x_input_samples_per_mm, CineonOriginationInformation::x_offset, CineonOriginationInformation::y_input_samples_per_mm, and CineonOriginationInformation::y_offset.
Referenced by dumpCineonGenericHeader().
static void fillCineonChannelInfo | ( | CineonFile * | cineon, |
CineonChannelInformation * | chan, | ||
int | des | ||
) | [static] |
Definition at line 89 of file cineonlib.c.
References CineonChannelInformation::bits_per_pixel, CineonChannelInformation::designator1, CineonChannelInformation::designator2, _Log_Image_File_t_::height, htonf(), CineonChannelInformation::lines_per_image, CineonChannelInformation::pixels_per_line, CineonChannelInformation::ref_high_data, CineonChannelInformation::ref_high_quantity, CineonChannelInformation::ref_low_data, CineonChannelInformation::ref_low_quantity, and _Log_Image_File_t_::width.
Referenced by fillCineonImageInfo().
static void fillCineonFileInfo | ( | CineonFile * | cineon, |
CineonFileInformation * | fileInfo, | ||
const char * | filename | ||
) | [static] |
Definition at line 46 of file cineonlib.c.
References CINEON_FILE_MAGIC, CineonFileInformation::create_date, CineonFileInformation::create_time, CineonFileInformation::file_name, CineonFileInformation::file_size, CineonFileInformation::gen_hdr_size, _Log_Image_File_t_::height, CineonFileInformation::image_offset, _Log_Image_File_t_::imageOffset, CineonFileInformation::ind_hdr_size, _Log_Image_File_t_::lineBufferLength, CineonFileInformation::magic_num, CineonFileInformation::user_data_size, and CineonFileInformation::vers.
Referenced by initCineonGenericHeader().
static void fillCineonFormatInfo | ( | CineonFile * | cineon, |
CineonFormatInformation * | formatInfo | ||
) | [static] |
Definition at line 192 of file cineonlib.c.
References CineonFormatInformation::channel_padding, CineonFormatInformation::interleave, CineonFormatInformation::line_padding, CineonFormatInformation::packing, CineonFormatInformation::sense, and CineonFormatInformation::signage.
Referenced by initCineonGenericHeader().
static void fillCineonImageInfo | ( | CineonFile * | cineon, |
CineonImageInformation * | imageInfo | ||
) | [static] |
Definition at line 130 of file cineonlib.c.
References CineonImageInformation::blue_primary_x, CineonImageInformation::blue_primary_y, CineonImageInformation::channel, CineonImageInformation::channels_per_image, _Log_Image_File_t_::depth, fillCineonChannelInfo(), CineonImageInformation::green_primary_x, CineonImageInformation::green_primary_y, htonf(), CineonImageInformation::label, CineonImageInformation::orientation, CineonImageInformation::red_primary_x, CineonImageInformation::red_primary_y, undefined(), CineonImageInformation::white_point_x, and CineonImageInformation::white_point_y.
Referenced by initCineonGenericHeader().
static void fillCineonOriginationInfo | ( | CineonFile * | cineon, |
CineonOriginationInformation * | originInfo, | ||
CineonFileInformation * | fileInfo | ||
) | [static] |
Definition at line 247 of file cineonlib.c.
References CineonFileInformation::create_date, CineonOriginationInformation::create_date, CineonFileInformation::create_time, CineonOriginationInformation::create_time, CineonFileInformation::file_name, CineonOriginationInformation::file_name, htonf(), CineonOriginationInformation::input_device, CineonOriginationInformation::input_device_gamma, CineonOriginationInformation::model_number, CineonOriginationInformation::serial_number, undefined(), CineonOriginationInformation::x_input_samples_per_mm, CineonOriginationInformation::x_offset, CineonOriginationInformation::y_input_samples_per_mm, and CineonOriginationInformation::y_offset.
Referenced by initCineonGenericHeader().
static int initCineonGenericHeader | ( | CineonFile * | cineon, |
CineonGenericHeader * | header, | ||
const char * | imagename | ||
) | [static] |
Definition at line 283 of file cineonlib.c.
References CineonGenericHeader::fileInfo, fillCineonFileInfo(), fillCineonFormatInfo(), fillCineonImageInfo(), fillCineonOriginationInfo(), CineonGenericHeader::formatInfo, CineonGenericHeader::imageInfo, and CineonGenericHeader::originInfo.
Referenced by cineonCreate().
static void verboseMe | ( | CineonFile * | cineon | ) | [static] |
Definition at line 308 of file cineonlib.c.
References d_printf, _Log_Image_File_t_::depth, _Log_Image_File_t_::height, _Log_Image_File_t_::imageOffset, _Log_Image_File_t_::lineBufferLength, and _Log_Image_File_t_::width.
Referenced by cineonOpen(), and cineonOpenFromMem().
int verbose = 0 [static] |
Definition at line 301 of file cineonlib.c.
Referenced by cineonCreate(), cineonGetRow(), cineonGetRowBytes(), cineonOpen(), cineonOpenFromMem(), cineonSetRow(), cineonSetRowBytes(), cineonSetVerbose(), and main().