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

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

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

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

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

示例1: process

/* GeglOperationPointFilter gives us a linear buffer to operate on * in our requested pixel format */static gbooleanprocess (GeglOperation       *op,         void                *in_buf,         void                *out_buf,         glong                n_pixels,         const GeglRectangle *roi,         gint                 level){    GeglProperties   *o         = GEGL_PROPERTIES (op);    gfloat       *in_pixel  = in_buf;    gfloat       *out_pixel = out_buf;    const gfloat *coeffs    = o->user_data;    in_pixel = in_buf;    out_pixel = out_buf;    if (! coeffs)    {        coeffs = o->user_data = preprocess (o);    }    while (n_pixels--)    {        out_pixel[0] = in_pixel[0] * coeffs[0];        out_pixel[1] = in_pixel[1] * coeffs[1];        out_pixel[2] = in_pixel[2] * coeffs[2];        out_pixel[3] = in_pixel[3];        in_pixel += 4;        out_pixel += 4;    }    return TRUE;}
开发者ID:GNOME,项目名称:gegl,代码行数:37,


示例2: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties *o = GEGL_PROPERTIES (operation);  gint        problem;  gint        width, height;  Babl        *format = NULL;  GError *err = NULL;  GFile *infile = NULL;  GInputStream *stream = gegl_gio_open_input_stream(o->uri, o->path, &infile, &err);  WARN_IF_ERROR(err);  problem = gegl_buffer_import_png (output, stream, 0, 0,                                    &width, &height, format, &err);  WARN_IF_ERROR(err);  g_input_stream_close(stream, NULL, NULL);  if (problem)    {      g_object_unref(infile);      g_object_unref(stream);      g_warning ("%s failed to open file %s for reading.",                 G_OBJECT_TYPE_NAME (operation), o->path);      return FALSE;    }  if (infile) g_object_unref(infile);  g_object_unref(stream);  return TRUE;}
开发者ID:OpenCL,项目名称:GEGL-OpenCL,代码行数:31,


示例3: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties   *o = GEGL_PROPERTIES (operation);  GeglBuffer   *temp_in;  GeglRectangle compute  = gegl_operation_get_required_for_output (operation, "input", result);  if (result->width == 0 ||      result->height== 0 ||      o->radius < 1.0)    {      output = g_object_ref (input);    }  else    {      temp_in = gegl_buffer_create_sub_buffer (input, &compute);      snn_percentile (temp_in, output, o->radius, o->percentile, o->pairs);      g_object_unref (temp_in);    }  return  TRUE;}
开发者ID:don-mccomb,项目名称:gegl,代码行数:26,


示例4: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties *o = GEGL_PROPERTIES (operation);  Priv *p = (Priv*) o->user_data;  if (p->config != NULL)    {      if (p->decoder != NULL)        {          if (decode_from_stream (p->stream, p->decoder) < 0)            {              g_warning ("failed decoding WebP image file");              cleanup (operation);              return FALSE;            }          g_input_stream_close (G_INPUT_STREAM (p->stream), NULL, NULL);          g_clear_object (&p->stream);          WebPIDelete (p->decoder);          p->decoder = NULL;        }      gegl_buffer_set (output, result, 0, p->format,                       p->config->output.u.RGBA.rgba,                       p->config->output.u.RGBA.stride);    }  return FALSE;}
开发者ID:OpenCL,项目名称:GEGL-OpenCL,代码行数:34,


示例5: 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,


示例6: process

/* For GeglOperationPointFilter subclasses, we operate on linear * buffers with a pixel count. */static gbooleanprocess (GeglOperation       *op,         void                *in_buf,         void                *out_buf,         glong                n_pixels,         const GeglRectangle *roi,         gint                 level){  /* Retrieve a pointer to GeglProperties structure which contains all the   * chanted properties   */  GeglProperties *o = GEGL_PROPERTIES (op);  gfloat     * GEGL_ALIGNED in_pixel;  gfloat     * GEGL_ALIGNED out_pixel;  gfloat      brightness, contrast;  glong       i;  in_pixel   = in_buf;  out_pixel  = out_buf;  brightness = o->brightness;  contrast   = o->contrast;  for (i=0; i<n_pixels; i++)    {      out_pixel[0] = (in_pixel[0] - 0.5f) * contrast + brightness + 0.5;      out_pixel[1] = (in_pixel[1] - 0.5f) * contrast + brightness + 0.5;      out_pixel[2] = (in_pixel[2] - 0.5f) * contrast + brightness + 0.5;      out_pixel[3] = in_pixel[3]; /* copy the alpha */      in_pixel  += 4;      out_pixel += 4;    }  return TRUE;}
开发者ID:don-mccomb,项目名称:gegl,代码行数:37,


