- new attribute bitAlignment

[WIP] split SDK codes, cleaning old SDKs
parent d88abd2c
......@@ -3,6 +3,7 @@
*.swp
*.bck
*.bak
*.map
*~
*target*
*.vcproj.*user
......@@ -10,3 +11,6 @@
PcoGitVersion.*
[0-9]*
*.cpp.*
*.h.*
*.sip.*
*Makefile.*
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This 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; either version 3 of the License, or
# (at your option) any later version.
#
# This software 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 General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
src-dirs = src
#test-dirs = test
include ../../global.inc
......@@ -506,7 +506,11 @@
>
</File>
<File
RelativePath="..\..\..\..\src\PcoCameraSdkAdd.cpp"
RelativePath="..\..\..\..\src\PcoCameraSdkLin.cpp"
>
</File>
<File
RelativePath="..\..\..\..\src\PcoCameraSdkWin.cpp"
>
</File>
<File
......
......@@ -205,21 +205,15 @@ typedef int tPvErr;
} \
}
#define PCO_CHECK_ERROR(er, fn) (PcoCheckError(__LINE__, __FILE__, ( er ) , ( fn ) ))
#ifndef __linux__
#define DEF_FNID static char *fnId =__FUNCTION__;
#define PCO_CHECK_ERROR(er, fn) (PcoCheckError(__LINE__, __FILE__, ( er ) , ( fn ) ))
#define DEF_FNID static char *fnId =__FUNCTION__;
#else
#define DEF_FNID const char *fnId __attribute__((unused)) =__FUNCTION__ ;
#define PCO_CHECK_ERROR(__err__ , __comments__) \
{ \
if(__err__) \
{ \
__err__ = PcoCheckError(__LINE__, __FILE__, __err__, fnId , __comments__); \
} \
}
#define DEF_FNID const char *fnId __attribute__((unused)) =__FUNCTION__ ;
#define PCO_CHECK_ERROR1(__err__ , __comments__) \
{ \
......
......@@ -1047,6 +1047,8 @@ namespace lima
void setTimestampMode(int mode);
void getTimestampMode(int &mode);
void setBitAlignment(std::string &i_sn);
void getBitAlignment(std::string &o_sn);
}; // class camera
} // namespace pco
......
......@@ -85,10 +85,9 @@ namespace lima
void getStatus(HwInterface::StatusType&);
void SyncCtrlObj::xlatLimaTrigMode2Pco(
void xlatLimaTrigMode2Pco(
lima::TrigMode limaTrigMode, WORD &pcoTrigMode, WORD &pcoAcqMode, bool &extTrig, int &err);
//BufferCtrlObj* _getBufferCtrlObj() {return m_buffer;}
void setExposing(pcoAcqStatus exposing);
void setStarted(bool started);
......
#define PCO_SDK_VERSION "$Id: PCOSDK [pcoDev.1.1.14] $"
#define PCO_SDK_RELEASE "pcoDev.1.1.14"
//-----------------------------------------------------------------//
// Name | PCO_Structures.h | Type: ( ) source //
// Name | VersionNo.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | PCO | ( ) others //
//-----------------------------------------------------------------//
// Platform | PC //
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | Visual 'C++' //
// Environment | Linux GCC //
//-----------------------------------------------------------------//
// Purpose | PCO - Common PCO functions //
// Purpose | PCO - Version number definition //
//-----------------------------------------------------------------//
// Author | FRE, PCO AG //
// Author | MBL PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 0.10 rel. 0.10 //
// Revision | //
//-----------------------------------------------------------------//
// Notes | //
// Notes | This is the Version number definition of //
// | the common files //
// | //
//-----------------------------------------------------------------//
// (c) 2003 PCO AG * Donaupark 11 * //
// D-93309 Kelheim / Germany * Phone: +49 (0)9441 / 2005-0 * //
// Fax: +49 (0)9441 / 2005-20 * Email: info@pco.de //
// (c) 2010 - 2015 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
//-----------------------------------------------------------------//
// Rev.: | Date: | Changed: //
// --------- | ---------- | ---------------------------------------//
// 0.10 | 23.02.2010 | new file, FRE //
//-----------------------------------------------------------------//
// 0.0 | . .2009 | //
// | | //
// 01.01 | 19.05.2016 | new file, MBL //
//-----------------------------------------------------------------//
// PCO_Structures.h: Defines helper functions and classes for pco
//
#ifndef PCO_STRUCTURES_H
#define PCO_STRUCTURES_H
struct sRGB_color_correction_coefficients
{
double da11, da12, da13;
double da21, da22, da23;
double da31, da32, da33;
};
#ifndef COMMON_VERS_NO_H
#define COMMON_VERS_NO_H
#define COMMON_VERSION 1
#define COMMON_SUBVERSION 1
#define COMMON_SUBAGE 14
typedef struct sRGB_color_correction_coefficients SRGBCOLCORRCOEFF;
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//-----------------------------------------------------------------//
// Name | Pco_ConvDlgExport.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | PCO | ( ) others //
//-----------------------------------------------------------------//
// Platform | PC //
//-----------------------------------------------------------------//
// Environment | Visual 'C++' //
//-----------------------------------------------------------------//
// Purpose | PCO - Convert DLL dialog function API definitions //
//-----------------------------------------------------------------//
// Author | MBL, FRE, HWI, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 2.00 rel. 2.00 //
//-----------------------------------------------------------------//
// Notes | //
//-----------------------------------------------------------------//
// (c) 2002 PCO AG * Donaupark 11 * //
// D-93309 Kelheim / Germany * Phone: +49 (0)9441 / 2005-0 * //
// Fax: +49 (0)9441 / 2005-20 * Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
//-----------------------------------------------------------------//
// Rev.: | Date: | Changed: //
// --------- | ---------- | ---------------------------------------//
// 1.10 | 03.07.2003 | gamma, alignement added, FRE //
//-----------------------------------------------------------------//
// 1.12 | 16.03.2005 | PCO_CNV_COL_SET added, FRE //
//-----------------------------------------------------------------//
// 1.14 | 12.05.2006 | conv24 and conv16 added, FRE //
//-----------------------------------------------------------------//
// 1.15 | 23.10.2007 | PCO_CNV_COL_SET removed, FRE //
// | | Adapted all structures due to merging //
// | | the data sets of the dialoges //
//-----------------------------------------------------------------//
// 2.0 | 08.04.2009 | New file, FRE //
//-----------------------------------------------------------------//
#ifdef PCO_CONVERT_DIALOG_DO_EXPORTS
//__declspec(dllexport) + .def file funktioniert nicht mit 64Bit Compiler
#if defined _WIN64
#define PCO_CONVERT_DIALOG_EXPORTS
#else
#define PCO_CONVERT_DIALOG_EXPORTS __declspec(dllexport) WINAPI
#endif
#else
#define PCO_CONVERT_DIALOG_EXPORTS __declspec(dllimport) WINAPI
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int PCO_CONVERT_DIALOG_EXPORTS PCO_OpenConvertDialog(HANDLE *hLutDialog, HWND parent, char *title,int msg_id, HANDLE hLut, int xpos,int ypos);
int PCO_CONVERT_DIALOG_EXPORTS PCO_CloseConvertDialog(HANDLE hLutDialog);
int PCO_CONVERT_DIALOG_EXPORTS PCO_GetStatusConvertDialog(HANDLE hLutDialog, int *hwnd,int *status);
int PCO_CONVERT_DIALOG_EXPORTS PCO_SetConvertDialog(HANDLE hLutDialog, HANDLE hLut);
int PCO_CONVERT_DIALOG_EXPORTS PCO_GetConvertDialog(HANDLE hLutDialog, HANDLE hLut);
int PCO_CONVERT_DIALOG_EXPORTS PCO_SetDataToDialog(HANDLE hLutDialog, int ixres, int iyres, void *b16_image, void *rgb_image);
typedef struct
{
WORD wCommand; // Command sent to the main application
PCO_Convert* pstrConvert; // Pointer to the controlled PCO_Convert
int iXPos; // Actual left position
int iYPos; // Actual upper position
unsigned int iReserved[10]; // Reserved for future use, set to zero.
}PCO_ConvDlg_Message;
#define PCO_CNV_DLG_CMD_CLOSING 0x0001 // Dialog is closing (bye, bye)
#define PCO_CNV_DLG_CMD_UPDATE 0x0002 // Changed values in dialog
#define PCO_CNV_DLG_CMD_WHITEBALANCE 0x0010 // White balance button pressed
#define PCO_CNV_DLG_CMD_MINMAX 0x0011 // Minmax button pressed
#define PCO_CNV_DLG_CMD_MINMAXSMALL 0x0012 // Minmax small button pressed
#ifdef __cplusplus
}
#endif
//-----------------------------------------------------------------//
// Name | pco_includes.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | SC2 | ( ) others //
//-----------------------------------------------------------------//
// Platform | Windows / Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | SC2 - libusb Includes Header //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 0.02 //
//-----------------------------------------------------------------//
// Notes | Common include files //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2004 - 2015 PCO AG * Donaupark 11 * //
// D-93309 Kelheim / Germany * Phone: +49 (0)9441 / 2005-0 * //
// Fax: +49 (0)9441 / 2005-20 * Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
//-----------------------------------------------------------------//
// Rev.: | Date: | Changed: //
// --------- | ---------- | ---------------------------------------//
// 0.01 | 20.02.2014 | new file from CL project //
//-----------------------------------------------------------------//
// 0.02 | 20.06.2015 | with pthreads //
//-----------------------------------------------------------------//
// 0.0x | xx.xx.200x | //
//-----------------------------------------------------------------//
#ifndef PCO_INCLUDES_H
#define PCO_INCLUDES_H
//#define _CRT_SECURE_NO_WARNINGS
#include "defs.h"
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <locale.h>
#include <stdio.h>
#include <fcntl.h>
#include <math.h>
#include <time.h>
#ifdef WIN32
#include <windows.h>
#include <tchar.h>
#include <winioctl.h>
#include <conio.h>
#include <io.h>
#include <iostream>
#include <fstream>
#include <shlobj.h>
#include "../pco_include/pthreads-win/pthread.h"
#include "../pco_include/pthreads-win/semaphore.h"
#pragma warning(disable : 4200)
#else
#include <fcntl.h> /* open */
#include <unistd.h> /* exit */
#include <stdarg.h>
#include <memory.h>
#include <ctype.h>
#include <pthread.h>
#include <sys/time.h>
#include <semaphore.h>
#include <errno.h>
#include <assert.h>
#include <signal.h>
typedef bool BOOL;
typedef bool BOOLEAN;
#endif
#define istrlen (int)strlen
#include "file12.h"
#include "Cpco_log.h"
#include "reorderfunc.h"
#include "SC2_drv_struct.h"
#include "SC2_SDKAddendum.h"
#include "PCO_err.h"
#include "sc2_command.h"
#include "sc2_telegram.h"
#include "sc2_defs.h"
#include "sc2_command_toString.h"
//#include "correctionmode.h"
#endif
//-----------------------------------------------------------------//
// Name | Ccambuf.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - buffer class functions //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | class functions exported from Ccambuf library //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
#ifndef Ccambuf_h
#define Ccambuf_h
#define OUT_BW 0x00
#define OUT_BGR 0x01
#define OUT_BGR0 0x02
#define OUT_PSEUDO 0x03
#define IN_BW 0x00 //input buffer is from BW-Camera
#define IN_COLOR 0x10 //input buffer is from COLOR-Camera
#define MASK_RGB 0x20
#define IN_RGB 0x20 //input buffer is from RGB-Camera
#define IN_RGB0 0x21 //input buffer is from RGB0-Camera
#define IN_BGR 0x22 //input buffer is from BGR-Camera
#define IN_BGR0 0x23 //input buffer is from BGR0-Camera
#define STATUS_INCONVERT 0x01
class Cambuf;
class CCambuf
{
//variables
public:
int status;
public:
CCambuf();
~CCambuf();
int Allocate(int width, int height,int bitpix,int align,int color_in);
int Allocate(int width, int height,int bitpix,int align);
int Allocate(int width, int height,int bitpix);
int Allocate(int size);
int Allocate();
int FreeBuffer();
int Get_Size();
int Get_actwidth();
int Get_actheight();
int Get_actbitpix();
int Get_actalign();
void* Get_actadr();
int SetCalculationRectangle(int firstline,int lastline,int firstrow,int lastrow);
void GetMinMax(int *min,int *max);
void GetMinMaxPos(int *min,int *min_pos_x,int *min_pos_y,int *max,int *max_pos_x,int *max_pos_y);
int CreateHistogramTable();
int CreateHistogramTable(int *min,int *max,double *mean,double *sigma);
int CreateHistogramTable(DWORD *histtab,int size,int *min,int *max,double *mean,double *sigma);
int CreateHistogramTables();
void Clearbuffer();
void Set_output_buffer(int mode);
void Set_output_buffer(int mode,void *bufadr);
void Set_output_lut(void *lut);
int GetColorinmode();
int convert();
int convert(void *out);
int convert(void *out,void *lut);
int convert_bw(void *out,void *lut);
int convert_col(void *out,void *lut);
void copy8to24(unsigned char *b8,unsigned char *out);
void copy8to32(unsigned char *b8,unsigned char *out);
int subtract(CCambuf *pic);
int subtract(CCambuf *pic,int offset);
int reduce(CCambuf *pic,int factor);
protected:
Cambuf *cambuf;
};
#endif
//-----------------------------------------------------------------//
// Name | Cpco_log.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | LINUX //
//-----------------------------------------------------------------//
// Environment | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - Logging class //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | Common functions //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
//-----------------------------------------------------------------//
// Rev.: | Date: | Changed: //
// --------- | ---------- | ---------------------------------------//
// 1.03 | 24.01.2012 | from Cpco_cl_com.cpp //
//-----------------------------------------------------------------//
// 0.0x | xx.xx.200x | //
//-----------------------------------------------------------------//
#ifndef CPCO_LOG_H
#define CPCO_LOG_H
#if !defined (MAX_PATH)
#define MAX_PATH 1024
#endif
#include "defs.h"
#ifndef WIN32
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
#endif
;
class CPco_Log
{
char logname[MAX_PATH];
public:
// CPco_Log(int logbits=0);
CPco_Log(const char *name=NULL);
~CPco_Log();
void writelog(DWORD lev,const char *str,...);
void writelog(DWORD lev,const char *str,va_list arg);
void writelog(DWORD lev,PCO_HANDLE hdriver,const char *str,...);
void writelog(DWORD lev,PCO_HANDLE hdriver,const char *str,va_list args);
void set_logbits(DWORD logbit);
DWORD get_logbits(void);
void start_time_mess(void);
double stop_time_mess(void);
#ifndef WIN32
void GetLocalTime(SYSTEMTIME* st);
void QueryPerformanceCounter(__int64* someint);
void QueryPerformanceFrequency(__int64* someint);
#endif
protected:
int hflog;
DWORD log_bits;
__int64 lpFrequency,lpPCount1,lpPCount2,lpPCount_p;
__int64 stamp1,stamp2;
};
//loglevels for interface dll
#define ERROR_M 0x0001
#define INIT_M 0x0002
#define BUFFER_M 0x0004
#define PROCESS_M 0x0008
#define COC_M 0x0010
#define INFO_M 0x0020
#define COMMAND_M 0x0040
#define PCI_M 0x0080
#define TIME_M 0x1000
#define TIME_MD 0x2000
#define NONE_M 0x01000000
#endif
//-----------------------------------------------------------------//
// Name | Cpcodisp.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - display class functions //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | class functions exported from Cpcodisp library //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
#ifndef CPCODISP_H
#define CPCODISP_H
#include <X11/Xlib.h>
#include <X11/X.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/extensions/XShm.h>
#include "defs.h"
#include "PCO_err.h"
#include "Ccambuf.h"
#include "Cpco_log.h"
class PCODisp;
class CPCODisp
{
public:
CPCODisp();
~CPCODisp();
void start_log();
void start_log(DWORD level);
void stop_log();
int initialize();
int initialize(char *title);