comparison pidgin/plugins/crazychat/camdata.c @ 31534:a8cc50c2279f

Remove trailing whitespace
author Richard Laager <rlaager@wiktel.com>
date Tue, 04 Jan 2011 06:55:30 +0000
parents 5fe8042783c1
children
comparison
equal deleted inserted replaced
31533:44f53d3fc54f 31534:a8cc50c2279f
21 21
22 mungDataPtr myMungData = NULL; 22 mungDataPtr myMungData = NULL;
23 long mWorlds[20]; 23 long mWorlds[20];
24 UInt32 mRedCount[256], mGreenCound[256], mBlueCount[256]; 24 UInt32 mRedCount[256], mGreenCound[256], mBlueCount[256];
25 25
26 static void DecompressSequencePreflight(GWorldPtr srcGWorld, 26 static void DecompressSequencePreflight(GWorldPtr srcGWorld,
27 ImageSequence *imageSeq, 27 ImageSequence *imageSeq,
28 GWorldPtr destGWorld, 28 GWorldPtr destGWorld,
29 Rect *srcRect); 29 Rect *srcRect);
30 //static void DrawRGBHistogram(mungDataRecord *theMungData); 30 //static void DrawRGBHistogram(mungDataRecord *theMungData);
31 //static void CreateEffectDescription(mungDataRecord *theMungData); 31 //static void CreateEffectDescription(mungDataRecord *theMungData);
36 36
37 37
38 OSErr InitializeMungData(Rect bounds) 38 OSErr InitializeMungData(Rect bounds)
39 { 39 {
40 OSErr err = noErr; 40 OSErr err = noErr;
41 41
42 if(myMungData) 42 if(myMungData)
43 { 43 {
44 DisposeMungData(); 44 DisposeMungData();
45 } 45 }
46 46
47 myMungData = (mungDataPtr)NewPtrClear(sizeof(mungDataRecord)); 47 myMungData = (mungDataPtr)NewPtrClear(sizeof(mungDataRecord));
48 if (myMungData == nil) 48 if (myMungData == nil)
49 { 49 {
50 err = MemError(); 50 err = MemError();
51 goto bail; 51 goto bail;
52 } 52 }
53 53
54 myMungData->effect = 0; // always 54 myMungData->effect = 0; // always
55 55
56 56
57 BailErr(QTNewGWorld(&(myMungData->gw),bitdepth,&bounds,0,0,0)); 57 BailErr(QTNewGWorld(&(myMungData->gw),bitdepth,&bounds,0,0,0));
58 LockPixels(GetGWorldPixMap(myMungData->gw)); 58 LockPixels(GetGWorldPixMap(myMungData->gw));
59 59
60 SetMungDataColorDefaults(); 60 SetMungDataColorDefaults();
61 61
62 62
63 63
64 myMungData->selectedIndex = 0; 64 myMungData->selectedIndex = 0;
65 myMungData->overlay = NULL; 65 myMungData->overlay = NULL;
66 66
67 SetCurrentClamp(-1); 67 SetCurrentClamp(-1);
68 68
69 69
70 70
71 myMungData->bounds = bounds; 71 myMungData->bounds = bounds;
72 72
73 SetRect(&bounds, 0, 0, 256*2+4, 128*3 + 20); 73 SetRect(&bounds, 0, 0, 256*2+4, 128*3 + 20);
74 BailErr(QTNewGWorld(&(myMungData->histoWorld),bitdepth,&bounds,0,0,0)); 74 BailErr(QTNewGWorld(&(myMungData->histoWorld),bitdepth,&bounds,0,0,0));
75 LockPixels(GetGWorldPixMap(myMungData->histoWorld)); 75 LockPixels(GetGWorldPixMap(myMungData->histoWorld));
79 } 79 }
80 80
81 OSErr DisposeMungData(void) 81 OSErr DisposeMungData(void)
82 { // check this out 82 { // check this out
83 OSErr err = noErr; 83 OSErr err = noErr;
84 84
85 if(myMungData) 85 if(myMungData)
86 { 86 {
87 //if(myMungData->drawSeq) 87 //if(myMungData->drawSeq)
88 //{ 88 //{
89 // CDSequenceEnd(myMungData->drawSeq); 89 // CDSequenceEnd(myMungData->drawSeq);
90 //} 90 //}
91 91
92 if(myMungData->gw) 92 if(myMungData->gw)
93 { 93 {
94 DisposeGWorld(myMungData->gw); 94 DisposeGWorld(myMungData->gw);
95 myMungData->gw = nil; 95 myMungData->gw = nil;
96 } 96 }
97 97
98 if(myMungData->overlay) 98 if(myMungData->overlay)
99 { 99 {
100 DisposeGWorld(myMungData->overlay); 100 DisposeGWorld(myMungData->overlay);
101 myMungData->overlay = nil; 101 myMungData->overlay = nil;
102 } 102 }
103 103
104 if(myMungData->histoWorld) 104 if(myMungData->histoWorld)
105 { 105 {
106 DisposeGWorld(myMungData->histoWorld); 106 DisposeGWorld(myMungData->histoWorld);
107 myMungData->histoWorld = nil; 107 myMungData->histoWorld = nil;
108 } 108 }
109 109
110 if (myMungData->effectTimeBase) 110 if (myMungData->effectTimeBase)
111 { 111 {
112 DisposeTimeBase(myMungData->effectTimeBase); 112 DisposeTimeBase(myMungData->effectTimeBase);
113 } 113 }
114 if (myMungData->effectParams) 114 if (myMungData->effectParams)
124 myMungData = nil; 124 myMungData = nil;
125 } 125 }
126 return err; 126 return err;
127 } 127 }
128 128
129 static void DecompressSequencePreflight(GWorldPtr srcGWorld, 129 static void DecompressSequencePreflight(GWorldPtr srcGWorld,
130 ImageSequence *imageSeq, 130 ImageSequence *imageSeq,
131 GWorldPtr destGWorld, 131 GWorldPtr destGWorld,
132 Rect *srcRect) 132 Rect *srcRect)
133 // might not need this one 133 // might not need this one
134 134
135 { 135 {
136 ImageDescriptionHandle imageDesc = nil; 136 ImageDescriptionHandle imageDesc = nil;
137 137
138 BailErr(MakeImageDescriptionForPixMap (GetGWorldPixMap(srcGWorld), &imageDesc)); 138 BailErr(MakeImageDescriptionForPixMap (GetGWorldPixMap(srcGWorld), &imageDesc));
139 139
140 // use our built-in decompressor to draw 140 // use our built-in decompressor to draw
141 // (**imageDesc).cType = kCustomDecompressorType; 141 // (**imageDesc).cType = kCustomDecompressorType;
142 142
143 // *********** MIGHT BE MAKING A BIG MISTAKE ****************** 143 // *********** MIGHT BE MAKING A BIG MISTAKE ******************
144 // pass a compressed sample so a codec can perform preflighting before the first DecompressSequenceFrameWhen call 144 // pass a compressed sample so a codec can perform preflighting before the first DecompressSequenceFrameWhen call
145 145
146 BailErr(DecompressSequenceBegin(imageSeq, 146 BailErr(DecompressSequenceBegin(imageSeq,
147 imageDesc, 147 imageDesc,
148 destGWorld, 148 destGWorld,
149 0, 149 0,
150 srcRect, 150 srcRect,
151 nil, 151 nil,
152 srcCopy, 152 srcCopy,
153 nil, 153 nil,
154 0, 154 0,
155 codecNormalQuality, 155 codecNormalQuality,
167 return myMungData->drawSeq; 167 return myMungData->drawSeq;
168 } 168 }
169 169
170 void SetMungDataColorDefaults() 170 void SetMungDataColorDefaults()
171 { 171 {
172 if(myMungData) 172 if(myMungData)
173 { 173 {
174 myMungData->redMin = 2; 174 myMungData->redMin = 2;
175 myMungData->redMax = 254; 175 myMungData->redMax = 254;
176 myMungData->greenMin = 2; 176 myMungData->greenMin = 2;
177 myMungData->greenMax = 254; 177 myMungData->greenMax = 254;
181 } 181 }
182 182
183 void GetMungDataBoundsRect(Rect *boundsRect) 183 void GetMungDataBoundsRect(Rect *boundsRect)
184 // might not need this one 184 // might not need this one
185 { 185 {
186 MacSetRect (boundsRect, 186 MacSetRect (boundsRect,
187 myMungData->bounds.left, 187 myMungData->bounds.left,
188 myMungData->bounds.top, 188 myMungData->bounds.top,
189 myMungData->bounds.right, 189 myMungData->bounds.right,
190 myMungData->bounds.bottom 190 myMungData->bounds.bottom
191 ); 191 );
192 } 192 }
193 193
194 void SetCurrentClamp(short index) // :crazy:20040426 194 void SetCurrentClamp(short index) // :crazy:20040426
195 { 195 {
196 myMungData->selectedIndex = index; 196 myMungData->selectedIndex = index;
197 } 197 }
198 198
199 GWorldPtr GetMungDataOffscreen() 199 GWorldPtr GetMungDataOffscreen()