示例7: get_required_for_output

static GeglRectangleget_required_for_output (GeglOperation       *operation,                         const gchar         *input_pad,                         const GeglRectangle *roi){  GeglRectangle result = *roi;  if (! is_nop (operation))    {      GeglProperties *o       = GEGL_PROPERTIES (operation);      GeglRectangle  *in_rect = gegl_operation_source_get_bounding_box (operation, "input");      if (in_rect)        {          switch (o->mode)            {            case GEGL_SPHERIZE_MODE_RADIAL:              result = *in_rect;              break;            case GEGL_SPHERIZE_MODE_HORIZONTAL:              result.x     = in_rect->x;              result.width = in_rect->width;              break;            case GEGL_SPHERIZE_MODE_VERTICAL:              result.y      = in_rect->y;              result.height = in_rect->height;              break;            }        }    }  return result;}
开发者ID:jonnor,项目名称:gegl,代码行数:35,


示例8: get_bounding_box

/* Compute the region for which this operation is defined. */static GeglRectangleget_bounding_box (GeglOperation *operation){  GeglRectangle  result = {0,0,0,0};  GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");  GeglProperties *o = GEGL_PROPERTIES (operation);  if (!in_rect){        return result;  }  if (o->clip) {    gegl_rectangle_copy(&result, in_rect);  }  else {    result.x = in_rect->x;    result.y = in_rect->y;    result.width = result.height = sqrt (in_rect->width * in_rect->width + in_rect->height * in_rect->height) * MAX ((o->o_x + 1),  (o->o_y + 1)) * 2;  }  result.width = result.width * o->output_scale;  result.height = result.height * o->output_scale;  #ifdef TRACE    g_warning ("< get_bounding_box result = %dx%d+%d+%d", result.width, result.height, result.x, result.y);  #endif  return result;}
开发者ID:jonnor,项目名称:gegl,代码行数:30,


示例9: process

/* Perform the specified operation. */static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties *o            = GEGL_PROPERTIES (operation);  GeglRectangle   boundary     = gegl_operation_get_bounding_box (operation);  GeglRectangle   eff_boundary = get_effective_area (operation);  const Babl     *format       = babl_format ("RaGaBaA float");#ifdef DO_NOT_USE_BUFFER_SAMPLE g_warning ("NOT USING BUFFER SAMPLE!");#endif  apply_mirror (o->m_angle,                o->r_angle,                o->n_segs,                o->c_x * boundary.width,                o->c_y * boundary.height,                o->o_x * (eff_boundary.width  - eff_boundary.x) + eff_boundary.x,                o->o_y * (eff_boundary.height - eff_boundary.y) + eff_boundary.y,                o->input_scale / 100,                o->clip,                o->warp,                format,                input,                &eff_boundary,                output,                &boundary,                result,                level);  return TRUE;}
开发者ID:jonnor,项目名称:gegl,代码行数:36,


示例10: gegl_rgbe_load_get_bounding_box

static GeglRectanglegegl_rgbe_load_get_bounding_box (GeglOperation *operation){  GeglProperties       *o        = GEGL_PROPERTIES (operation);  GeglRectangle     result   = {0,0,0,0};  rgbe_file        *file;  guint             width, height;  gegl_operation_set_format (operation,                             "output",                             babl_format (FORMAT));  file = rgbe_load_path (o->path);  if (!file)      goto cleanup;  if (!rgbe_get_size (file, &width, &height))      goto cleanup;  result.width  = width;  result.height = height;cleanup:  rgbe_file_free (file);  return result;}
开发者ID:LebedevRI,项目名称:gegl,代码行数:26,


示例11: prepare

static voidprepare (GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  Priv *p= (Priv*)o->user_data;  if (p == NULL)    init (o);  p = (Priv*)o->user_data;  gegl_operation_set_format (operation, "output",                            babl_format ("R'G'B'A u8"));  if (!p->fd)    {      p->force_format = 1;      p->dev_name = o->path;      p->io = IO_METHOD_MMAP;      p->w = o->width;      p->h = o->height;      open_device (p);      init_device (p);      start_capturing (p);    }}
开发者ID:jonnor,项目名称:gegl,代码行数:28,


示例12: process

/* Perform the specified operation. */static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties *o        = GEGL_PROPERTIES (operation);  GeglRectangle   boundary = gegl_operation_get_bounding_box (operation);  const Babl     *format   = babl_format ("RaGaBaA float");  apply_whirl_pinch (o->whirl,                     o->pinch,                     o->radius,                     boundary.width / 2.0,                     boundary.height / 2.0,                     format,                     input,                     &boundary,                     output,                     &boundary,                     result,                     level);  return TRUE;}
开发者ID:GNOME,项目名称:gegl,代码行数:27,


