Piranha4 8k Color Camera
User’s Manual
87
Teledyne DALSA
03-032-20274-00
A simple workaround accomplishes this:
1)
Acquire as if the P4 camera was a 8-bit mono, 24,576 (4096 x 3) pixels linescan
camera
2)
Treat acquired buffer as SapFormatRGBR888 (24bit/pixel). Sapera LT provides a
feature to share buffer components between two SapBuffer objects. Buffer type may
be different between the two SapBuffer objects. This can be a trick to convert buffer
format without buffer copy.
Acquiring the above data as you would an 8-bit mono camera in 8-tap mode creates the
acquisition buffer shown below.
On the other hand, the SapFormatRGBR888 format is shown below.
As you demonstrated above, the two buffers’ content and their order are exactly same.
Thus, acquiring the buffer as if the camera were a mono 8-bit, 8-tap results in the same
buffer contents as the SapFormatRGBR888.
Sample code:
//Assuming acquisition buffer is declared as below.
#define NUMBUFFERS
8
SapBuffer *m_Buffers;
m_Buffers = new SapBufferWithTrash(NUMBUFFERS, m_Acq);
// Call Create() for acquisition buffer
m_Buffers->Create();
// Declare SapBuffer object which shares buffer components with the acquisition buffer
SapBuffer *m_ViewBuffers;
int width, height, i;
void* pData[NUMBUFFERS];
for (i=0; i<NUMBUFFERS; i++)
{
m_Buffers->GetAddress(i, &pData[i]);
}
width = m_Buffers->GetWidth();
height = m_Buffers->GetHeight();
m_ViewBuffers = new SapBuffer(NUMBUFFERS, pData, width / 3,
height,SapFormatRGB888);
m_ViewBuffers->Create();
If you declare above m_ViewBuffer as the source buffer of SapView object, you can display
RGB image without any additional processing.
Adr+0
Adr+1
Adr+2
Adr+3
Adr+4
Adr+5
Adr+6
Adr+7
Adr+8
Adr+9
Adr+10
Adr+11
Red1
Green1
Blue1
Red2
Green2
Blue2
Red3
Green3
Blue3
Red4
Green4
Blue4
First CLK
Second CLK
Red1
Green1
Blue1
Red2
Green2
Blue2
Red3
Green3
Blue3
Red4
Green4
Blue4
Pixe1 (3byte)
Pixel2
Pixel3
Pixel4