Class: Decoder

Inherits:
Object
  • Object
show all
Defined in:
ext/libsixel/libsixel.c

Instance Method Summary collapse

Constructor Details

#initializeObject



117
118
119
120
121
# File 'ext/libsixel/libsixel.c', line 117

static VALUE
sixel_ruby_decoder_initialize(VALUE self)
{
    return Qnil;
}

Instance Method Details

#encodeObject



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'ext/libsixel/libsixel.c', line 146

static VALUE
sixel_ruby_decoder_decode(VALUE self)
{
    sixel_decoder_t *decoder;
    SIXELSTATUS status;

    Data_Get_Struct(self, sixel_decoder_t, decoder);

    status = sixel_decoder_decode(decoder);
    if (SIXEL_FAILED(status)) {
        rb_raise(rb_eRuntimeError,
                 "sixel_decoder_decode() failed: %s / %s",
                 sixel_helper_format_error(status),
                 sixel_helper_get_additional_message());
    }

    return Qnil;
}

#setopt(option, optval) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'ext/libsixel/libsixel.c', line 124

static VALUE
sixel_ruby_decoder_setopt(VALUE self, VALUE option, VALUE optval)
{
    sixel_decoder_t *decoder;
    SIXELSTATUS status;

    Data_Get_Struct(self, sixel_decoder_t, decoder);

    status = sixel_decoder_setopt(decoder,
                                  *StringValueCStr(option),
                                  StringValueCStr(optval));
    if (SIXEL_FAILED(status)) {
        rb_raise(rb_eRuntimeError,
                 "sixel_decoder_setopt() failed: %s / %s",
                 sixel_helper_format_error(status),
                 sixel_helper_get_additional_message());
    }

    return Qnil;
}