示例13: prepare

static voidprepare (GeglOperation *operation){  GeglProperties *o             = GEGL_PROPERTIES (operation);  const Babl     *input_format  = NULL;  const Babl     *output_format = (o->linear ?                                   babl_format ("Y float") :                                   babl_format ("Y' float"));  switch (o->component)    {    case GEGL_COMPONENT_EXTRACT_ALPHA:      input_format = babl_format ("YA float");      break;    case GEGL_COMPONENT_EXTRACT_RGB_RED:    case GEGL_COMPONENT_EXTRACT_RGB_GREEN:    case GEGL_COMPONENT_EXTRACT_RGB_BLUE:      input_format = babl_format ("R'G'B' float");      break;    case GEGL_COMPONENT_EXTRACT_HUE:    case GEGL_COMPONENT_EXTRACT_HSV_SATURATION:    case GEGL_COMPONENT_EXTRACT_HSV_VALUE:      input_format = babl_format ("HSV float");      break;    case GEGL_COMPONENT_EXTRACT_HSL_LIGHTNESS:    case GEGL_COMPONENT_EXTRACT_HSL_SATURATION:      input_format = babl_format ("HSL float");      break;    case GEGL_COMPONENT_EXTRACT_CMYK_CYAN:    case GEGL_COMPONENT_EXTRACT_CMYK_MAGENTA:    case GEGL_COMPONENT_EXTRACT_CMYK_YELLOW:    case GEGL_COMPONENT_EXTRACT_CMYK_KEY:      input_format = babl_format ("CMYK float");      break;    case GEGL_COMPONENT_EXTRACT_YCBCR_Y:    case GEGL_COMPONENT_EXTRACT_YCBCR_CB:    case GEGL_COMPONENT_EXTRACT_YCBCR_CR:      input_format = babl_format ("Y'CbCr float");      break;    case GEGL_COMPONENT_EXTRACT_LAB_L:    case GEGL_COMPONENT_EXTRACT_LAB_A:    case GEGL_COMPONENT_EXTRACT_LAB_B:      input_format = babl_format ("CIE Lab float");      break;    case GEGL_COMPONENT_EXTRACT_LCH_C:    case GEGL_COMPONENT_EXTRACT_LCH_H:      input_format = babl_format ("CIE LCH(ab) float");      break;    }  gegl_operation_set_format (operation, "input", input_format);  gegl_operation_set_format (operation, "output", output_format);}
开发者ID:elEnemigo,项目名称:GEGL-OpenCL,代码行数:60,


示例14: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         const GeglRectangle *result,         gint                 level){  GeglProperties *o = GEGL_PROPERTIES (operation);  GOutputStream *stream;  GFile *file = NULL;  GError *error = NULL;  gboolean status = TRUE;  stream = gegl_gio_open_output_stream (NULL, o->path, &file, &error);  if (stream == NULL)    {      status = FALSE;      g_warning ("%s", error->message);      goto cleanup;    }  if (!export_webp (operation, input, result, stream))    {      status = FALSE;      g_warning ("could not export WebP file");      goto cleanup;    }cleanup:  g_clear_object (&stream);  g_clear_object (&file);  return status;}
开发者ID:jonnor,项目名称:gegl,代码行数:32,


