"Adrien Regimbald" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Well, my Pascal is very rusty, but.. > > In your declaration of the ImageData structure type, shouldn't imgH be > a pointer (imgH : ^UInt16)? If it's not supposed to be a pointer, > where are you storing the image between callbacks? > > Also, in both algorithms, the swapping seems backwards. Right now it > looks like: > > inputBuffer = Swap(storageBuffer); > > shouldn't it be: > > storageBuffer = Swap(inputBuffer);
Yes I've solve in this way Function Swap16(n:UInt16):UInt16; begin Result := ((((n shl 8) and $FF00) or ((n shr 8) and $00FF))); end; function SkipPtr(p: Pointer): Pointer; begin Result := Pointer(UInt32(p)+1); end; for x := 0 to size - 1 do begin myBuffP^ := Swap16(dataP.imgH^); dataP.imgH := SkipPtr(dataP.imgH); dataP^.offset := dataP^.offset + 1; myBuffP := SkipPtr(myBuffP); end; > > Where did you get your CodeWarrior example from? It seems a bit wonky > - for example, the capture callback function is defined like this in > the PalmCameraLib API: from palmoneSdk > > typedef Err CamLibCaptureCallbackFunc(void *bufP, UInt32 size, void *userDataP) > > but for some reason, your example has the 2nd parameter being a > pointer. Have you successfully tried running the CodeWarrior example? > Yes -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
