Пример #1
0
int iip_scan::print_all( void )
{
	double	d_x_reso,
		d_y_reso;

	if (OK != this->imageinfo_pri_all()) { return NG; }
	if (OK != this->imagelayout_pri_all()) { return NG; }
	if (OK != this->setupmemxfer_pri_all()) { return NG; }

	if (OK != this->imageinfo_get_dp_reso(&d_x_reso,&d_y_reso)) {
		return NG;
	}
	pri_funct_msg_vr( "imageinfo resolution x %.16g y %.16g",
		d_x_reso, d_y_reso );

	if (OK != this->cap_pri_brightness()) { return NG; }
	if (OK != this->cap_pri_contrast()) { return NG; }
	if (OK != this->cap_pri_gamma()) { return NG; }
	if (OK != this->cap_pri_xresolution()) { return NG; }
	if (OK != this->cap_pri_yresolution()) { return NG; }
	if (OK != this->cap_pri_indicators()) { return NG; }
	if (OK != this->cap_pri_units()) { return NG; }
	if (OK != this->cap_pri_xfermech()) { return NG; }
	if (OK != this->cap_pri_pixeltype()) { return NG; }
	if (OK != this->cap_pri_bitdepth()) { return NG; }
	if (OK != this->cap_pri_orientation()) { return NG; }
	if (OK != this->cap_pri_threshold()) { return NG; }

	/* TWAINスキャナーから読み取った情報 */
	pri_funct_msg_vr( "native_resolution x %.16g y %.16g",
		this->_d_x_native_resolution,
		this->_d_y_native_resolution );
	pri_funct_msg_vr( "physical_area     x %.16g y %.16g",
		this->_d_physical_width,
		this->_d_physical_height );
	pri_funct_msg_vr( "uicontrollable_sw %ld",
		this->_l_uicontrollable_sw );

	return OK;
}
void tw_win_l2_dss::_imageinfo_pri( TW_IMAGEINFO *p_tw_imageinfo )
{
	TW_FIX32	*p_tw_fix32;
	double	d_val;

	pri_funct_msg_vr(
	"------ TW_IMAGEINFO ------" );

	pri_funct_msg_vr(
	"01/12 type      parameter        value : description");

	p_tw_fix32 = &(p_tw_imageinfo->XResolution);
	this->_fix32_to_double( p_tw_fix32, &d_val );

	pri_funct_msg_vr(
	"02/12 TW_FIX32  XResolution      %lf : (While %d,Frac %d)",
		d_val, p_tw_fix32->Whole, p_tw_fix32->Frac );

	p_tw_fix32 = &(p_tw_imageinfo->YResolution);
	this->_fix32_to_double( p_tw_fix32, &d_val );

	pri_funct_msg_vr(
	"03/12 TW_FIX32  YResolution      %lf : (While %d,Frac %d)",
		d_val, p_tw_fix32->Whole, p_tw_fix32->Frac );

	pri_funct_msg_vr(
	"04/12 TW_INT32  ImageWidth       %d",
		p_tw_imageinfo->ImageWidth );
	pri_funct_msg_vr(
	"05/12 TW_INT32  ImageLength      %d : height",
		p_tw_imageinfo->ImageLength );
	pri_funct_msg_vr(
	"06/12 TW_INT16  SamplesPerPixel  %d",
		p_tw_imageinfo->SamplesPerPixel );
	pri_funct_msg_vr(
	"07/12 TW_INT16  BitsPerSample[8] %d %d %d %d %d %d %d %d",
		p_tw_imageinfo->BitsPerSample[0],
		p_tw_imageinfo->BitsPerSample[1],
		p_tw_imageinfo->BitsPerSample[2],
		p_tw_imageinfo->BitsPerSample[3],
		p_tw_imageinfo->BitsPerSample[4],
		p_tw_imageinfo->BitsPerSample[5],
		p_tw_imageinfo->BitsPerSample[6],
		p_tw_imageinfo->BitsPerSample[7]
	);
	pri_funct_msg_vr(
	"08/12         : Number of bits for each sample" );
	pri_funct_msg_vr(
	"09/12 TW_INT16  BitsPerPixel     %d",
		p_tw_imageinfo->BitsPerPixel );
	pri_funct_msg_vr(
	"10/12 TW_BOOL   Planar           %d : TRUE is Planar,FALSE is chunky",
		p_tw_imageinfo->Planar );
	pri_funct_msg_vr(
	"11/12 TW_INT16  PixelType        %d : TWPT_XXXX",
		p_tw_imageinfo->PixelType );
	pri_funct_msg_vr(
	"12/12 TW_UINT16 Compression      %d : TWCP_XXXX",
		p_tw_imageinfo->Compression );
}
int iip_opengl_l2data::set_imagedata( iip_canvas *clp_parent )
{
	if (ON == this->get_i_mv_sw()) {
	 pri_funct_msg_vr( "iip_opengl_l2data::set_imagedata(-)" );
	}

	/*
	 * 親子接続し、関係を設定する
	 */

	/*  clp_parent - 元画像
	    +-- cl_iip_prec 精度変換
		+-- cl_iip_chan RGB(A)チャンネル表示専用
		+-- cl_iip_view OpenGL画像表示機能
	*/
	this->cl_iip_prec.set_clp_parent( clp_parent );
	this->cl_iip_chan.set_clp_parent(
		&(this->cl_iip_prec) );
	this->cl_iip_view.set_clp_parent(
		&(this->cl_iip_prec) );

	/*
	 * 親から子へ画像の大きさをセット
	 */

	this->cl_iip_prec.set_canvas_size( clp_parent );

	/* 以下の精度の場合は、表示用の精度に変更する */
	switch(this->cl_iip_prec.cl_ch_info.get_e_ch_num_type()){
	case E_CH_NUM_USHRT:
	case E_CH_NUM_ULONG:
	case E_CH_NUM_DOUBL:
		this->cl_iip_prec.cl_ch_info.set_e_ch_num_type(
			E_CH_NUM_UCHAR);
		break;
	case E_CH_NUM_BITBW:
		if (ON == this->_i_bw_use_uchar_sw) {
			this->cl_iip_prec.cl_ch_info.set_e_ch_num_type(
				E_CH_NUM_UCHAR);
		}
		break;
	case E_CH_NUM_EMPTY:
	case E_CH_NUM_UCHAR:
	default:
		break;
	}

	this->cl_iip_chan.set_canvas_size(
		&(this->cl_iip_prec) );
	this->cl_iip_view.set_canvas_size(
		&(this->cl_iip_prec) );

	/* 切抜きエリアを(画像の大きさに)初期設定 */
	this->cl_iip_view.set_crop_full_image();

	/*
	 * 画像カンバスの準備(メモリ確保あるいは参照)
	 */

	if (OK != this->cl_iip_prec.set_canvas()) {
		pri_funct_err_bttvr(
	 "Error : this->cl_iip_prec.set_canvas() returns NG" );
		return NG;
        }
	/* RGB(A)のときだけ、channel毎表示用メモリが必要 */
	if (3L <= this->cl_iip_chan.get_l_channels()) {
	 /* channel毎表示メモリを確保 */
	 if (OK != this->cl_iip_chan.mem_alloc_canvas()) {
		pri_funct_err_bttvr(
	  "Error : this->cl_iip_chan.mem_alloc_canvas() returns NG" );
		return NG;
         }
	 /* channel毎のメモリを表示classへ登録する */
	 this->cl_iip_view.set_ucp_rrggbbaa(
	  (unsigned char *)(this->cl_iip_chan.get_vp_canvas())
	 );
	}

	/*
	this->cl_iip_viewは
	this->cl_iip_prec(親)を参照するのみ
	*/
	this->cl_iip_view.set_vp_reference_canvas(
		this->cl_iip_prec.get_vp_canvas()
	);

	/*
	 * 画像を作成、あるいは参照
	 */

	this->cl_iip_prec.exec();

	/* RGB(A)のときだけ、channel毎の画像を作成 */
	if (3L <= this->cl_iip_chan.get_l_channels()) {
	 this->_from_uchar_rgbargba_to_rrggbbaa(
		(unsigned char *)
		this->cl_iip_prec.get_vp_canvas(),

		this->cl_iip_prec.get_l_width(),
		this->cl_iip_prec.get_l_height(),
		this->cl_iip_prec.get_l_channels(),

		(unsigned char *)
		this->cl_iip_chan.get_vp_canvas()
	 );
	}

	return OK;
}