示例15: process

static gbooleanprocess (GeglOperation       *operation,         void                *in_buf,         void                *out_buf,         glong                n_pixels,         const GeglRectangle *roi,         gint                 level){  GeglProperties *o  = GEGL_PROPERTIES (operation);  const Babl *format = gegl_operation_get_format (operation, "input");  memcpy (out_buf, in_buf, n_pixels * babl_format_get_bytes_per_pixel (format));  if (o->cache != (void *) operation->node->cache)    {      if (o->cache)        {          g_object_unref (o->cache);          o->cache = NULL;        }      if (operation->node->cache)        o->cache = g_object_ref (operation->node->cache);    }  return TRUE;}
开发者ID:don-mccomb,项目名称:gegl,代码行数:27,


示例16: path_changed

static voidpath_changed (GeglPath            *path,              const GeglRectangle *roi,              GeglOperation       *operation){  GeglRectangle   rect;  GeglProperties *o    = GEGL_PROPERTIES (operation);  WarpPrivate    *priv = (WarpPrivate *) o->user_data;  /* mark the processed stroke as invalid, so that we recheck it against the   * new path upon the next call to process().   */  if (priv)    priv->processed_stroke_valid = FALSE;  /* invalidate the incoming rectangle */  rect.x      = floor (roi->x - o->size/2);  rect.y      = floor (roi->y - o->size/2);  rect.width  = ceil (roi->x + roi->width  + o->size/2) - rect.x;  rect.height = ceil (roi->y + roi->height + o->size/2) - rect.y;  /* we don't want to clear the cached data right away; we potentially do this   * in process(), if the cached path is not an initial segment of the new   * path.  block our INVALIDATED handler so that the cache isn't cleared.   */  g_signal_handlers_block_by_func (operation->node,                                   node_invalidated, operation);  gegl_operation_invalidate (operation, &rect, FALSE);  g_signal_handlers_unblock_by_func (operation->node,                                     node_invalidated, operation);}
开发者ID:elEnemigo,项目名称:GEGL-OpenCL,代码行数:34,


示例17: prepare

static voidprepare (GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  const Babl *format = babl_format ("RGBA float");  GeglRectangle  *whole_region;  AlParamsType   *params;  if (! o->user_data)    o->user_data = g_slice_new0 (AlParamsType);  params = (AlParamsType *) o->user_data;  whole_region = gegl_operation_source_get_bounding_box (operation, "input");  if (whole_region)    {      params->a = 0.5 * whole_region->width;      params->b = 0.5 * whole_region->height;      params->c = MIN (params->a, params->b);      params->asqr = params->a * params->a;      params->bsqr = params->b * params->b;      params->csqr = params->c * params->c;    }  gegl_color_get_pixel (o->background_color, format, params->bg_color);  gegl_operation_set_format (operation, "input", format);  gegl_operation_set_format (operation, "output", format);}
开发者ID:OpenCL,项目名称:GEGL-OpenCL,代码行数:31,


示例18: operation_process

/* Pass-through when trying to perform IIR on an infinite plane */static gbooleanoperation_process (GeglOperation        *operation,                   GeglOperationContext *context,                   const gchar          *output_prop,                   const GeglRectangle  *result,                   gint                  level){  GeglOperationClass  *operation_class;  GeglProperties          *o = GEGL_PROPERTIES (operation);  GeglGblur1dFilter    filter  = filter_disambiguation (o->filter, o->std_dev);  operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);  if (filter == GEGL_GBLUR_1D_IIR)    {      const GeglRectangle *in_rect =        gegl_operation_source_get_bounding_box (operation, "input");      if (in_rect && gegl_rectangle_is_infinite_plane (in_rect))        {          gpointer in = gegl_operation_context_get_object (context, "input");          gegl_operation_context_take_object (context, "output",                                              g_object_ref (G_OBJECT (in)));          return TRUE;        }    }  /* chain up, which will create the needed buffers for our actual   * process function   */  return operation_class->process (operation, context, output_prop, result,                                   gegl_operation_context_get_level (context));}
开发者ID:kleopatra999,项目名称:gegl,代码行数:34,


