00001 #ifndef __RAW_H__
00002 #define __RAW_H__
00003
00004
00005
00006
00007
00008
00009 #include <stdlib.h>
00010 #include <stdio.h>
00011 #include <assert.h>
00012
00013 #ifdef __cplusplus
00014 extern "C"{
00015 #endif
00016
00017 typedef enum
00018 {
00019 RAW_NO_ERROR,
00020 RAW_ERROR_FILE_OPEN,
00021 RAW_ERROR_FILE_READ,
00022 RAW_ERROR_FILE_WRITE,
00023 RAW_ERROR_FILE_SEEK,
00024 RAW_ERROR_OUT_OF_MEMORY
00025 }
00026 RAW_ERROR_CODE;
00027
00028
00029 typedef enum
00030 {
00031 RAW_UNSUPPORTED,
00032 RAW_RGB24,
00033 RAW_RGBA32,
00034 RAW_BGR24,
00035 RAW_BGRA32,
00036 RAW_GRAYSCALE8,
00037 RAW_GRAYSCALE16,
00038 RAW_GRAYSCALE16PACK12
00039 }
00040 RAW_TYPE;
00041
00042
00043 enum{ RAW_LITTLE_ENDIAN, RAW_BIG_ENDIAN };
00044
00045
00046 RAW_ERROR_CODE ReadRawFile
00047 (
00048 const char *const fileName,
00049 void *const header,
00050 const unsigned headerSize,
00051 const RAW_TYPE type,
00052 const unsigned width,
00053 const unsigned height,
00054 const unsigned length,
00055 const int endian,
00056 void **pixels
00057
00058
00059 );
00060
00061
00062 RAW_ERROR_CODE WriteRawFile
00063 (
00064 const char *const fileName,
00065 const void *const header,
00066 const unsigned headerSize,
00067 const RAW_TYPE type,
00068 const unsigned width,
00069 const unsigned height,
00070 const unsigned length,
00071 const void *const pixels
00072
00073 );
00074
00075
00076 RAW_ERROR_CODE ReadRawFileAt
00077 (
00078 const char *const fileName,
00079 const unsigned headerSize,
00080 const RAW_TYPE type,
00081 const unsigned width,
00082 const unsigned height,
00083 const unsigned length,
00084 const unsigned z,
00085 const int endian,
00086 void **pixels
00087 );
00088
00089
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093
00094 #endif
00095