您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GEGL_OPERATION_AREA_FILTER函数代码示例

51自学网 2021-06-01 20:50:22
  C++
这篇教程C++ GEGL_OPERATION_AREA_FILTER函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GEGL_OPERATION_AREA_FILTER函数的典型用法代码示例。如果您正苦于以下问题:C++ GEGL_OPERATION_AREA_FILTER函数的具体用法?C++ GEGL_OPERATION_AREA_FILTER怎么用?C++ GEGL_OPERATION_AREA_FILTER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GEGL_OPERATION_AREA_FILTER函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prepare

static void prepare (GeglOperation *operation){    GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);    area->left = area->right = area->top = area->bottom =            GEGL_CHANT_PROPERTIES (operation)->radius;    gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));}
开发者ID:jcupitt,项目名称:gegl-vips,代码行数:7,


示例2: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *area      = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties          *o         = GEGL_PROPERTIES (operation);  const Babl              *in_format = gegl_operation_get_source_format (operation, "input");  const Babl              *format    = babl_format ("RGB float");  area->left   =  area->right  =  area->top    =  area->bottom = o->radius;  o->user_data = g_renew (gint, o->user_data, o->radius + 1);  init_neighborhood_outline (o->neighborhood, o->radius, o->user_data);  if (in_format)    {      if (babl_format_has_alpha (in_format))        format = babl_format ("RGBA float");    }  gegl_operation_set_format (operation, "input", format);  gegl_operation_set_format (operation, "output", format);}
开发者ID:elEnemigo,项目名称:GEGL-OpenCL,代码行数:25,


示例3: prepare

static void prepare (GeglOperation *operation){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  area->right = area->bottom = 1;  gegl_operation_set_format (operation, "output", babl_format ("RGB float"));}
开发者ID:joyoseller,项目名称:GEGL-OpenCL,代码行数:7,


示例4: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *roi,         gint                 level){  GeglRectangle src_rect;  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);  GeglOperationAreaFilter *op_area;  gfloat* buf;  op_area = GEGL_OPERATION_AREA_FILTER (operation);  src_rect = *roi;  src_rect.x -= op_area->left;  src_rect.y -= op_area->top;  src_rect.width += op_area->left + op_area->right;  src_rect.height += op_area->top + op_area->bottom;  buf = g_new0 (gfloat, src_rect.width * src_rect.height * 4);  gegl_buffer_get (input, &src_rect, 1.0, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);  dot(buf, roi, o);  gegl_buffer_set (output, roi, 0, babl_format ("RGBA float"), buf, GEGL_AUTO_ROWSTRIDE);  g_free (buf);  return  TRUE;}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:30,


示例5: cl_process

static gbooleancl_process (GeglOperation       *operation,            GeglBuffer          *input,            GeglBuffer          *output,            const GeglRectangle *result){  const Babl *in_format  = gegl_operation_get_format (operation, "input");  const Babl *out_format = gegl_operation_get_format (operation, "output");  gint err;  gint j;  cl_int cl_err;  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);  GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,   result, out_format, GEGL_CL_BUFFER_WRITE, GEGL_ABYSS_NONE);                gint read = gegl_buffer_cl_iterator_add_2 (i, input, result, in_format, GEGL_CL_BUFFER_READ, op_area->left, op_area->right, op_area->top, op_area->bottom, GEGL_ABYSS_NONE);  while (gegl_buffer_cl_iterator_next (i, &err))  {    if (err) return FALSE;    for (j=0; j < i->n; j++)    {      cl_err = cl_bilateral_filter(i->tex[read][j], i->tex[0][j], i->size[0][j], &i->roi[0][j], ceil(o->blur_radius), o->edge_preservation);      if (cl_err != CL_SUCCESS)      {        g_warning("[OpenCL] Error in gegl:bilateral-filter: %s", gegl_cl_errstring(cl_err));        return FALSE;      }    }  }  return TRUE;}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:32,


示例6: cl_process

