pike.git / lib / modules / _Image_XCF.pmod

version» Context lines:

pike.git/lib/modules/_Image_XCF.pmod:1:   #pike __REAL_VERSION__    + //! @appears Image.XCF + //! eXperimental Computing Facility (aka GIMP native) format. +    inherit Image._XCF;      #define SIGNED(X) if(X>=(1<<31)) X=-((1<<32)-X)      class PathPoint   {    int type;    float x;    float y;   }
pike.git/lib/modules/_Image_XCF.pmod:138:    if(d->properties) decode_properties( d->properties );    }   }         class LayerMask   {    inherit Channel;   }    + //!   class Layer   {    string name;    int opacity;    int type;    int mode;    int tattoo;    mapping flags = ([]);    int width, height;    int xoffset, yoffset;
pike.git/lib/modules/_Image_XCF.pmod:200:    type = data->type;    width = data->width;    height = data->height;    decode_properties( data->properties );    image = decode_image_data( data->image_data, pa );    if(data->mask)    mask = LayerMask( data->mask, pa );    }   }    + //!   class GimpImage   {    int width;    int height;    int compression;    int type;    int tattoo_state;    float xres = 72.0;    float yres = 72.0;    int res_unit;
pike.git/lib/modules/_Image_XCF.pmod:348:    width = data->width;    height = data->height;    foreach(data->layers, mapping l )    layers += ({ Layer( l, this ) });    foreach(data->channels, mapping c )    channels += ({ Channel( c, this ) });    }   }       -  + //!   GimpImage __decode( string|mapping what )   {    if(stringp(what)) what = ___decode( what );    return GimpImage(what);   }    -  + //!   mapping decode_header( string|mapping|object(GimpImage) data )   {    if( !objectp(data) )    {    if( stringp( data ) ) data = ___decode( data );    data = GimpImage( data );    }    return ([    "type":"image/x-gimp-image",    "xsize":data->width,
pike.git/lib/modules/_Image_XCF.pmod:396:    case VALUE_MODE: return "value";    case SCREEN_MODE: return "screen";    case OVERLAY_MODE: return "overlay";       default:    werror("WARNING: XCF: Unsupported mode: "+mode+"\n");    return "normal";    }   }    + //!   array decode_layers( string|object|mapping what, mapping|void opts,    int|void concat )   {    if(!opts) opts = ([]);    int shrink = (opts->shrink_fact||1);       if(!objectp( what ) )    what = __decode( what );       array layers = ({});
pike.git/lib/modules/_Image_XCF.pmod:474:    lay->set_misc_value( "parasites", l->parasites );    lay->set_misc_value( "visible", l->flags->visible );    if( l == l->parent->active_layer )    lay->set_misc_value( "active", 1 );    }    }       return layers;   }    + //!   mapping _decode( string|mapping|object(GimpImage) what, mapping|void opts )   {    if(!opts) opts = ([]);    GimpImage data;    if( objectp( what ) )    data = what;    else    data = __decode( what );    what = 0;   
pike.git/lib/modules/_Image_XCF.pmod:594:   // Array.map( data->layers, lambda(object o) { destruct(o); } );   // destruct( data );    return    ([    "type":"image/x-gimp-image",    "image":img,    "alpha":alpha,    ]);   }    -  + //! @decl Image.Image decode(string bytes, mapping|void options)   object decode( string what,mapping|void opts )   {    return _decode( what,opts )->image;   }      // --- Encoding      #if 0      #define PROP(X,Y) sprintf("%4c%4c%s", PROP_##X, sizeof(Y), (Y))