Changeset 2821 for libcaca/trunk/ruby/caca-dither.c
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/ruby/caca-dither.c
r2820 r2821 1 1 /* 2 * libc uculRuby bindings2 * libcaca Ruby bindings 3 3 * Copyright (c) 2007 Pascal Terjan <pterjan@linuxfr.org> 4 4 * … … 11 11 12 12 #include <ruby.h> 13 #include <c ucul.h>13 #include <caca.h> 14 14 #include <errno.h> 15 15 #include "common.h" … … 19 19 void dither_free(void *dither) 20 20 { 21 c ucul_free_dither((cucul_dither_t *)dither);21 caca_free_dither((caca_dither_t *)dither); 22 22 } 23 23 … … 31 31 static VALUE dither_initialize(VALUE self, VALUE bpp, VALUE w, VALUE h, VALUE pitch, VALUE rmask, VALUE gmask, VALUE bmask, VALUE amask) 32 32 { 33 c ucul_dither_t *dither;34 35 dither = c ucul_create_dither(NUM2UINT(bpp), NUM2UINT(w), NUM2UINT(h), NUM2UINT(pitch), NUM2ULONG(rmask), NUM2ULONG(gmask), NUM2ULONG(bmask), NUM2ULONG(amask));33 caca_dither_t *dither; 34 35 dither = caca_create_dither(NUM2UINT(bpp), NUM2UINT(w), NUM2UINT(h), NUM2UINT(pitch), NUM2ULONG(rmask), NUM2ULONG(gmask), NUM2ULONG(bmask), NUM2ULONG(amask)); 36 36 if(dither == NULL) 37 37 { … … 116 116 } 117 117 118 if(c ucul_set_dither_palette(_SELF, red, green, blue, alpha)<0)118 if(caca_set_dither_palette(_SELF, red, green, blue, alpha)<0) 119 119 { 120 120 free(red); … … 142 142 static VALUE set_##x(VALUE self, VALUE x) \ 143 143 { \ 144 if(c ucul_set_dither_##x(_SELF, (float)NUM2DBL(x))<0)\144 if(caca_set_dither_##x(_SELF, (float)NUM2DBL(x))<0)\ 145 145 rb_raise(rb_eRuntimeError, strerror(errno)); \ 146 146 \ … … 162 162 static VALUE set_dither_##x(VALUE self, VALUE x) \ 163 163 { \ 164 if(c ucul_set_dither_##x(_SELF, StringValuePtr(x))<0) \164 if(caca_set_dither_##x(_SELF, StringValuePtr(x))<0) \ 165 165 { \ 166 166 rb_raise(rb_eRuntimeError, strerror(errno)); \ … … 180 180 get_set_str_from_list(algorithm) 181 181 182 void Init_c ucul_dither(VALUE mCucul)182 void Init_caca_dither(VALUE mCucul) 183 183 { 184 184 cDither = rb_define_class_under(mCucul, "Dither", rb_cObject);
Note: See TracChangeset
for help on using the changeset viewer.