Sha256: 0a04579fed92d3a9e697d43f54e662e8ed9f2fc16cf6ad1e26b9f6f804f89b6c

Contents?: true

Size: 1.69 KB

Versions: 13

Compression:

Stored size: 1.69 KB

Contents

#ifndef RUBY_VIPS_IMAGE_H
#define RUBY_VIPS_IMAGE_H

#include "ruby_vips.h"

extern VALUE cVIPSImage;

struct _vipsImg {
  VipsImage *in;
  VALUE *deps;
  int deps_len;
};
typedef struct _vipsImg vipsImg;

void img_add_dep(vipsImg*, VALUE);
VALUE img_spawn(VALUE);
VALUE img_spawn2(VALUE, VALUE);
VALUE img_spawn3(VALUE, VALUE, VALUE);
VALUE img_alloc(VALUE);
VALUE img_init(VALUE, VipsImage*);
VALUE img_init_partial();
VALUE img_init_partial_anyclass(VALUE);
VipsBandFmt img_id_to_band_fmt(VALUE);
void init_Image(void);

#define GetImg(obj, data, im) \
    vipsImg *data; \
    VipsImage *im __attribute__ ((unused)); \
    Data_Get_Struct(obj, vipsImg, data); \
    im = data->in;

#define OutImg(obj, new, data_new, im_new) \
    VALUE new = img_spawn(obj); \
    GetImg(new, data_new, im_new);

#define OutImg2(obj, obj2, new, data_new, im_new) \
    VALUE new = img_spawn2(obj, obj2); \
    GetImg(new, data_new, im_new);

#define OutImg3(obj, obj2, obj3, new, data_new, im_new) \
    VALUE new = img_spawn3(obj, obj2, obj3); \
    GetImg(new, data_new, im_new);

#define OutPartial(new, data_new, im_new) \
    VALUE new = img_init_partial(); \
    GetImg(new, data_new, im_new);

#define RUBY_VIPS_UNARY(VIPS_METHOD) \
    do { \
        GetImg(obj, data, im); \
        OutImg(obj, new, data_new, im_new); \
\
        if (VIPS_METHOD(im, im_new)) \
            vips_lib_error(); \
\
        return new; \
    } while(0)

#define RUBY_VIPS_BINARY(VIPS_METHOD) \
    do { \
        GetImg(obj, data, im); \
        GetImg(obj2, data2, im2); \
        OutImg2(obj, obj2, new, data_new, im_new); \
\
        if (VIPS_METHOD(im, im2, im_new)) \
            vips_lib_error(); \
\
        return new; \
    } while(0)

#endif

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby-vips-0.3.14 ext/image.h
ruby-vips-0.3.13 ext/image.h
ruby-vips-0.3.12 ext/image.h
ruby-vips-0.3.9 ext/image.h
ruby-vips-0.3.8 ext/image.h
ruby-vips-0.3.7 ext/image.h
ruby-vips-0.3.6 ext/image.h
ruby-vips-0.3.5 ext/image.h
ruby-vips-0.3.4 ext/image.h
ruby-vips-0.3.3 ext/image.h
ruby-vips-0.3.2 ext/image.h
ruby-vips-0.3.1 ext/image.h
ruby-vips-0.3.0 ext/image.h