- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to use ippiSet function for 32s_C3R, because of ippiFFTFwd_RToPack_8u32s_C3RSfs butit's defined only for8u_C3R, 16s_C3R and32f_C3R .?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IppiSet_32s was not found.
However, you can write the value yourself.
---- VC sample ----
#include "ipp.h"
int main(int argc, char* argv[])
{
Ipp32s * pImg;
Ipp32s * pTmp;
int ImgW, ImgH, Step, y, x;
ImgW = 3; ImgH = 3;
pImg = ippiMalloc_32s_C3(ImgW, ImgH, &Step);
Ipp32s value = 1;
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");
value = 100;
ippsSet_32s(value, pImg, Step / sizeof(Ipp32s) * ImgH);
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");
ippiFree(pImg);
return 0;
}
---- Delphi sample ----
function ippiMalloc_32s_C3(
widthPixels, heightPixels: Integer;
pStepBytes: PInteger): Pointer;
stdcall; external 'ippi20.dll';
procedure ippiFree(
ptr: Pointer);
stdcall; external 'ippi20.dll';
function ippsSet_32s(
val: Integer; pDst: PInteger;
len: Integer): Integer;
stdcall; external 'ipps20.dll';
procedure TForm1.Button1Click(Sender: TObject);
var pImg, pTmp: PInteger;
var ImgW, ImgH, Step, y, x, value: Integer;
var s: String;
begin
ImgW := 3; ImgH := 3;
pImg := ippiMalloc_32s_C3(ImgW, ImgH, @Step);
value := 1; s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);
value := 100;
ippsSet_32s(value, pImg, Step div SizeOf(Integer) * ImgH);
s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);
ippiFree(pImg);
end;
However, you can write the value yourself.
---- VC sample ----
#include "ipp.h"
int main(int argc, char* argv[])
{
Ipp32s * pImg;
Ipp32s * pTmp;
int ImgW, ImgH, Step, y, x;
ImgW = 3; ImgH = 3;
pImg = ippiMalloc_32s_C3(ImgW, ImgH, &Step);
Ipp32s value = 1;
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");
value = 100;
ippsSet_32s(value, pImg, Step / sizeof(Ipp32s) * ImgH);
for ( y = 0; y < ImgH; y++ )
{
pTmp = pImg + y * Step / sizeof(Ipp32s);
for ( x = 0; x < ImgW; x++ )
{
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d, ", *pTmp); pTmp++;
*pTmp = value; printf("%d ", *pTmp); pTmp++;
} printf(" ");
} printf(" ");
ippiFree(pImg);
return 0;
}
---- Delphi sample ----
function ippiMalloc_32s_C3(
widthPixels, heightPixels: Integer;
pStepBytes: PInteger): Pointer;
stdcall; external 'ippi20.dll';
procedure ippiFree(
ptr: Pointer);
stdcall; external 'ippi20.dll';
function ippsSet_32s(
val: Integer; pDst: PInteger;
len: Integer): Integer;
stdcall; external 'ipps20.dll';
procedure TForm1.Button1Click(Sender: TObject);
var pImg, pTmp: PInteger;
var ImgW, ImgH, Step, y, x, value: Integer;
var s: String;
begin
ImgW := 3; ImgH := 3;
pImg := ippiMalloc_32s_C3(ImgW, ImgH, @Step);
value := 1; s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
pTmp^ := value; s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);
value := 100;
ippsSet_32s(value, pImg, Step div SizeOf(Integer) * ImgH);
s := '';
for y := 0 to ImgH - 1 do begin
Integer(pTmp) := Integer(pImg) + y * Step;
for x := 0 to ImgW - 1 do begin
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ', '; Inc(pTmp);
s := s + IntToStr(pTmp^) + ' '; Inc(pTmp);
end; s := s + #13#10;
end;
ShowMessage(s);
ippiFree(pImg);
end;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help,
yes, that's correct. If thereno appropriate 2-D functions it is possible to use 1-D functions on row-by-row basis.
Regards,
Vladimir
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page