static gbooleancl_process (GeglOperation       *operation,            GeglBuffer          *input,            GeglBuffer          *output,            const GeglRectangle *result){  const Babl *in_format  = gegl_operation_get_format (operation, "input");  const Babl *out_format = gegl_operation_get_format (operation, "output");  gint err;  gint j;  cl_int cl_err;  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,   result, out_format, GEGL_CL_BUFFER_WRITE, GEGL_ABYSS_NONE);  gint read = gegl_buffer_cl_iterator_add_2 (i, input, result, in_format,  GEGL_CL_BUFFER_READ, op_area->left, op_area->right, op_area->top, op_area->bottom, GEGL_ABYSS_NONE);  gint aux  = gegl_buffer_cl_iterator_add_2 (i, NULL, result, in_format,  GEGL_CL_BUFFER_AUX, op_area->left, op_area->right, op_area->top, op_area->bottom, GEGL_ABYSS_NONE);  while (gegl_buffer_cl_iterator_next (i, &err))  {    if (err) return FALSE;    for (j=0; j < i->n; j++)    {      cl_err = cl_edge_laplace(i->tex[read][j], i->tex[aux][j], i->tex[0][j], &i->roi[read][j], &i->roi[0][j], LAPLACE_RADIUS);      if (cl_err != CL_SUCCESS)      {        g_warning("[OpenCL] Error in gegl:edge-laplace: %s", gegl_cl_errstring(cl_err));        return FALSE;      }    }  }  return TRUE;}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:32,


示例7: prepare_cl

static voidprepare_cl (GeglOperation *operation){    GeglOperationAreaFilter* op_area = GEGL_OPERATION_AREA_FILTER (operation);    GeglChantO* o = GEGL_CHANT_PROPERTIES (operation);    gdouble theta = o->angle * G_PI / 180.0;    gdouble offset_x = fabs(o->length * cos(theta));    gdouble offset_y = fabs(o->length * sin(theta));    op_area->left   =        op_area->right  = (gint)ceil(0.5 * offset_x);    op_area->top    =        op_area->bottom = (gint)ceil(0.5 * offset_y);    GeglNode * self;    GeglPad *pad;    Babl * format=babl_format ("RaGaBaA float");    self=gegl_operation_get_source_node(operation,"input");    while(self) {        if(strcmp(gegl_node_get_operation(self),"gimp:tilemanager-source")==0) {            format=gegl_operation_get_format(self->operation,"output");            break;        }        self=gegl_operation_get_source_node(self->operation,"input");    }    gegl_operation_set_format (operation, "output", format);}
开发者ID:peixuan,项目名称:GEGL-OpenCL,代码行数:28,


示例8: prepare

static voidprepare (GeglOperation *operation){  GeglProperties          *o       = GEGL_PROPERTIES (operation);  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  const Babl              *format;  if (o->direction == GEGL_ORIENTATION_HORIZONTAL)    {      op_area->left   = o->shift;      op_area->right  = o->shift;      op_area->top    = 0;      op_area->bottom = 0;    }  else if (o->direction == GEGL_ORIENTATION_VERTICAL)    {      op_area->top    = o->shift;      op_area->bottom = o->shift;      op_area->left   = 0;      op_area->right  = 0;    }  format = gegl_operation_get_source_format (operation, "input");  gegl_operation_set_format (operation, "input",  format);  gegl_operation_set_format (operation, "output", format);}
开发者ID:don-mccomb,项目名称:gegl,代码行数:27,


示例9: prepare

