summaryrefslogtreecommitdiffstats
path: root/chalk/plugins/viewplugins/scripting/chalkcore/krs_image.h
blob: 91314f3f881684029033630ec701a388fab43127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 *  Copyright (c) 2005 Cyrille Berger <cberger@cberger.net>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Library General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef KROSS_KRITACOREKRSIMAGE_H
#define KROSS_KRITACOREKRSIMAGE_H

#include <api/class.h>

#include <kis_types.h>

class KisDoc;

namespace Kross {

namespace ChalkCore {

class Image : public Kross::Api::Class<Image>
{
    public:
        Image(KisImageSP image, KisDoc* doc = 0);
        ~Image();
        virtual const TQString getClassName() const;
    private:
        /**
         * Return the active PaintLayer, if any.
         */
        Kross::Api::Object::Ptr getActivePaintLayer(Kross::Api::List::Ptr);
        /**
         * Return the width of the image.
         */
        Kross::Api::Object::Ptr getWidth(Kross::Api::List::Ptr);
        /**
         * Return the height of the image.
         */
        Kross::Api::Object::Ptr getHeight(Kross::Api::List::Ptr);
        /**
         * Resize an image
         */
        Kross::Api::Object::Ptr resize(Kross::Api::List::Ptr);
        /**
         * Scale an image
         */
        Kross::Api::Object::Ptr scale(Kross::Api::List::Ptr);
        /**
         * Convert the image to a colorspace.
         * This function takes one argument :
         *  - the name of the destination colorspace
         * 
         * For example (in Ruby) :
         * @code
         * image.convertToColorspace("CMYK")
         * @endcode
         */
        Kross::Api::Object::Ptr convertToColorspace(Kross::Api::List::Ptr args);
        /**
         * Return the id of the colorspace of this image.
         */
        Kross::Api::Object::Ptr colorSpaceId(Kross::Api::List::Ptr );
        /**
         * Create a new PaintLayer for this image, and return it.
         * This function takes at least two arguments :
         *  - the name of the layer
         *  - the opacity of the layer (between 0 and 255)
         * 
         * This function can take one optional argument :
         *  - the id of the colorSpace (if this is not specified, the new PaintLayer
         *      will have the same colorspace as the image)
         */
        Kross::Api::Object::Ptr createPaintLayer(Kross::Api::List::Ptr args);
    private:
        KisImageSP m_image;
        KisDoc* m_doc;
};

}

}

#endif