ext/image.c in ruby-vips-0.1.1 vs ext/image.c in ruby-vips-0.2.0

- old
+ new

@@ -25,49 +25,49 @@ img_free(vipsImg *im) { if(im->in) im_close(im->in); - if(im->deps) - xfree(im->deps); + if(im->deps) + free(im->deps); xfree(im); } static void img_mark(vipsImg *im) { - int i; + int i; - for (i = 0; i < im->deps_len; i++) - rb_gc_mark(im->deps[i]); + for (i = 0; i < im->deps_len; i++) + rb_gc_mark(im->deps[i]); } VALUE img_alloc(VALUE klass) { vipsImg *im; VALUE new = Data_Make_Struct(klass, vipsImg, img_mark, img_free, im); im->in = NULL; im->deps = NULL; - im->deps_len = 0; + im->deps_len = 0; return new; } void img_add_dep(vipsImg *im, VALUE dep) { - int i; - - for (i = 0; i < im->deps_len; i++) - if (im->deps[i] == dep) - return; + int i; + + for (i = 0; i < im->deps_len; i++) + if (im->deps[i] == dep) + return; - im->deps_len++; - im->deps = realloc(im->deps, im->deps_len * sizeof(VALUE*)); - im->deps[im->deps_len - 1] = dep; + im->deps_len++; + im->deps = (VALUE*)realloc(im->deps, im->deps_len * sizeof(VALUE)); + im->deps[im->deps_len - 1] = dep; } VALUE img_init(VALUE klass, VipsImage *im) { @@ -110,22 +110,22 @@ } VALUE img_spawn2(VALUE parent1, VALUE parent2) { - VALUE new = img_spawn(parent1); + VALUE new = img_spawn(parent1); vipsImg *im; Data_Get_Struct(new, vipsImg, im); img_add_dep(im, parent2); return new; } VALUE img_spawn3(VALUE parent1, VALUE parent2, VALUE parent3) { - VALUE new = img_spawn2(parent1, parent2); + VALUE new = img_spawn2(parent1, parent2); vipsImg *im; Data_Get_Struct(new, vipsImg, im); img_add_dep(im, parent3); return new; @@ -177,14 +177,14 @@ */ static VALUE img_vtype(VALUE obj) { - GetImg(obj, data, im); + GetImg(obj, data, im); if (im) - return ID2SYM(img_vtype_to_id(im->Type)); + return ID2SYM(img_vtype_to_id(im->Type)); return Qnil; } /* @@ -196,11 +196,11 @@ */ static VALUE img_coding(VALUE obj) { - GetImg(obj, data, im); + GetImg(obj, data, im); if (im) return ID2SYM(img_coding_to_id(im->Coding)); return Qnil; @@ -214,11 +214,11 @@ */ static VALUE img_kill(VALUE obj) { - GetImg(obj, data, im); + GetImg(obj, data, im); return INT2FIX(im->kill); } /* * call-seq: @@ -228,64 +228,64 @@ */ static VALUE img_filename(VALUE obj) { - GetImg(obj, data, im); + GetImg(obj, data, im); if (im) return rb_tainted_str_new2(im->filename); return Qnil; } #define GETPIX( TYPE, CONVERSION ) { \ - TYPE *p = (TYPE *) IM_IMAGE_ADDR(im, x, y); \ + TYPE *p = (TYPE *) IM_IMAGE_ADDR(im, x, y); \ \ - if (sz == 1) \ - return CONVERSION(*p); \ + if (sz == 1) \ + return CONVERSION(*p); \ \ - ary = rb_ary_new2(sz); \ - for (i = 0; i < sz; i++) \ - rb_ary_push(ary, CONVERSION(p[i])); \ + ary = rb_ary_new2(sz); \ + for (i = 0; i < sz; i++) \ + rb_ary_push(ary, CONVERSION(p[i])); \ \ - return ary; \ + return ary; \ } #define CGETPIX( TYPE, CONVERSION ) { \ - TYPE *p = (TYPE *) IM_IMAGE_ADDR(im, x, y); \ + TYPE *p = (TYPE *) IM_IMAGE_ADDR(im, x, y); \ \ - ary = rb_ary_new2(sz); \ - for (i = 0; i < sz; i++) { \ - rb_ary_push(ary, rb_ary_new3(2, CONVERSION(p[0]), CONVERSION(p[1]))); \ - p += 2; \ - } \ + ary = rb_ary_new2(sz); \ + for (i = 0; i < sz; i++) { \ + rb_ary_push(ary, rb_ary_new3(2, CONVERSION(p[0]), CONVERSION(p[1]))); \ + p += 2; \ + } \ \ - return ary; \ + return ary; \ } static VALUE img_pixel_to_rb(VipsImage *im, int x, int y) { - const int sz = im->Bands; - int i; - VALUE ary; + const int sz = im->Bands; + int i; + VALUE ary; - switch( im->BandFmt ) { - case IM_BANDFMT_UCHAR: GETPIX( unsigned char, UINT2NUM ); break; - case IM_BANDFMT_CHAR: GETPIX( signed char, INT2NUM ); break; - case IM_BANDFMT_USHORT: GETPIX( unsigned short, UINT2NUM ); break; - case IM_BANDFMT_SHORT: GETPIX( signed short, INT2NUM ); break; - case IM_BANDFMT_UINT: GETPIX( unsigned int, UINT2NUM ); break; - case IM_BANDFMT_INT: GETPIX( signed int, INT2FIX ); break; - case IM_BANDFMT_FLOAT: GETPIX( float, rb_float_new ); break; + switch( im->BandFmt ) { + case IM_BANDFMT_UCHAR: GETPIX( unsigned char, UINT2NUM ); break; + case IM_BANDFMT_CHAR: GETPIX( signed char, INT2NUM ); break; + case IM_BANDFMT_USHORT: GETPIX( unsigned short, UINT2NUM ); break; + case IM_BANDFMT_SHORT: GETPIX( signed short, INT2NUM ); break; + case IM_BANDFMT_UINT: GETPIX( unsigned int, UINT2NUM ); break; + case IM_BANDFMT_INT: GETPIX( signed int, INT2FIX ); break; + case IM_BANDFMT_FLOAT: GETPIX( float, rb_float_new ); break; - case IM_BANDFMT_DOUBLE: GETPIX( double, rb_float_new ); break; - case IM_BANDFMT_COMPLEX: CGETPIX( float, rb_float_new ); break; - case IM_BANDFMT_DPCOMPLEX: CGETPIX( double, rb_float_new ); break; - } + case IM_BANDFMT_DOUBLE: GETPIX( double, rb_float_new ); break; + case IM_BANDFMT_COMPLEX: CGETPIX( float, rb_float_new ); break; + case IM_BANDFMT_DPCOMPLEX: CGETPIX( double, rb_float_new ); break; + } } /* * call-seq: * im[x, y] -> number, ... @@ -299,21 +299,21 @@ */ static VALUE img_aref(VALUE obj, VALUE v_x, VALUE v_y) { - int x = NUM2INT(v_x); - int y = NUM2INT(v_y); - GetImg(obj, data, im); + int x = NUM2INT(v_x); + int y = NUM2INT(v_y); + GetImg(obj, data, im); - if (im_incheck(im) || im_check_uncoded("img_aref", im)) - vips_lib_error(); + if (im_incheck(im) || im_check_uncoded("img_aref", im)) + vips_lib_error(); - if (x >= im->Xsize || x < 0 || y >= im->Ysize || y < 0) - rb_raise(rb_eIndexError, "Index out of bounds"); + if (x >= im->Xsize || x < 0 || y >= im->Ysize || y < 0) + rb_raise(rb_eIndexError, "Index out of bounds"); - return img_pixel_to_rb(im, x, y); + return img_pixel_to_rb(im, x, y); } /* * call-seq: * im.each_pixel{|value, x, y|} @@ -322,25 +322,25 @@ */ static VALUE img_each_pixel(VALUE obj) { - int x, y; - VALUE pixel; - GetImg(obj, data, im); + int x, y; + VALUE pixel; + GetImg(obj, data, im); - if (im_incheck(im) || im_check_uncoded("img_each_pixel", im)) - return( Qnil ); + if (im_incheck(im) || im_check_uncoded("img_each_pixel", im)) + return( Qnil ); for(y = 0; y < im->Ysize; y++) { - for(x = 0; x < im->Xsize; x++) { - pixel = img_pixel_to_rb(im, x, y); - rb_yield(rb_ary_new3(3, pixel, INT2FIX(x), INT2FIX(y))); - } - } + for(x = 0; x < im->Xsize; x++) { + pixel = img_pixel_to_rb(im, x, y); + rb_yield(rb_ary_new3(3, pixel, INT2FIX(x), INT2FIX(y))); + } + } - return obj; + return obj; } /* * call-seq: * im.data -> data_string @@ -349,16 +349,16 @@ */ static VALUE img_data(VALUE obj) { - GetImg(obj, data, im); + GetImg(obj, data, im); - if (im_incheck(im) || im_check_uncoded("img_aref", im)) - return( Qnil ); + if (im_incheck(im) || im_check_uncoded("img_aref", im)) + return( Qnil ); - return rb_tainted_str_new(im->data, IM_IMAGE_SIZEOF_LINE(im) * im->Ysize); + return rb_tainted_str_new(im->data, IM_IMAGE_SIZEOF_LINE(im) * im->Ysize); } /* * Image objects reference in-memory images. All operations that manipulate and * return an image will simply add the operation to the pipeline and return an @@ -396,63 +396,63 @@ rb_define_singleton_method(cVIPSImage, "fmask_gauss_bandreject", img_s_fmask_gauss_bandreject, 6); // in image_freq_filt.c rb_define_singleton_method(cVIPSImage, "fmask_fractal_flt", img_s_fmask_fractal_flt, 3); // in image_freq_filt.c rb_define_singleton_method(cVIPSImage, "fractsurf", img_s_fractsurf, 2); // in image_freq_filt.c rb_define_singleton_method(cVIPSImage, "identity", img_s_identity, 1); // in image_histograms_lut.c rb_define_singleton_method(cVIPSImage, "identity_ushort", img_s_identity_ushort, 2); // in image_histograms_lut.c - rb_define_singleton_method(cVIPSImage, "invertlut", img_s_invertlut, 2); // in image_histograms_lut.c - rb_define_singleton_method(cVIPSImage, "buildlut", img_s_buildlut, 1); // in image_histograms_lut.c + rb_define_singleton_method(cVIPSImage, "invertlut", img_s_invertlut, 2); // in image_histograms_lut.c + rb_define_singleton_method(cVIPSImage, "buildlut", img_s_buildlut, 1); // in image_histograms_lut.c rb_define_singleton_method(cVIPSImage, "tone_build_range", img_s_tone_build_range, 10); // in image_histograms_lut.c rb_define_singleton_method(cVIPSImage, "tone_build", img_s_tone_build, 8); // in image_histograms_lut.c rb_define_method(cVIPSImage, "[]", img_aref, 2); rb_define_method(cVIPSImage, "each_pixel", img_each_pixel, 0); rb_define_method(cVIPSImage, "data", img_data, 0); rb_define_method(cVIPSImage, "vtype", img_vtype, 0); rb_define_method(cVIPSImage, "coding", img_coding, 0); rb_define_method(cVIPSImage, "filename", img_filename, 0); rb_define_method(cVIPSImage, "kill", img_kill, 0); - rb_define_method(cVIPSImage, "measure_area", img_measure_area, 7); // in image_arithmetic.c - rb_define_method(cVIPSImage, "stats", img_stats, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "max", img_max, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "min", img_min, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "avg", img_avg, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "deviate", img_deviate, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "maxpos", img_maxpos, -1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "minpos", img_minpos, -1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "maxpos_avg", img_maxpos_avg, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "bandmean", img_bandmean, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "add", img_add, 1); // in image_arithmetic.c - rb_define_alias(cVIPSImage, "+", "add"); - rb_define_method(cVIPSImage, "subtract", img_subtract, 1); // in image_arithmetic.c - rb_define_alias(cVIPSImage, "-", "subtract"); - rb_define_method(cVIPSImage, "invert", img_invert, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "lin", img_lin, 2); // in image_arithmetic.c - rb_define_method(cVIPSImage, "multiply", img_multiply, 1); // in image_arithmetic.c - rb_define_alias(cVIPSImage, "*", "multiply"); - rb_define_method(cVIPSImage, "divide", img_divide, 1); // in image_arithmetic.c - rb_define_alias(cVIPSImage, "/", "divide"); - rb_define_method(cVIPSImage, "remainder", img_remainder, -1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "%", img_remainder_binop, 1); - rb_define_method(cVIPSImage, "recomb", img_recomb, 1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "sign", img_sign, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "abs", img_abs, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "floor", img_floor, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "rint", img_rint, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "ceil", img_ceil, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "point", img_point, 4); // in image_arithmetic.c - rb_define_method(cVIPSImage, "pow", img_pow, -1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "**", img_pow_binop, 1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "expn", img_expn, -1); // in image_arithmetic.c - rb_define_method(cVIPSImage, "log", img_log, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "log10", img_log10, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "sin", img_sin, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "cos", img_cos, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "tan", img_tan, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "asin", img_asin, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "acos", img_acos, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "atan", img_atan, 0); // in image_arithmetic.c - rb_define_method(cVIPSImage, "cross_phase", img_cross_phase, 1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "measure_area", img_measure_area, 7); // in image_arithmetic.c + rb_define_method(cVIPSImage, "stats", img_stats, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "max", img_max, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "min", img_min, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "avg", img_avg, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "deviate", img_deviate, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "maxpos", img_maxpos, -1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "minpos", img_minpos, -1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "maxpos_avg", img_maxpos_avg, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "bandmean", img_bandmean, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "add", img_add, 1); // in image_arithmetic.c + rb_define_alias(cVIPSImage, "+", "add"); + rb_define_method(cVIPSImage, "subtract", img_subtract, 1); // in image_arithmetic.c + rb_define_alias(cVIPSImage, "-", "subtract"); + rb_define_method(cVIPSImage, "invert", img_invert, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "lin", img_lin, 2); // in image_arithmetic.c + rb_define_method(cVIPSImage, "multiply", img_multiply, 1); // in image_arithmetic.c + rb_define_alias(cVIPSImage, "*", "multiply"); + rb_define_method(cVIPSImage, "divide", img_divide, 1); // in image_arithmetic.c + rb_define_alias(cVIPSImage, "/", "divide"); + rb_define_method(cVIPSImage, "remainder", img_remainder, -1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "%", img_remainder_binop, 1); + rb_define_method(cVIPSImage, "recomb", img_recomb, 1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "sign", img_sign, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "abs", img_abs, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "floor", img_floor, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "rint", img_rint, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "ceil", img_ceil, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "point", img_point, 4); // in image_arithmetic.c + rb_define_method(cVIPSImage, "pow", img_pow, -1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "**", img_pow_binop, 1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "expn", img_expn, -1); // in image_arithmetic.c + rb_define_method(cVIPSImage, "log", img_log, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "log10", img_log10, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "sin", img_sin, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "cos", img_cos, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "tan", img_tan, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "asin", img_asin, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "acos", img_acos, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "atan", img_atan, 0); // in image_arithmetic.c + rb_define_method(cVIPSImage, "cross_phase", img_cross_phase, 1); // in image_arithmetic.c rb_define_method(cVIPSImage, "and", img_and, -1); // in image_boolean.c rb_define_method(cVIPSImage, "&", img_and_binop, 1); rb_define_method(cVIPSImage, "or", img_or, -1); // in image_boolean.c rb_define_method(cVIPSImage, "|", img_or_binop, 1); rb_define_method(cVIPSImage, "xor", img_xor, -1); // in image_boolean.c @@ -486,16 +486,16 @@ rb_define_method(cVIPSImage, "xyz_to_yxy", img_xyz_to_yxy, 0); // in image_colour.c rb_define_method(cVIPSImage, "decmc_from_lab", img_decmc_from_lab, 1); // in image_colour.c rb_define_method(cVIPSImage, "de00_from_lab", img_de00_from_lab, 1); // in image_colour.c rb_define_method(cVIPSImage, "de_from_xyz", img_de_from_xyz, 1); // in image_colour.c rb_define_method(cVIPSImage, "de_from_lab", img_de_from_lab, 1); // in image_colour.c - rb_define_method(cVIPSImage, "im_lab_morph", img_lab_morph, 5); // in image_colour.c - rb_define_method(cVIPSImage, "icc_transform", img_icc_transform, 3); // in image_colour.c - rb_define_method(cVIPSImage, "icc_import", img_icc_import, 2); // in image_colour.c - rb_define_method(cVIPSImage, "icc_import_embedded", img_icc_import_embedded, 1); // in image_colour.c - rb_define_method(cVIPSImage, "icc_export_depth", img_icc_export_depth, 3); // in image_colour.c - rb_define_method(cVIPSImage, "icc_ac2rc", img_icc_ac2rc, 1); // in image_colour.c + rb_define_method(cVIPSImage, "im_lab_morph", img_lab_morph, 5); // in image_colour.c + rb_define_method(cVIPSImage, "icc_transform", img_icc_transform, 3); // in image_colour.c + rb_define_method(cVIPSImage, "icc_import", img_icc_import, 2); // in image_colour.c + rb_define_method(cVIPSImage, "icc_import_embedded", img_icc_import_embedded, 1); // in image_colour.c + rb_define_method(cVIPSImage, "icc_export_depth", img_icc_export_depth, 3); // in image_colour.c + rb_define_method(cVIPSImage, "icc_ac2rc", img_icc_ac2rc, 1); // in image_colour.c rb_define_method(cVIPSImage, "to_mask", img_to_mask, 0); // in image_conversion.c rb_define_method(cVIPSImage, "copy_file", img_copy_file, 0); // in image_conversion.c rb_define_method(cVIPSImage, "dup", img_dup, 0); // in image_conversion.c rb_define_method(cVIPSImage, "clip2fmt", img_clip2fmt, 1); // in image_conversion.c rb_define_method(cVIPSImage, "scale", img_scale, 0); // in image_conversion.c @@ -510,10 +510,11 @@ rb_define_method(cVIPSImage, "scaleps", img_scaleps, 0); // in image_conversion.c rb_define_method(cVIPSImage, "falsecolour", img_falsecolour, 0); // in image_conversion.c rb_define_method(cVIPSImage, "extract_band", img_extract_band, -1); // in image_conversion.c rb_define_method(cVIPSImage, "extract_area", img_extract_area, -1); // in image_conversion.c rb_define_method(cVIPSImage, "embed", img_embed, 5); // in image_conversion.c + rb_define_method(cVIPSImage, "tile_cache", img_tile_cache, 3); // in image_conversion.c rb_define_method(cVIPSImage, "bandjoin", img_bandjoin, -1); // in image_conversion.c rb_define_method(cVIPSImage, "insert", img_insert, -1); // in image_conversion.c rb_define_method(cVIPSImage, "insert_noexpand", img_insert_noexpand, 3); // in image_conversion.c rb_define_method(cVIPSImage, "lrjoin", img_lrjoin, 1); // in image_conversion.c rb_define_method(cVIPSImage, "tbjoin", img_tbjoin, 1); // in image_conversion.c @@ -540,11 +541,11 @@ rb_define_method(cVIPSImage, "gradcor", img_gradcor, 1); // in image_convolution.c rb_define_method(cVIPSImage, "contrast_surface", img_contrast_surface, 2); // in image_convolution.c rb_define_method(cVIPSImage, "addgnoise", img_addgnoise, 1); // in image_convolution.c rb_define_method(cVIPSImage, "fwfft", img_fwfft, 0); // in image_freq_filt.c rb_define_method(cVIPSImage, "invfft", img_invfft, 0); // in image_freq_filt.c - rb_define_method(cVIPSImage, "rotquad", img_rotquad, 0); // in image_freq_filt.c + rb_define_method(cVIPSImage, "rotquad", img_rotquad, 0); // in image_freq_filt.c rb_define_method(cVIPSImage, "invfftr", img_invfftr, 0); // in image_freq_filt.c rb_define_method(cVIPSImage, "freqflt", img_freqflt, 1); // in image_freq_filt.c rb_define_method(cVIPSImage, "disp_ps", img_disp_ps, 0); // in image_freq_filt.c rb_define_method(cVIPSImage, "phasecor_fft", img_phasecor_fft, 1); // in image_freq_filt.c rb_define_method(cVIPSImage, "histgr", img_histgr, -1); // in image_histograms_lut.c @@ -563,24 +564,24 @@ rb_define_method(cVIPSImage, "mpercent", img_mpercent, 1); // in image_histograms_lut.c rb_define_method(cVIPSImage, "heq", img_heq, -1); // in image_histograms_lut.c rb_define_method(cVIPSImage, "lhisteq", img_lhisteq, 2); // in image_histograms_lut.c rb_define_method(cVIPSImage, "stdif", img_stdif, 6); // in image_histograms_lut.c rb_define_method(cVIPSImage, "tone_analyze", img_tone_analyze, 6); // in image_histograms_lut.c - rb_define_method(cVIPSImage, "maplut", img_maplut, 1); // in image_histograms_lut.c - rb_define_method(cVIPSImage, "histplot", img_histplot, 0); // in image_histograms_lut.c + rb_define_method(cVIPSImage, "maplut", img_maplut, 1); // in image_histograms_lut.c + rb_define_method(cVIPSImage, "histplot", img_histplot, 0); // in image_histograms_lut.c rb_define_method(cVIPSImage, "dilate", img_dilate, 1); // in image_morphology.c rb_define_method(cVIPSImage, "erode", img_erode, 1); // in image_morphology.c rb_define_method(cVIPSImage, "rank", img_rank, 3); // in image_morphology.c - rb_define_method(cVIPSImage, "rank_image", img_rank_image, -1); // in image_morphology.c - rb_define_method(cVIPSImage, "maxvalue", img_maxvalue, -1); // in image_morphology.c - rb_define_method(cVIPSImage, "cntlines_h", img_cntlines_h, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "cntlines_v", img_cntlines_v, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "zerox_pos", img_zerox_pos, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "zerox_neg", img_zerox_neg, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "profile_h", img_profile_h, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "profile_v", img_profile_v, 0); // in image_morphology.c - rb_define_method(cVIPSImage, "label_regions", img_label_regions, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "rank_image", img_rank_image, -1); // in image_morphology.c + rb_define_method(cVIPSImage, "maxvalue", img_maxvalue, -1); // in image_morphology.c + rb_define_method(cVIPSImage, "cntlines_h", img_cntlines_h, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "cntlines_v", img_cntlines_v, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "zerox_pos", img_zerox_pos, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "zerox_neg", img_zerox_neg, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "profile_h", img_profile_h, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "profile_v", img_profile_v, 0); // in image_morphology.c + rb_define_method(cVIPSImage, "label_regions", img_label_regions, 0); // in image_morphology.c rb_define_method(cVIPSImage, "lrmerge", img_lrmerge, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "tbmerge", img_tbmerge, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "lrmerge1", img_lrmerge1, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "tbmerge1", img_tbmerge1, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "lrmosaic", img_lrmosaic, -1); // in image_mosaicing.c @@ -588,12 +589,12 @@ rb_define_method(cVIPSImage, "lrmosaic1", img_lrmosaic1, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "tbmosaic1", img_tbmosaic1, -1); // in image_mosaicing.c rb_define_method(cVIPSImage, "global_balance", img_global_balance, 1); // in image_mosaicing.c rb_define_method(cVIPSImage, "global_balancef", img_global_balancef, 1); // in image_mosaicing.c rb_define_method(cVIPSImage, "correl", img_correl, 7); // in image_mosaicing.c - rb_define_method(cVIPSImage, "align_bands", img_align_bands, 0); // in image_mosaicing.c - rb_define_method(cVIPSImage, "maxpos_subpel", img_maxpos_subpel, 0); // in image_mosaicing.c + rb_define_method(cVIPSImage, "align_bands", img_align_bands, 0); // in image_mosaicing.c + rb_define_method(cVIPSImage, "maxpos_subpel", img_maxpos_subpel, 0); // in image_mosaicing.c rb_define_method(cVIPSImage, "equal", img_equal, -1); // in image_relational.c rb_define_method(cVIPSImage, "notequal", img_notequal, -1); // in image_relational.c rb_define_method(cVIPSImage, "less", img_less, -1); // in image_relational.c rb_define_method(cVIPSImage, "lesseq", img_lesseq, -1); // in image_relational.c rb_define_method(cVIPSImage, "more", img_more, -1); // in image_relational.c @@ -606,27 +607,27 @@ rb_define_method(cVIPSImage, "shrink", img_shrink, -1); // in image_resample.c rb_define_method(cVIPSImage, "rightshift_size", img_rightshift_size, 3); // in image_resample.c rb_define_method(cVIPSImage, "match_linear", img_match_linear, 9); // in image_resample.c rb_define_method(cVIPSImage, "match_linear_search", img_match_linear_search, 11); // in image_resample.c - id_b_w = rb_intern("B_W"); - id_histogram = rb_intern("HISTOGRAM"); - id_fourier = rb_intern("FOURIER"); - id_xyz = rb_intern("XYZ"); - id_lab = rb_intern("LAB"); - id_cmyk = rb_intern("CMYK"); - id_labq = rb_intern("LABQ"); - id_rgb = rb_intern("RGB"); - id_ucs = rb_intern("UCS"); - id_lch = rb_intern("LCH"); - id_labs = rb_intern("LABS"); - id_srgb = rb_intern("sRGB"); - id_yxy = rb_intern("YXY"); - id_rgb16 = rb_intern("RGB16"); - id_grey16 = rb_intern("GREY16"); + id_b_w = rb_intern("B_W"); + id_histogram = rb_intern("HISTOGRAM"); + id_fourier = rb_intern("FOURIER"); + id_xyz = rb_intern("XYZ"); + id_lab = rb_intern("LAB"); + id_cmyk = rb_intern("CMYK"); + id_labq = rb_intern("LABQ"); + id_rgb = rb_intern("RGB"); + id_ucs = rb_intern("UCS"); + id_lch = rb_intern("LCH"); + id_labs = rb_intern("LABS"); + id_srgb = rb_intern("sRGB"); + id_yxy = rb_intern("YXY"); + id_rgb16 = rb_intern("RGB16"); + id_grey16 = rb_intern("GREY16"); - id_none = rb_intern("NONE"); - id_rad = rb_intern("RAD"); + id_none = rb_intern("NONE"); + id_rad = rb_intern("RAD"); init_Image_colour(); init_Image_conversion(); init_Image_mosaicing();