示例19: process

static gbooleanprocess (GeglOperation       *operation,         void                *in_buf,         void                *out_buf,         glong                n_pixels,         const GeglRectangle *roi,         gint                 level){  GeglProperties *o      = GEGL_PROPERTIES (operation);  const Babl *format = babl_format ("R'G'B'A float");  gfloat      color[4];  gint        x;  gfloat *in_buff = in_buf;  gfloat *out_buff = out_buf;  gegl_color_get_pixel (o->color, format, color);  for (x = 0; x < n_pixels; x++)    {      color_to_alpha (color, in_buff, out_buff);      in_buff  += 4;      out_buff += 4;    }  return TRUE;}
开发者ID:elEnemigo,项目名称:GEGL-OpenCL,代码行数:27,


示例20: 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,


示例21: is_nop

static gbooleanis_nop (GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  GeglRectangle  *in_rect;  if (fabs (o->curvature) < EPSILON || fabs (o->amount) < EPSILON)    return TRUE;  in_rect = gegl_operation_source_get_bounding_box (operation, "input");  switch (o->mode)    {    case GEGL_SPHERIZE_MODE_RADIAL:      return in_rect->width < 1 || in_rect->height < 1;    case GEGL_SPHERIZE_MODE_HORIZONTAL:      return in_rect->width < 1;    case GEGL_SPHERIZE_MODE_VERTICAL:      return in_rect->height < 1;    }  g_return_val_if_reached (TRUE);}
开发者ID:jonnor,项目名称:gegl,代码行数:25,


示例22: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties    *o = GEGL_PROPERTIES (operation);  GeglRectangle  boundary;  const Babl    *format;  GeglSampler   *sampler;  gfloat        *dst_buf;  gint           y;  boundary = gegl_operation_get_bounding_box (operation);  format = babl_format ("RGBA float");  dst_buf = g_new0 (gfloat, result->width * result->height * 4);  sampler = gegl_buffer_sampler_new_at_level (input, format, GEGL_SAMPLER_CUBIC, level);  for (y = result->y; y < result->y + result->height; y++)    fractaltrace (input, sampler, &boundary, dst_buf, result, o, y, o->fractal, format, level);  gegl_buffer_set (output, result, 0, format, dst_buf, GEGL_AUTO_ROWSTRIDE);  g_object_unref (sampler);  g_free (dst_buf);  gegl_buffer_sample_cleanup (input);  return TRUE;}
开发者ID:kleopatra999,项目名称:gegl,代码行数:32,


示例23: cleanup

static voidcleanup(GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  Priv *p = (Priv*) o->user_data;  if (p != NULL)    {      if (p->decoder != NULL)        WebPIDelete (p->decoder);      p->decoder = NULL;      if (p->config != NULL)        WebPFreeDecBuffer (&p->config->output);      if (p->config != NULL)        g_free (p->config);      p->config = NULL;      if (p->stream != NULL)        g_input_stream_close (G_INPUT_STREAM (p->stream), NULL, NULL);      if (p->stream != NULL)        g_clear_object (&p->stream);      if (p->file != NULL)        g_clear_object (&p->file);      p->width = p->height = 0;      p->format = NULL;    }}
开发者ID:OpenCL,项目名称:GEGL-OpenCL,代码行数:29,


示例24: get_bounding_box

static GeglRectangleget_bounding_box (GeglOperation * operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  GeglRectangle result = { 0, 0, 0, 0 };  gint width, height, depth;  width = height = depth = 0;  if (!query_jp2 (o->path, &width, &height, &depth, NULL))    return result;  result.width = width;  result.height = height;  switch (depth)    {    case 16:      gegl_operation_set_format (operation, "output",                                 babl_format ("R'G'B' u16"));      break;    case 8:      gegl_operation_set_format (operation, "output",                                 babl_format ("R'G'B' u8"));      break;    default:      g_warning ("%s: Programmer stupidity error", G_STRLOC);    }  return result;}
开发者ID:mhorga,项目名称:GEGL-OpenCL,代码行数:33,


示例25: get_bounding_box