static voidprepare (GeglOperation *operation){  GeglChantO              *o;  GeglOperationAreaFilter *op_area;  op_area = GEGL_OPERATION_AREA_FILTER (operation);  o       = GEGL_CHANT_PROPERTIES (operation);  if (o->chant_data)    {      g_hash_table_destroy (o->chant_data);      o->chant_data = NULL;    }  op_area->left   = o->strength;  op_area->right  = o->strength;  op_area->top    = o->strength;  op_area->bottom = o->strength;  gegl_operation_set_format (operation, "input",                             babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output",                             babl_format ("RGBA float"));}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:25,


示例10: get_bounding_box

static GeglRectangleget_bounding_box (GeglOperation *operation){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  GeglRectangle            result = { 0, };  GeglRectangle           *in_rect;  in_rect = gegl_operation_source_get_bounding_box (operation,"input");  if (!in_rect)    return result;  if (gegl_rectangle_is_infinite_plane (in_rect))    return *in_rect;  result = *in_rect;  if (result.width != 0 &&      result.height != 0)    {      result.x-= area->left;      result.y-= area->top;      result.width += area->left + area->right;      result.height += area->top + area->bottom;    }  return result;}
开发者ID:GNOME,项目名称:gegl,代码行数:27,


示例11: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglChantO              *o       = GEGL_CHANT_PROPERTIES (operation);  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglRectangle  rect;  gfloat        *src_buf;  gfloat        *dst_buf;  gchar         *type;  gint           alpha;  gint           x;  gint           floats_per_pixel;  /*blur-map or emboss*/  if (o->filter && !strcmp (o->filter, "blur-map"))    {      type = "RGBA float";      floats_per_pixel = 4;      alpha = 1;    }  else    {      type = "Y float";      floats_per_pixel = 1;      alpha = 0;    }  rect.x      = result->x - op_area->left;  rect.width  = result->width + op_area->left + op_area->right;  rect.y      = result->y - op_area->top;  rect.height = result->height + op_area->top + op_area->bottom;  src_buf = g_new0 (gfloat, rect.width * rect.height * floats_per_pixel);  dst_buf = g_new0 (gfloat, rect.width * rect.height * floats_per_pixel);  gegl_buffer_get (input, &rect, 1.0, babl_format (type), src_buf,                   GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);  /*do for every row*/  for (x = 0; x < rect.height; x++)    emboss (src_buf, &rect, dst_buf, &rect, x, type, floats_per_pixel, alpha,            DEG_TO_RAD (o->azimuth), DEG_TO_RAD (o->elevation), o->depth);  gegl_buffer_set (output, &rect, 0, babl_format (type),                   dst_buf, GEGL_AUTO_ROWSTRIDE);  g_free (src_buf);  g_free (dst_buf);  return TRUE;}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:57,


示例12: prepare

static void prepare (GeglOperation *operation){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  //GeglChantO              *o = GEGL_CHANT_PROPERTIES (operation);  area->left = area->right = area->top = area->bottom = LAPLACE_RADIUS;  gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:9,


示例13: cl_process

static gbooleancl_process (GeglOperation       *operation,            GeglBuffer          *input,            GeglBuffer          *output,            const GeglRectangle *result){  const Babl *in_format  = gegl_operation_get_format (operation, "input");  const Babl *out_format = gegl_operation_get_format (operation, "output");  gint err;  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);  GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,                                                         result,                                                         out_format,                                                         GEGL_CL_BUFFER_WRITE);  gint read = gegl_buffer_cl_iterator_add_2 (i,                                             input,                                             result,                                             in_format,                                             GEGL_CL_BUFFER_READ,                                             op_area->left,                                             op_area->right,                                             op_area->top,                                             op_area->bottom,                                             GEGL_ABYSS_NONE);  gint aux  = gegl_buffer_cl_iterator_add_2 (i,                                             NULL,                                             result,                                             in_format,                                             GEGL_CL_BUFFER_AUX,                                             0,                                             0,                                             op_area->top,                                             op_area->bottom,                                             GEGL_ABYSS_NONE);  while (gegl_buffer_cl_iterator_next (i, &err))    {      if (err) return FALSE;      err = cl_box_max(i->tex[read],                       i->tex[aux],                       i->tex[0],                       i->size[0],                       &i->roi[0],                       ceil (o->radius));      if (err) return FALSE;    }  return TRUE;}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:57,


示例14: cl_process

static gbooleancl_process (GeglOperation       *operation,            GeglBuffer          *input,            GeglBuffer          *output,            const GeglRectangle *result){  const Babl *in_format  = gegl_operation_get_format (operation, "input");  const Babl *out_format = gegl_operation_get_format (operation, "output");  gint err = 0;  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties *o = GEGL_PROPERTIES (operation);  GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,                                                         result,                                                         out_format,                                                         GEGL_CL_BUFFER_WRITE);  gint read = gegl_buffer_cl_iterator_add_2 (i,                                             input,                                             result,                                             in_format,                                             GEGL_CL_BUFFER_READ,                                             op_area->left,                                             op_area->right,                                             op_area->top,                                             op_area->bottom,                                             GEGL_ABYSS_CLAMP);  gint aux = gegl_buffer_cl_iterator_add_aux (i,                                              result,                                              in_format,                                              0,                                              0,                                              op_area->top,                                              op_area->bottom);  while (gegl_buffer_cl_iterator_next (i, &err) && !err)    {      err = cl_box_blur (i->tex[read],                         i->tex[aux],                         i->tex[0],                         i->size[0],                         &i->roi[0],                         o->radius);      if (err)        {          gegl_buffer_cl_iterator_stop (i);          break;        }    }  return !err;}
开发者ID:kleopatra999,项目名称:gegl,代码行数:56,


