summaryrefslogtreecommitdiff
path: root/src/plugins/splash/script/script-lib-image.script
blob: 00b1c19c2b06f2d5c303d7cb7bf747ae692266cf (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
Image.Adopt = fun (raw_image)
{
  if (raw_image) return raw_image | [] | Image;
  else return NULL;
};

Image.Rotate = fun (angle)
{
  return Image.Adopt (this._Rotate(angle));
};

Image.Scale = fun (width, height)
{
  return Image.Adopt (this._Scale(width, height));
};

Image.Text = fun (text, red, green, blue, alpha, font, align)
{
  return Image.Adopt (Image._Text (text, red, green, blue, alpha, font, align));
};

Image |= fun (filename)
{
  return Image.Adopt (Image._New(filename));
};

#------------------------- Compatability Functions -------------------------

fun ImageNew (filename)
{
  return Image (filename);
}

fun ImageScale (image, width, height)
{
  return image.Scale (width, height);
}

fun ImageRotate (image, angle)
{
  return image.Rotate (angle);
}

fun ImageGetWidth (image)
{
  return image.GetWidth ();
}

fun ImageGetHeight (image)
{
  return image.GetHeight ();
}