static GeglRectangleget_bounding_box (GeglOperation *operation){  GeglProperties   *o = GEGL_PROPERTIES (operation);  GeglRectangle result = {0,0,0,0};  gint          width, height;  gint          status;  const Babl *  format;  GError *err = NULL;  GFile *infile = NULL;  GInputStream *stream = gegl_gio_open_input_stream(o->uri, o->path, &infile, &err);  WARN_IF_ERROR(err);  if (!stream) return result;  status = query_png(stream, &width, &height, &format, &err);  WARN_IF_ERROR(err);  g_input_stream_close(stream, NULL, NULL);  if (status)    {      width = 0;      height = 0;    }  gegl_operation_set_format (operation, "output", format);  result.width  = width;  result.height  = height;  if (infile) g_object_unref(infile);  g_object_unref(stream);  return result;}
开发者ID:OpenCL,项目名称:GEGL-OpenCL,代码行数:32,


示例26: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties      *o = GEGL_PROPERTIES (operation);  GeglBuffer          *temp_in;  GeglRectangle        compute;  if (gegl_operation_use_opencl (operation))    if (cl_process (operation, input, output, result))      return TRUE;  compute = gegl_operation_get_required_for_output (operation, "input", result);  if (o->radius < 1.0)    {      output = g_object_ref (input);    }  else    {      temp_in = gegl_buffer_create_sub_buffer (input, &compute);      snn_mean (temp_in, output, result, o->radius, o->pairs);      g_object_unref (temp_in);    }  return  TRUE;}
开发者ID:kleopatra999,项目名称:gegl,代码行数:31,


示例27: prepare

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


示例28: prepare

static voidprepare (GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  GeglNode *gegl, *input, *output;  GError *error = NULL;  gegl = operation->node;  if (!o->user_data || !g_str_equal (o->user_data, o->string))  {    g_free (o->user_data);    o->user_data = g_strdup (o->string);  input  = gegl_node_get_input_proxy (gegl,  "input");  output = gegl_node_get_output_proxy (gegl, "output");  gegl_node_link_many (input, output, NULL);  {     gchar cwd[81920]; // XXX: should do better     getcwd (cwd, sizeof(cwd));  gegl_create_chain (o->string, input, output, 0.0,                     gegl_node_get_bounding_box (input).height, cwd,                     &error);  }  if (error)  {    gegl_node_set (gegl, "error", error->message, NULL);    g_clear_error (&error);  }  else    g_object_set (operation, "error", "", NULL);  }}
开发者ID:jonnor,项目名称:gegl,代码行数:35,


示例29: process

static gbooleanprocess (GeglOperation       *operation,         GeglBuffer          *input,         GeglBuffer          *output,         const GeglRectangle *result,         gint                 level){  GeglProperties *o      = GEGL_PROPERTIES (operation);  GeglRectangle in_rect = *gegl_buffer_get_extent (input);  GeglRectangle out_rect = *gegl_buffer_get_extent (output);  PixelDuster    *duster = pixel_duster_new (input, output, &in_rect, &out_rect,                                             o->seek_distance,                                             1,                                             o->min_neigh,                                             o->min_iter,                                             o->chance_try,                                             o->chance_retry,                                             1.0,                                             1.0,                                             operation);  seed_db (duster);  gegl_buffer_copy (input, NULL, GEGL_ABYSS_NONE, output, NULL);  fprintf (stderr, "adding transparent probes");  pixel_duster_add_probes_for_transparent (duster);  fprintf (stderr, "/n");  pixel_duster_fill (duster);  pixel_duster_destroy (duster);  return TRUE;}
开发者ID:jonnor,项目名称:gegl,代码行数:30,


示例30: get_bounding_box

static GeglRectangleget_bounding_box (GeglOperation *operation){  GeglProperties *o = GEGL_PROPERTIES (operation);  GeglRectangle result = {0,0,0,0};  if (o->width <= 0 || o->height <= 0)  {     GeglRectangle *in_rect;     in_rect = gegl_operation_source_get_bounding_box (operation, "input");     if (in_rect)       {          result = *in_rect;       }     else     {       result.width = 320;       result.height = 200;     }  }  else  {    result.width = o->width;    result.height = o->height;  }  return result;}
开发者ID:GNOME,项目名称:gegl,代码行数:27,



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


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