示例15: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  op_area->left = op_area->right = op_area->top = op_area->bottom = HALF_WINDOW;  gegl_operation_set_format (operation, "output",                             babl_format ("RGBA float"));}
开发者ID:Distrotech,项目名称:gegl,代码行数:10,


示例16: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *area   = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties          *o      = GEGL_PROPERTIES (operation);  const Babl              *format = babl_format ("R'G'B'A float");  area->left = area->right = area->top = area->bottom = o->iterations;  gegl_operation_set_format (operation, "input",  format);  gegl_operation_set_format (operation, "output", format);}
开发者ID:jonnor,项目名称:gegl,代码行数:12,


示例17: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result){  GeglChantO              *o        = GEGL_CHANT_PROPERTIES (operation);  GeglOperationAreaFilter *op_area  = GEGL_OPERATION_AREA_FILTER (operation);  Babl                    *format   = babl_format ("RGBA float");  GeglRectangle            rect;  GeglRectangle            boundary = get_effective_area (operation);  gint                     x, y;  gfloat                  *dst_buf, *src_buf;  rect.x      = CLAMP (result->x - op_area->left, boundary.x, boundary.x +                       boundary.width);  rect.width  = CLAMP (result->width + op_area->left + op_area->right, 0,                       boundary.width);  rect.y      = CLAMP (result->y - op_area->top, boundary.y, boundary.y +                       boundary.width);  rect.height = CLAMP (result->height + op_area->top + op_area->bottom, 0,                       boundary.height);  dst_buf = g_new0 (gfloat, result->height * result->width * 4);  src_buf = g_new0 (gfloat, rect.height * rect.width * 4);  gegl_buffer_get (input, 1.0, result, format, dst_buf, GEGL_AUTO_ROWSTRIDE);  gegl_buffer_get (input, 1.0, &rect, format, src_buf, GEGL_AUTO_ROWSTRIDE);  if (o->horizontal)    {      for (y = result->y; y < result->y + result->height; y++)        if ((o->even && (y % 2 == 0)) || (!o->even && (y % 2 != 0)))          deinterlace_horizontal (src_buf, dst_buf, result, &rect, &boundary,                                  o->even ? 0 : 1,                                  y, o->size);    }  else    {      for (x = result->x; x < result->x + result->width; x++)        if ((o->even && (x % 2 == 0)) || (!o->even && (x % 2 != 0)))          deinterlace_vertical (src_buf, dst_buf, result, &rect, &boundary,                                o->even ? 0 : 1,                                x, o->size);    }  gegl_buffer_set (output, result, format, dst_buf, GEGL_AUTO_ROWSTRIDE);  g_free (src_buf);  g_free (dst_buf);  return  TRUE;}
开发者ID:joyoseller,项目名称:GEGL-OpenCL,代码行数:53,


示例18: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties          *o    = GEGL_PROPERTIES (operation);  area->left = area->right = ceil (fabs (o->glow_radius)) +1;  area->top = area->bottom = ceil (fabs (o->glow_radius)) +1;  gegl_operation_set_format (operation, "input",                             babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output",                             babl_format ("RGBA float"));}
开发者ID:don-mccomb,项目名称:gegl,代码行数:14,


示例19: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties          *o       = GEGL_PROPERTIES (operation);  op_area->left   = o->amplitude;  op_area->right  = o->amplitude;  op_area->top    = o->amplitude;  op_area->bottom = o->amplitude;  gegl_operation_set_format (operation, "input",  babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));}
开发者ID:jonnor,项目名称:gegl,代码行数:14,


示例20: get_invalidated_by_change

