ODataFormats.hGo to the documentation of this file.00001
00002 #ifdef PLATFORM_APERIOS
00003 # include <OPENR/ODataFormats.h>
00004 #else
00005 # ifndef INCLUDED_ODataFormats_h_
00006 # define INCLUDED_ODataFormats_h_
00007
00008 #include <stdlib.h>
00009
00010
00011 struct ODataVectorInfo {
00012 size_t numData;
00013 };
00014
00015 typedef unsigned char byte;
00016 typedef unsigned short word;
00017 typedef unsigned long longword;
00018 typedef word OSoundFormat;
00019 const OSoundFormat osoundformatUNDEF = 0;
00020 const OSoundFormat osoundformatPCM = 1;
00021 const OSoundFormat osoundformatUSB_MIDI = 2;
00022 const OSoundFormat osoundformatSMF = 3;
00023
00024
00025 typedef word OSoundChannel;
00026 const OSoundChannel osoundchannelUNDEF = 0;
00027 const OSoundChannel osoundchannelMONO = 1;
00028 const OSoundChannel osoundchannelSTEREO = 2;
00029
00030
00031 struct OSoundInfo {
00032 typedef int longword;
00033 typedef short word;
00034
00035 longword frameNumber;
00036 size_t frameSize;
00037 size_t dataOffset;
00038 size_t maxDataSize;
00039 size_t dataSize;
00040 OSoundFormat format;
00041 OSoundChannel channel;
00042 word samplingRate;
00043 word bitsPerSample;
00044 size_t actualDataSize;
00045 longword padding[6];
00046 };
00047
00048
00049 struct OSoundVectorData {
00050 ODataVectorInfo vectorInfo;
00051 OSoundInfo info[1];
00052
00053 void SetNumData(size_t ndata) { vectorInfo.numData = ndata; }
00054 OSoundInfo* GetInfo(int index) { return &info[index]; }
00055 byte* GetData(int index) {
00056 return ((byte*)&vectorInfo + info[index].dataOffset);
00057 }
00058 };
00059
00060
00061 struct OFbkImageInfo {
00062 longword frameNumber;
00063 size_t dataOffset;
00064 size_t dataSize;
00065 size_t width;
00066 size_t height;
00067 size_t padding[1];
00068 };
00069
00070
00071 struct OFbkImageVectorData {
00072 ODataVectorInfo vectorInfo;
00073 OFbkImageInfo info[1];
00074
00075 OFbkImageInfo* GetInfo(int index) { return &info[index]; }
00076 byte* GetData(int index) {
00077 return ((byte*)&vectorInfo + info[index].dataOffset);
00078 }
00079 };
00080
00081 typedef int OFbkImageLayer;
00082 const OFbkImageLayer ofbkimageLAYER_H = 0;
00083 const OFbkImageLayer ofbkimageLAYER_M = 1;
00084 const OFbkImageLayer ofbkimageLAYER_L = 2;
00085 const OFbkImageLayer ofbkimageLAYER_C = 3;
00086
00087 const int ocdtNUM_CHANNELS = 8;
00088 typedef longword OCdtChannel;
00089 const OCdtChannel ocdtCHANNEL_UNDEF = 0x00;
00090 const OCdtChannel ocdtCHANNEL0 = 0x01;
00091 const OCdtChannel ocdtCHANNEL1 = 0x02;
00092 const OCdtChannel ocdtCHANNEL2 = 0x04;
00093 const OCdtChannel ocdtCHANNEL3 = 0x08;
00094 const OCdtChannel ocdtCHANNEL4 = 0x10;
00095 const OCdtChannel ocdtCHANNEL5 = 0x20;
00096 const OCdtChannel ocdtCHANNEL6 = 0x40;
00097 const OCdtChannel ocdtCHANNEL7 = 0x80;
00098
00099 const int ocdtMAX_Y_SEGMENT = 32;
00100 const longword ocdtINIT = 0x80808080;
00101 const longword ocdtCr_MAX_MASK = 0x0000ff00;
00102 const longword ocdtCr_MIN_MASK = 0x000000ff;
00103 const longword ocdtCb_MAX_MASK = 0xff000000;
00104 const longword ocdtCb_MIN_MASK = 0x00ff0000;
00105
00106 struct OCdtInfo {
00107 OCdtChannel channel;
00108 longword table[ocdtMAX_Y_SEGMENT];
00109 longword padding;
00110
00111 void Init(OCdtChannel chan) {
00112 channel = chan;
00113 for (int i = 0; i < ocdtMAX_Y_SEGMENT; i++) table[i] = ocdtINIT;
00114 }
00115 void Set(int y_segment,byte cr_max, byte cr_min, byte cb_max, byte cb_min) {
00116 longword crMax = (longword)cr_max;
00117 longword crMin = (longword)cr_min;
00118 longword cbMax = (longword)cb_max;
00119 longword cbMin = (longword)cb_min;
00120 crMax = (crMax << 8) & ocdtCr_MAX_MASK;
00121 crMin = (crMin ) & ocdtCr_MIN_MASK;
00122 cbMax = (cbMax << 24) & ocdtCb_MAX_MASK;
00123 cbMin = (cbMin << 16) & ocdtCb_MIN_MASK;
00124 table[y_segment] = crMax | crMin | cbMax | cbMin;
00125 }
00126 };
00127
00128 struct OCdtVectorData{
00129 ODataVectorInfo vectorInfo;
00130 OCdtInfo info[ocdtNUM_CHANNELS];
00131
00132 void SetNumData(size_t ndata) { vectorInfo.numData = ndata; }
00133 OCdtInfo* GetInfo(int index) { return &info[index]; }
00134 };
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 # endif
00148 #endif
|