Пример #1
0
void LfpDisplayCanvas::resized()
{

    timescale->setBounds(leftmargin,0,getWidth()-scrollBarThickness-leftmargin,30);
    viewport->setBounds(0,30,getWidth(),getHeight()-90);

    lfpDisplay->setBounds(0,0,getWidth()-scrollBarThickness, getChannelHeight()*nChans);

    rangeSelection->setBounds(5,getHeight()-30,100,25);
    timebaseSelection->setBounds(175,getHeight()-30,100,25);
    spreadSelection->setBounds(345,getHeight()-30,100,25);
    colorGroupingSelection->setBounds(620,getHeight()-30,100,25);


    for (int i = 0; i < 8; i++)
    {
        eventDisplayInterfaces[i]->setBounds(500+(floor(i/2)*20), getHeight()-40+(i%2)*20, 40, 20); // arrange event channel buttons in two rows
        eventDisplayInterfaces[i]->repaint();
    }


    // std::cout << "Canvas thinks LfpDisplay should be this high: "
    //  << lfpDisplay->getTotalHeight() << std::endl;

}
Пример #2
0
ImgHeader CHistogram::GetImageHeader(int numChannels)
{
   ImgHeader header;
   header.type = pp8u;
   header.channels = 3;
   header.plane = FALSE;
   header.SetSize((int)getHistoWidth(), numChannels*(int)getChannelHeight());
   return header;
}
Пример #3
0
BOOL CHistogram::SetImage(CImage* pImage)
{
   if (!pImage) return FALSE;
   if (!m_bInit) return FALSE;
   if (!ValidHeader(pImage->GetHeader())) return FALSE;
   m_pImage = pImage;

   int* color[4] = {colorBlue, colorGreen, colorRed, colorAlpha};
   if (m_numChannels == 1) color[0] = colorGray;

   m_pImage->SetData((char)0xFF);
   for (int i=0; i < m_numChannels; i++)
      DrawHist(m_pLevels[i], m_pHist[i], m_nLevels[i],
         (m_numChannels - i - 1)*(int)getChannelHeight(), color[i]);
   return TRUE;
}