static GeglRectangleget_invalidated_by_change (GeglOperation        *operation,                           const gchar         *input_pad,                           const GeglRectangle *input_region){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  GeglRectangle            retval;  retval.x      = input_region->x - area->left;  retval.y      = input_region->y - area->top;  retval.width  = input_region->width  + area->left + area->right;  retval.height = input_region->height + area->top  + area->bottom;  return retval;}
开发者ID:GNOME,项目名称:gegl,代码行数:15,


示例21: prepare

static voidprepare (GeglOperation *operation){  GeglChantO              *o       = GEGL_CHANT_PROPERTIES (operation);  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  op_area->left = op_area->right = op_area->top = op_area->bottom = 3;  if (o->filter && !strcmp(o->filter, "blur-map"))    gegl_operation_set_format (operation, "output",                               babl_format ("RGBA float"));  else    gegl_operation_set_format (operation, "output",                               babl_format ("Y float"));}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:15,


示例22: cl_process

static gbooleancl_process (GeglOperation       *operation,            GeglBuffer          *input,            GeglBuffer          *output,            const GeglRectangle *result,            gboolean             has_alpha){  const Babl *in_format  = babl_format ("RGBA float");  const Babl *out_format = babl_format ("RGBA float");  gint err;  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);  GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,                                                         result,                                                         out_format,                                                         GEGL_CL_BUFFER_WRITE);  gint read = gegl_buffer_cl_iterator_add_2 (i,                                             input,                                             result,                                             in_format,                                             GEGL_CL_BUFFER_READ,                                             op_area->left,                                             op_area->right,                                             op_area->top,                                             op_area->bottom,                                             GEGL_ABYSS_NONE);  while (gegl_buffer_cl_iterator_next (i, &err))    {      if (err) return FALSE;      err = cl_edge_sobel(i->tex[read],                          i->tex[0],                          i->size[0],                          &i->roi[0],                          o->horizontal,                          o->vertical,                          o->keep_signal,                          has_alpha);      if (err) return FALSE;    }  return TRUE;}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:48,


示例23: prepare

static void prepare (GeglOperation *operation){  GeglChantO              *o;  GeglOperationAreaFilter *op_area;  op_area = GEGL_OPERATION_AREA_FILTER (operation);  o       = GEGL_CHANT_PROPERTIES (operation);  op_area->left   =  op_area->right  =  op_area->top    =  op_area->bottom = o->radius;  gegl_operation_set_format (operation, "input",  babl_format ("RaGaBaA float"));  gegl_operation_set_format (operation, "output", babl_format ("RaGaBaA float"));}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:16,


示例24: prepare

static void prepare (GeglOperation *operation){  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  //GeglChantO              *o = GEGL_CHANT_PROPERTIES (operation);  const Babl *source_format = gegl_operation_get_source_format (operation, "input");  area->left = area->right = area->top = area->bottom = SOBEL_RADIUS;  gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));  if (source_format && !babl_format_has_alpha (source_format))    gegl_operation_set_format (operation, "output", babl_format ("RGB float"));  else    gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:16,


示例25: prepare

static voidprepare (GeglOperation *operation){    GeglOperationAreaFilter* op_area = GEGL_OPERATION_AREA_FILTER (operation);    GeglChantO* o = GEGL_CHANT_PROPERTIES (operation);    gdouble theta = o->angle * G_PI / 180.0;    gdouble offset_x = fabs(o->length * cos(theta));    gdouble offset_y = fabs(o->length * sin(theta));    op_area->left   =        op_area->right  = (gint)ceil(0.5 * offset_x);    op_area->top    =        op_area->bottom = (gint)ceil(0.5 * offset_y);    gegl_operation_set_format (operation, "output", babl_format ("RaGaBaA float"));}
开发者ID:peixuan,项目名称:GEGL-OpenCL,代码行数:17,


示例26: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglProperties              *o       = GEGL_PROPERTIES (operation);  GeglRectangle           *whole_region;  gdouble                  angle   = o->angle * G_PI / 180.0;  while (angle < 0.0)    angle += 2 * G_PI;  whole_region = gegl_operation_source_get_bounding_box (operation, "input");  if (whole_region != NULL)    {      gdouble center_x = gegl_coordinate_relative_to_pixel (o->center_x,                                                             whole_region->width);      gdouble center_y = gegl_coordinate_relative_to_pixel (o->center_y,                                                            whole_region->height);      gdouble maxr_x = MAX (fabs (center_x - whole_region->x),                            fabs (center_x - whole_region->x - whole_region->width));      gdouble maxr_y = MAX (fabs (center_y - whole_region->y),                            fabs (center_y - whole_region->y - whole_region->height));      if (angle >= G_PI)        angle = G_PI;      op_area->left = op_area->right        = ceil (maxr_y * sin (angle / 2.0)) + 1;      op_area->top = op_area->bottom        = ceil (maxr_x * sin (angle / 2.0)) + 1;    }  else    {      op_area->left   =      op_area->right  =      op_area->top    =      op_area->bottom = 0;    }  gegl_operation_set_format (operation, "input",  babl_format ("RaGaBaA float"));  gegl_operation_set_format (operation, "output", babl_format ("RaGaBaA float"));}
开发者ID:Distrotech,项目名称:gegl,代码行数:44,


