1 #include <Base/Common/W32Compat.hh>
4 # pragma warning(disable: 4996) // vs8
16 #include <Image/Camera.hh>
17 #include "VideoSource_Net.hh"
28 #ifdef BIAS_HAVE_LIBJPEG
30 #endif //BIAS_HAVE_LIBJPEG
40 BIASERR(
"no UDP comm yet");
46 return OpenDevice(serverName, D_CS_DEFAULT_PORT);
84 BIASERR(
"received image is not unsigned char");
95 BIASERR(
"UDP not yet");
98 static std::vector<char> data;
129 pImgBuffer_->rdbuf()->sputn(&dummy[0],dummy.length());
132 #ifdef BIAS_HAVE_LIBJPEG
137 BIASERR(
"Decompression failed!");
144 #endif //BIAS_HAVE_LIBJPEG
158 # ifdef BIAS_HAVE_LIBJPEG
160 # endif //BIAS_HAVE_LIBJPEG
Defines a common interface to different devices.
unsigned int GetDepth() const
returns the bytes per channel, which is the sizeof(StorageType) Should match GetSizeDepth(GetStorageT...
virtual int GrabSingle(BIAS::Camera< unsigned char > &image)
void CopyIn_NoInit(void *data)
Take some data and fill it into the Image.
VideoSource_Net(bool threaded=true)
Standard Constructor use threaded param for dis-/enabling threaded receiving! If threaded receiving i...
BIAS::ImageBase::EColorModel ColorMode_
Color mode used by camera.
BIAS::Image< unsigned char > jpegImg_
float BytesPerPixel_
BytesPerPixel cannot be int (e.g. it is 1.5 for YUV420p)
unsigned int GetWidth() const
int RegisterMsg(std::string msgName, EdataType dataType, int amount=1)
only registered msgs are accepted by commPartners Register a msg with this functions.
std::stringstream * pImgBuffer_
int ConnectServer(std::string serverName, unsigned int port=D_CS_DEFAULT_PORT, unsigned int timeOut=20000)
for a client: tries to connect to server with hostname serverName.
void SetVerbose(bool on)
gives some information about establising conn, and disconnecting etc.
virtual int OpenDevice()
selects the first available device to open (e.g.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
color values, 3 channels, order: red,green,blue
unsigned int GetHeight() const
int Decompress(BIAS::Image< unsigned char > &destImg, bool readComment=false)
Start decompression of previously given data (from ReadJPEG() or SetCompressedData()), results will be stored in destination image.
void Release()
Releases allocated memory.
void SetKeepAll(bool on)
If not threaded you can set this true to keep all received data.
bool SamePixelAndChannelCount(const ImageBase &Image) const
checks if data area has same "size" as Image of other type
int PostGrab()
Stop anything started in PreGrab()
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
void SetCompressedData(void *data, long length)
Copy memory area in which compressed data can be found and set its length in byte.
int Init(long size=10485760)
Initialize object with standard values and limit shared memory area to given size (in byte...
enum EStorageType GetStorageType() const
(8bit) unsigned char image storage type
int PreGrab()
Do last preparations before grabbing (e.g. start ISO transfer)
This is the base class for images in BIAS.
int ParseMetaData(bool bUse2x64bitTS=true)
After ImageIO::Load() operated on AppData_, this method fills P_, Timestamp, DC_*, ...
JpegHandler Decompressor_
int GetData(const std::string &msgName, std::vector< float > &floatData)
returns instantly:<br> 0 if new data has arrived and the data in xxxData 1 if no new data has arri...