Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6712 Discussions

what is the order about createdibsection in conjunction with the ippi etc.

mh_de_ruiter
Beginner
286 Views
Hi, i am lost... :-( i can manage to work with api prototypes in clarion.. but i can't see how i have to invoke the ippi functions.. the imalloc etc... please can someone explain ...(the ! = commented-out in clarion only)
IPPI_R Routine
Data
This_BIH GROUP,PRE()
This_BIHSize ULONG
This_BIHWidth LONG
This_BIHHeight LONG
This_BIHPlanes USHORT
This_BIHBitCount USHORT
This_BIHCompression ULONG
This_BIHSizeImage ULONG
This_BIHXPelsPerMeter LONG
This_BIHYPelsPerMeter LONG
This_BIHClrUsed ULONG
This_BIHClrImportant ULONG
End
This_DIBData &STRING
This_DIBDataPointer LONG
This_DIBDataSize ULONG
This_BitsData &STRING
This_BitsDataPointer LONG
This_BitsDataSize ULONG
This_LogBrush GROUP,PRE()
This_LBStyle ULONG
This_LBColor ULONG
This_LBHatch LONG
End
This_LogBrushHandle Ulong
This_ThisRect Group
This_TRLeft Long
This_TRTop Long
This_TRRight Long
This_TRBottom Long
End
This_RectVertex Group,Pre(),Dim(2)
This_RVX LONG
This_RVY LONG
This_RVRed USHORT
This_RVGreen USHORT
This_RVBlue USHORT
This_RVAlpha USHORT
End
This_TriVertex Group,Pre(),Dim(4)
This_TVX LONG
This_TVY LONG
This_TVRed USHORT
This_TVGreen USHORT
This_TVBlue USHORT
This_TVAlpha USHORT
End
This_GradientTri Group,Pre(),Dim(2)
This_GTV1 ULong
This_GTV2 ULong
This_GTV3 ULong
End
This_GradientRect Group,Pre()
This_GRUpperLeft ULong
This_GRLowerRight ULong
End
This_DummyDCHandle ulong
!This_DIBHandle ULong
colorvalue3 ulong

Code

W = 400
H = 300
This_DummyDCHandle = GetDC(?ImageDummy{Prop:Handle})
MemoryDCHandle = CreateCompatibLEDC(This_DummyDCHandle)
ReturnVal = ReleaseDC(?ImageDummy{Prop:Handle},This_DummyDCHandle)
This_BIH.This_BIHSize = Size(This_BIH)
This_BIH.This_BIHWidth = W
This_BIH.This_BIHHeight = H
This_BIH.This_BIHPlanes = 3
This_BIH.This_BIHBitCount = 8
This_BIH.This_BIHCompression = 0
This_BIH.This_BIHSizeImage = 0
This_BIH.This_BIHXPelsPerMeter = 0
This_BIH.This_BIHYPelsPerMeter = 0
This_BIH.This_BIHClrUsed = 0
This_DIBHandle = CreateDIBSection(0,Address(This_BIH),DIB_RGB_COLORS,Address(This_DIBDataPointer),0,0)
! ReturnSelectThis_DIBHandle = SelectObject(MemoryDCHandle,This_DIBHandle)
! Clear(This_ThisRect)
! This_ThisRect.This_TRLeft = 0
! This_ThisRect.This_TRTop = 0
! This_ThisRect.This_TRRight = W
! This_ThisRect.This_TRBottom = h
!
! Clear(This_LogBrush)
! This_LogBrush.This_LBStyle = BS_SOLID
! This_LogBrush.This_LBColor = (32*256*256) + (64*256) + 128
! This_LogBrushHandle = CreateBrushIndirect_B(Address(This_LogBrush))
! ReturnVal = SelectObject(MemoryDCHandle,This_LogBrushHandle)
! ReturnVal = FillRect_A(MemoryDCHandle,Address(This_ThisRect),This_LogBrushHandle)

ippiMalloc_8u_C3_Return = ippiMalloc_8u_C3(W,H,Address(StepBytes))
! ReturnSelectThis_DIBHandle = SelectObject(MemoryDCHandle,ippiMalloc_8u_C3_Return)
! ReturnValGetDIBits = GetDIBits(MemoryDCHandle,This_DIBHandle,0,H,ippiMalloc_8u_C3_Return,Address(This_BIH),0)
! The_BitsDataSize = (H * StepBytes) * 4
! This_BitsData &= NEW(String(The_BitsDataSize))
! This_BitsDataPointer = Address(This_BitsData)
!
! ReturnValGetDIBits = GetDIBits(MemoryDCHandle,This_BitsDataPointer,0,H,ippiMalloc_8u_C3_Return,Address(This_BIH),0)
!
! ReturnValSetDIBits = SetDIBits(MemoryDCHandle,ippiMalloc_8u_C3_Return,0,H,This_DIBHandle,Address(This_BIH),0)

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
286 Views
Hi,
unfortunately (or fortunately :)) I'm not familiar with Clarion, so could you please explain what you want to do in this code?
Regards,
Vladimir
0 Kudos
mh_de_ruiter
Beginner
286 Views
Hi Vdudnik,
Ok,
I am making with normal API a bitmap,
and want to use the imalloc bitmap for further manipulation..
i suppose it is not possible to get the imalloc within the DC ?
and i should use GetDIBits ?
Regards,
Menno
0 Kudos
Reply