Example #1
0
static SeedValue
seed_cairo_surface_get_content (SeedContext ctx,
				SeedObject this_object,
				SeedString property_name,
				SeedException *exception)
{
  CHECK_THIS();
  return seed_value_from_long (ctx, cairo_surface_get_content (seed_object_to_cairo_surface(ctx, this_object, exception)), exception);
}
Example #2
0
static SeedValue
seed_cairo_surface_has_show_text_glyphs(SeedContext ctx,
					SeedObject function,
					SeedObject this_object,
					gsize argument_count,
					const SeedValue arguments[],
					SeedException *exception)
{
  CHECK_THIS();
  return seed_value_from_boolean (ctx,
				  cairo_surface_has_show_text_glyphs (seed_object_to_cairo_surface(ctx, this_object, exception)), exception);
}
Example #3
0
static SeedValue
seed_cairo_surface_show_page (SeedContext ctx,
			      SeedObject function,
			      SeedObject this_object,
			      gsize argument_count,
			      const SeedValue arguments[],
			      SeedException *exception)
{
  CHECK_THIS();
  cairo_surface_show_page (seed_object_to_cairo_surface(ctx, this_object, exception));
  return seed_make_undefined (ctx);
}
Example #4
0
static SeedValue
seed_cairo_surface_get_fallback_resolution(SeedContext ctx,
					   SeedObject this_object,
					   SeedString property_name,
					   SeedException *exception)
{
  SeedValue offsets[2];
  cairo_surface_t *surf;
  gdouble x, y;
  CHECK_THIS();

  surf = seed_object_to_cairo_surface (ctx, this_object, exception);
  cairo_surface_get_fallback_resolution (surf, &x, &y);

  offsets[0] = seed_value_from_double (ctx, x, exception);
  offsets[1] = seed_value_from_double (ctx, y, exception);

  return seed_make_array (ctx, offsets, 2, exception);
}
static SeedValue
seed_cairo_pdf_surface_set_size (SeedContext ctx,
				 SeedObject function,
				 SeedObject this_object,
				 gsize argument_count,
				 const SeedValue arguments[],
				 SeedException *exception)
{
  cairo_surface_t *surf;
  gdouble x, y;

  CHECK_THIS();
  if (argument_count != 2)
    {
      EXPECTED_EXCEPTION("set_size", "2 arguments");
    }
  surf = seed_object_get_private (this_object);
  x = seed_value_to_double (ctx, arguments[0], exception);
  y = seed_value_to_double (ctx, arguments[1], exception);

  cairo_pdf_surface_set_size (surf, x, y);

  return seed_make_undefined (ctx);
}
Example #6
0
void CGEN_PUBLIC CVmap_MapVectorF
#else
void CGEN_PUBLIC CVmap_MapVectorD
#endif
(
  CVmap*  _this,
  VMAP_FTYPE* lpX,
  VMAP_FTYPE* lpY,
  INT32    nXdim,
  INT32    nYdim
)
{
  BOOL    f  = 1;                                                               /* First non-zero summand flag       */
  INT32    n  = 0;                                                               /* Input dimension loop counter      */
  INT32    m  = 0;                                                               /* Output dimension loop counter     */
  INT32    N  = 0;                                                               /* Input dimensionality of mapping   */
  INT32    M  = 0;                                                               /* Output dimensionality of mapping  */
  VMAP_FTYPE* W  = NULL;                                                        /* Pointer to transformation matrix  */
  VMAP_FTYPE* Wm = NULL;                                                        /* Pointer to column m of trafo.mtx. */

  /* Initialize */                                                              /* --------------------------------- */
  CHECK_THIS();                                                                 /* Check this pointer                */
  if (!lpY) return;                                                             /* No output buffer, no service      */
  DLPASSERT(lpX!=lpY);                                                          /* Check in-/output ptrs. not equal  */
  for (m=0; m<nYdim; m++) lpY[m]=_this->m_nZero;                                /* Initialize output vector          */
  if (!lpX) return;                                                             /* If no input vector -> all done    */
  N = CData_GetNComps(AS(CData,_this->m_idTmx));                                /* Get mapping input dimensionality  */
  M = CData_GetNRecs(AS(CData,_this->m_idTmx));                                 /* Get mapping output dimensionality */
  if (nXdim>N) nXdim = N;                                                       /* Clip input dim. to mapping dim.   */
  if (nYdim>M) nYdim = M;                                                       /* Clip output dim. to mapping dim.  */
  if(CData_IsEmpty(AS(CData,_this->m_idWeakTmx)))                               /* Do not use weak tmx               */
  {                                                                             /* >>                                */
    W = (VMAP_FTYPE*)CData_XAddr(AS(CData,_this->m_idTmx),0,0);                 /*   Get pointer to trafo. matrix    */
     if (!W) return;                                                             /*   No trafo. mat., also no service */

    /* Compute generalized scalar product for each y[m] */                      /*   ------------------------------- */
    for (m=0; m<nYdim; m++)                                                     /*   Loop over output dimensions     */
      for (n=0,f=1,Wm=&W[m*N]; n<nXdim; n++)                                    /*     Loop over input dimensions    */
        if (Wm[n]!=_this->m_nZero)                                              /*       Weight of comp. n non-zero  */
        {                                                                       /*       >>                          */
          if (f)                                                                /*         First summand             */
          {                                                                     /*         >>                        */
            lpY[m] = DLP_SCALOP(Wm[n],lpX[n],_this->m_nWop);                    /*           Skip aggregation op     */
            f      = 0;                                                         /*           This WAS the first one..*/
          }                                                                     /*         <<                        */
          else                                                                  /*         Second and further summd's*/
            lpY[m] = DLP_SCALOP(lpY[m],DLP_SCALOP(Wm[n],lpX[n],_this->m_nWop),  /*           Weight & aggregate      */
              _this->m_nAop);                                                   /*           |                       */
        }                                                                       /*       <<                          */
  }else{                                                                        /* << Use weak tmx >>                */
    BYTE*   Id = NULL;                                                          /*   Pointer to index vector         */
    INT32 nRecLen = CData_GetRecLen(AS(CData,_this->m_idWeakTmx));               /*   Get size of one record          */
    INT16 nIType = CData_GetCompType(AS(CData,_this->m_idWeakTmx),0);
    nXdim = CData_GetNRecs(AS(CData,_this->m_idWeakTmx));                       /*   Get max. numb. of out's per in  */
    for (m=0;m<nYdim;m++)                                                       /*   Loop over output dimensions     */
    {                                                                           /*   >>                              */
      Id=CData_XAddr(AS(CData,_this->m_idWeakTmx),0,m*2);                       /*     Get start adress of component */
      switch(nIType){
      case T_LONG:
        for (n=0;n<nXdim && *((INT64*)Id)>=0;n++,Id+=nRecLen)                    /*       Loop over in's for this out */
          if(!n) lpY[m]=DLP_SCALOP(*((VMAP_FTYPE *)(Id+sizeof(INT64))),          /*         First input =>            */
            lpX[*((INT64*)Id)],_this->m_nWop);                                   /*         | Calc out from in        */
          else lpY[m]=DLP_SCALOP(lpY[m],                                        /*         Else => Calc out from     */
            DLP_SCALOP(*((VMAP_FTYPE *)(Id+sizeof(INT64))),                      /*         |                         */
            lpX[*((INT64*)Id)],_this->m_nWop),_this->m_nAop);                    /*         | prev. out and in        */
      break;
      case T_INT:
        for (n=0;n<nXdim && *((INT32*)Id)>=0;n++,Id+=nRecLen)                     /*       Loop over in's for this out */
          if(!n) lpY[m]=DLP_SCALOP(*((VMAP_FTYPE *)(Id+sizeof(INT32))),           /*         First input =>            */
            lpX[*((INT32*)Id)],_this->m_nWop);                                    /*         | Calc out from in        */
          else lpY[m]=DLP_SCALOP(lpY[m],                                        /*         Else => Calc out from     */
            DLP_SCALOP(*((VMAP_FTYPE *)(Id+sizeof(INT32))),                       /*         |                         */
            lpX[*((INT32*)Id)],_this->m_nWop),_this->m_nAop);                     /*         | prev. out and in        */
      break;
      default:
        IERROR(_this,ERR_INVALARG,"weaktmx int type is wheter int nor long",0,0);
      }
    }                                                                           /*   <<                              */
  }                                                                             /* <<                                */
}