Re: Cpp 2 PB translation but understanding
Posted: Wed May 10, 2017 8:42 pm
What does say the specific doc about the third argument of dNoise() function? Is the unit in bytes really? (not in quads?)
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle,
@FaceCount, @*IDs, MaXize):ErrorDCode(RET, #PB_Compiler_Line)
;MemorySize(*IDs) MaXize maximum 256 faces detected
Debug @*IDs
ShowMemoryViewer(@*IDs,MaxSize)
Code: Select all
RET = FSDK_GetAllNames(Tracker, *IDs, @Name,
256):ErrorDCode(RET, #PB_Compiler_Line) ; maximum of 256
characters ; *IDs\IDs[1] ; @*IDs\IDs[1]
Code: Select all
NullCharacterPos = FindString(Name, Chr(0))
If (NullCharacterPos > 0)
Name = Left(Name, NullCharacterPos - 1)
EndIf
Code: Select all
Name = Trim(Name)
Code: Select all
Name = Left(Name, Len(Name) - 1)
Code: Select all
int FSDK_FeedFrame(HTracker Tracker, long long CameraIdx,
HImage Image, long long * FaceCount, long long * IDs, long
long MaxSizeInBytes);
Code: Select all
Structure TPoint ;- FaceFeatStruct .TPoint(#FSDK_FACIAL_FEATURE_COUNT - 1)
x.l
y.l
EndStructure
Structure TFacePosition ;- FacePoStruct.TFacePosition(#TFPositionz) ; Obzervd Long is bit faster than Int
xc.l
yc.l
w.l
padding.l
angle.d
EndStructure
Structure FSDK_VideoFormatInfo ;- WebcamStruct
Width.l
Height.l
BPP.l
EndStructure
Structure VideoFormatInfo
VideoFormatInfo.FSDK_VideoFormatInfo[255]
EndStructure
Structure CameraList
CameraList.s[255]
EndStructure
Structure IDs
IDs.i[255]
EndStructure
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, @*IDs, MaXize)
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, @*IDs,
MaXize)
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, *IDs,
MaxSize)
Code: Select all
Structure TPoint
x.l
y.l
EndStructure
Structure TFacePosition
xc.l
yc.l
w.l
padding.l
angle.d
EndStructure
Structure FSDK_VideoFormatInfo ;- WebcamStruct
Width.l
Height.l
BPP.l
EndStructure
Structure VideoFormatInfo
VideoFormatInfo.FSDK_VideoFormatInfo[255]
EndStructure
Structure CameraList
CameraList.s[255]
EndStructure
Structure IDs
IDs.i[255]
EndStructure
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, *IDs, MaXize)
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, @*IDs, MaXize)
RET = FSDK_GetTrackerFacePosition(Tracker, 0, *IDs\IDs[i], @*facePosition)
Code: Select all
RET = FSDK_FeedFrame(Tracker, 0, imageHandle,
@FaceCount, *IDs, MaxSize)
Actually, we have this :Lik137 wrote:A6: dNoise expects Quad (I always Used Int instead of Quad but You better know)
Code: Select all
dNoise(hAudio, *pitch, MemorySize(*pitch) )
Code: Select all
dNoise(hAudio, *pitch, MemorySize(*pitch) / 8)
Hoping my forget of this dividing is the reason for crash.Lik137 wrote:A12: Let me test MemorySize(*pitch) / 8 and back with result
This answer indirectly to my question #A10 ("Are the structures required by external functions set?") : These structures are well required...Lik137 wrote:A11.1: RET = FSDK_GetTrackerFacePosition(Tracker, 0, *IDs\IDs, @*facePosition)
reports correct argument syntax but *facePosition\xc (yc, w) always 0 but correct face
coordinates
should be poke to @*facePosition address)
there are 2 problems remaining:
Pr1: Assertion which is only in FSDK_FeedFrame line. I put debug/messagerequester
before and after the line and before 2nd debug assertion release.
Pr2: Correct Face coordinates to *facePosition.TFacePosition
Code: Select all
Structure TFacePosition
xc.l ; 32 bits
yc.l ; 32 bits
w.l ; 32 bits
padding.l ; 32 bits
angle.d ; 64 bits
EndStructure
Code: Select all
Structure TFacePosition
xc.Q
yc.Q
w.Q
padding.Q
angle.D
EndStructure
Code: Select all
Structure TFacePosition
xc.L
useless0.L
yc.L
useless1.L
w.L
useless2.L
padding.L
useless3.L
angle.D
EndStructure
Have you got really same errors at the same lines, and same returned values ?Lik137 wrote:I changed Longs to Quad but now while the error still remains this time working functions
stopped working.
I returned back to Long.