示例27: prepare

static void prepare (GeglOperation *operation){#define max(A,B) ((A) > (B) ? (A) : (B))  GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);  GeglChantO              *o    = GEGL_CHANT_PROPERTIES (operation);  gfloat fir_radius_x = fir_calc_convolve_matrix_length (o->std_dev_x) / 2;  gfloat fir_radius_y = fir_calc_convolve_matrix_length (o->std_dev_y) / 2;  gfloat iir_radius_x = o->std_dev_x * RADIUS_SCALE;    gfloat iir_radius_y = o->std_dev_y * RADIUS_SCALE;    /* XXX: these should be calculated exactly considering o->filter, but we just   * make sure there is enough space */  area->left = area->right = ceil ( max (fir_radius_x, iir_radius_x));  area->top = area->bottom = ceil ( max (fir_radius_y, iir_radius_y));  gegl_operation_set_format (operation, "output",                             babl_format ("RaGaBaA float"));#undef max}
开发者ID:jcupitt,项目名称:gegl-vips,代码行数:20,


示例28: prepare

static void prepare (GeglOperation *operation){  GeglChantO              *o       = GEGL_CHANT_PROPERTIES (operation);  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  gint tmp;  /*   * Calculate the needed extension for the ROI   *      MAX (o->tile_size +   *           g_rand_double_range (gr, 0, o->tile_size / 4.0) -   *           o->tile_size / 8.0) * o->tile_saturation)   */  tmp = ceil ((9 * o->tile_size / 8.0) * o->tile_saturation);  op_area->left = op_area->right = op_area->top = op_area->bottom = tmp;  gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output", babl_format ("RGBA float"));}
开发者ID:AjayRamanathan,项目名称:gegl,代码行数:20,


示例29: prepare

static voidprepare (GeglOperation *operation){    const Babl *input_format = gegl_operation_get_source_format (operation, "input");    const Babl *format;    GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);    if (input_format == NULL || babl_format_has_alpha (input_format))        format = babl_format ("R'G'B'A float");    else        format = babl_format ("R'G'B' float");    gegl_operation_set_format (operation, "input", format);    gegl_operation_set_format (operation, "output", format);    op_area->left   =        op_area->right  =            op_area->top    =                op_area->bottom = 1;}
开发者ID:GNOME,项目名称:gegl,代码行数:21,


示例30: prepare

static voidprepare (GeglOperation *operation){  GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);  GeglChantO              *o       = GEGL_CHANT_PROPERTIES (operation);  if (o->orientation == GEGL_ORIENTATION_HORIZONTAL)    {      op_area->left = op_area->right = 0;      op_area->top = op_area->bottom = o->size + 1;    }  else    {      op_area->left = op_area->right = o->size + 1;      op_area->top = op_area->bottom = 0;    }  gegl_operation_set_format (operation, "input",                             babl_format ("RGBA float"));  gegl_operation_set_format (operation, "output",                             babl_format ("RGBA float"));}
开发者ID:ChristianBusch,项目名称:gegl,代码行数:22,



注:本文中的GEGL_OPERATION_AREA_FILTER函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GEGL_OPERATION_CLASS函数代码示例
C++ GEGL_IS_BUFFER函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。