BlinkenArea - GitList
Repositories
Blog
Wiki
JEtherPix
Code
Commits
Branches
Tags
Search
Tree:
5b2f5f7
Branches
Tags
master
JEtherPix
org
blinkenarea
JFlexiPix
Distri.java
change email address in file headers
Stefan Schuermans
commited
5b2f5f7
at 2011-09-11 12:35:49
Distri.java
Blame
History
Raw
/* JFlexiPix - Java implementation of FlexiPix output library * * Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.blinkenarea.JFlexiPix; import java.util.Arrays; /// FlexiPix distributor class Distri { /** * @brief constructor * @param[in] distri number of this distributor * @param[in] outputCnt number of outputs * @param[in] pixelCnt number pixels connected to every output */ Distri(int distri, int outputCnt, int pixelCnt) { // save constructor parameters m_distri = distri; m_outputCnt = outputCnt; m_pixelCnt = pixelCnt; // allocate default mappings m_mapRed = new Mapping(); m_mapGreen = new Mapping(); m_mapBlue = new Mapping(); // allocate pixel array (no pixels configured yet) m_pixels = new Pixel [m_outputCnt * m_pixelCnt]; // allocate and initialize message buffer m_msgBuf = Arrays.copyOf(Constants.mcufHdr, Constants.mcufHdr.length + m_outputCnt * m_pixelCnt * 3); m_msgBuf[Constants.mcufOfsOutputs] = (byte)m_outputCnt; m_msgBuf[Constants.mcufOfsPixels] = (byte)m_pixelCnt; } int m_distri; ///< number of this distributor int m_outputCnt; ///< number of outputs int m_pixelCnt; ///< number pixels connected to every output Mapping m_mapRed; ///< mapping information for red channel Mapping m_mapGreen; ///< mapping information for Green channel Mapping m_mapBlue; ///< mapping information for blue channel Pixel [] m_pixels; /**< information about pixels of this distributor, index = output * m_pixelCnt + pixel */ byte [] m_msgBuf; ///< buffer for current message to send to distributor }