Exemple #1
0
QTCEXPORT(int,qtc_QHostInfo_lookupHost)(wchar_t* x1, void* x2, wchar_t* x3) {
  QObject*tx2 = *((QPointer<QObject>*)x2);
  if ((tx2!=NULL)&&((QObject *)tx2)->property(QTC_PROP).isValid()) tx2 = ((QObject*)(((qtc_DynamicQObject*)tx2)->parent()));
  QString tx3(from_method(x3));
  QByteArray txa3(tx3.toAscii());
  return (int) QHostInfo::lookupHost(from_method(x1), (QObject*)tx2, txa3.data());
}
Exemple #2
0
QTCEXPORT(void,qtc_QDataWidgetMapper_addMapping1)(void* x0, void* x1, int x2, wchar_t* x3) {
  QObject*tx0 = *((QPointer<QObject>*)x0);
  if ((tx0!=NULL)&&((QObject *)tx0)->property(QTC_PROP).isValid()) tx0 = ((QObject*)(((qtc_DynamicQObject*)tx0)->parent()));
  QObject*tx1 = *((QPointer<QObject>*)x1);
  if ((tx1!=NULL)&&((QObject *)tx1)->property(QTC_PROP).isValid()) tx1 = ((QObject*)(((qtc_DynamicQObject*)tx1)->parent()));
  QString tx3(from_method(x3));
  QByteArray txa3(tx3.toLocal8Bit());
  ((QDataWidgetMapper*)tx0)->addMapping((QWidget*)tx1, (int)x2, txa3);
}
Exemple #3
0
QTCEXPORT(void*,qtc_QHoverEvent2)(long x1, int x2_x, int x2_y, int x3_x, int x3_y) {
  QPoint tx2(x2_x, x2_y);
  QPoint tx3(x3_x, x3_y);
  QHoverEvent*tr = new QHoverEvent((QEvent::Type)x1, tx2, tx3);
  return (void*) tr;
}
Exemple #4
0
QTCEXPORT(void,qtc_QPainterPath_cubicTo_qth)(void* x0, double x1_x, double x1_y, double x2_x, double x2_y, double x3_x, double x3_y) {
  QPointF tx1(x1_x, x1_y);
  QPointF tx2(x2_x, x2_y);
  QPointF tx3(x3_x, x3_y);
  ((QPainterPath*)x0)->cubicTo(tx1, tx2, tx3);
}
Exemple #5
0
void
Warp::sync()
{
/*	cache_a=(-dest_tl[0]+dest_tr[0])/(src_br[1]-src_tl[1]);
	cache_b=(-dest_tl[0]+dest_bl[0])/(src_br[0]-src_tl[0]);
	cache_c=(dest_tl[0]-dest_tr[0]+dest_br[0]-dest_bl[0])/((src_br[1]-src_tl[1])*(src_br[0]-src_tl[0]));
	cache_d=dest_tl[0];

	cache_e=(-dest_tl[1]+dest_tr[1])/(src_br[0]-src_tl[0]);
	cache_f=(-dest_tl[1]+dest_bl[1])/(src_br[1]-src_tl[1]);
	cache_i=(dest_tl[1]-dest_tr[1]+dest_br[1]-dest_bl[1])/((src_br[1]-src_tl[1])*(src_br[0]-src_tl[0]));
	cache_j=dest_tl[1];
*/

/*	matrix[2][0]=(dest_tl[0]-dest_tr[0]+dest_br[0]-dest_bl[0])/((src_br[1]-src_tl[1])*(src_br[0]-src_tl[0]));
	matrix[2][1]=(dest_tl[1]-dest_tr[1]+dest_br[1]-dest_bl[1])/((src_br[1]-src_tl[1])*(src_br[0]-src_tl[0]));
	matrix[2][2]=quad_area(dest_tl,dest_tr,dest_br,dest_bl)/((src_br[1]-src_tl[1])*(src_br[0]-src_tl[0]));

	matrix[0][0]=-(-dest_tl[1]+dest_tr[1])/(src_br[0]-src_tl[0]);
	matrix[0][1]=-(-dest_tl[1]+dest_bl[1])/(src_br[1]-src_tl[1]);

	matrix[1][0]=-(-dest_tl[0]+dest_tr[0])/(src_br[1]-src_tl[1]);
	matrix[1][1]=-(-dest_tl[0]+dest_bl[0])/(src_br[0]-src_tl[0]);

	matrix[0][2]=matrix[0][0]*dest_tl[0] + matrix[0][1]*dest_tl[1];
	matrix[1][2]=matrix[1][0]*dest_tl[0] + matrix[1][1]*dest_tl[1];
*/
	Point src_tl=param_src_tl.get(Point());
	Point src_br=param_src_br.get(Point());
	Point dest_tl=param_dest_tl.get(Point());
	Point dest_tr=param_dest_tr.get(Point());
	Point dest_bl=param_dest_bl.get(Point());
	Point dest_br=param_dest_br.get(Point());
#define matrix tmp
	Real tmp[3][3];

	const Real& x1(min(src_br[0],src_tl[0]));
	const Real& y1(min(src_br[1],src_tl[1]));
	const Real& x2(max(src_br[0],src_tl[0]));
	const Real& y2(max(src_br[1],src_tl[1]));

	Real tx1(dest_bl[0]);
	Real ty1(dest_bl[1]);
	Real tx2(dest_br[0]);
	Real ty2(dest_br[1]);
	Real tx3(dest_tl[0]);
	Real ty3(dest_tl[1]);
	Real tx4(dest_tr[0]);
	Real ty4(dest_tr[1]);

	if(src_br[0]<src_tl[0])
		swap(tx3,tx4),swap(ty3,ty4),swap(tx1,tx2),swap(ty1,ty2);

	if(src_br[1]>src_tl[1])
		swap(tx3,tx1),swap(ty3,ty1),swap(tx4,tx2),swap(ty4,ty2);

	Real scalex;
	Real scaley;

  scalex = scaley = 1.0;

  if ((x2 - x1) > 0)
    scalex = 1.0 / (Real) (x2 - x1);

  if ((y2 - y1) > 0)
    scaley = 1.0 / (Real) (y2 - y1);

  /* Determine the perspective transform that maps from
   * the unit cube to the transformed coordinates
   */
  {
    Real dx1, dx2, dx3, dy1, dy2, dy3;

    dx1 = tx2 - tx4;
    dx2 = tx3 - tx4;
    dx3 = tx1 - tx2 + tx4 - tx3;

    dy1 = ty2 - ty4;
    dy2 = ty3 - ty4;
    dy3 = ty1 - ty2 + ty4 - ty3;

    /*  Is the mapping affine?  */
    if ((dx3 == 0.0) && (dy3 == 0.0))
      {
        matrix[0][0] = tx2 - tx1;
        matrix[0][1] = tx4 - tx2;
        matrix[0][2] = tx1;
        matrix[1][0] = ty2 - ty1;
        matrix[1][1] = ty4 - ty2;
        matrix[1][2] = ty1;
        matrix[2][0] = 0.0;
        matrix[2][1] = 0.0;
      }
    else
      {
        Real det1, det2;

        det1 = dx3 * dy2 - dy3 * dx2;
        det2 = dx1 * dy2 - dy1 * dx2;

        if (det1 == 0.0 && det2 == 0.0)
          matrix[2][0] = 1.0;
        else
          matrix[2][0] = det1 / det2;

        det1 = dx1 * dy3 - dy1 * dx3;

        if (det1 == 0.0 && det2 == 0.0)
          matrix[2][1] = 1.0;
        else
          matrix[2][1] = det1 / det2;

        matrix[0][0] = tx2 - tx1 + matrix[2][0] * tx2;
        matrix[0][1] = tx3 - tx1 + matrix[2][1] * tx3;
        matrix[0][2] = tx1;

        matrix[1][0] = ty2 - ty1 + matrix[2][0] * ty2;
        matrix[1][1] = ty3 - ty1 + matrix[2][1] * ty3;
        matrix[1][2] = ty1;
      }

    matrix[2][2] = 1.0;
  }
#undef matrix

	Real scaletrans[3][3]={
			{ scalex, 0, -x1*scalex },
			{ 0, scaley, -y1*scaley },
			{ 0, 0, 1 }
	};

	Real t1,t2,t3;

	for (int i = 0; i < 3; i++)
    {
      t1 = tmp[i][0];
      t2 = tmp[i][1];
      t3 = tmp[i][2];

      for (int j = 0; j < 3; j++)
        {
          matrix[i][j]  = t1 * scaletrans[0][j];
          matrix[i][j] += t2 * scaletrans[1][j];
          matrix[i][j] += t3 * scaletrans[2][j];
        }
    }

	mat3_invert(matrix, inv_matrix);
/*
	gimp_matrix3_identity  (result);
  gimp_matrix3_translate (result, -x1, -y1);
  gimp_matrix3_scale     (result, scalex, scaley);
  gimp_matrix3_mult      (&matrix, result);
*/
}