~statik/ubuntu/maverick/erlang/erlang-merge-testing

« back to all changes in this revision

Viewing changes to lib/wx/src/gen/wxImage.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-01 10:14:38 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090501101438-6qlr6rsdxgyzrg2z
Tags: 1:13.b-dfsg-2
* Cleaned up patches: removed unneeded patch which helped to support
  different SCTP library versions, made sure that changes for m68k
  architecture applied only when building on this architecture.
* Removed duplicated information from binary packages descriptions.
* Don't require libsctp-dev build-dependency on solaris-i386 architecture
  which allows to build Erlang on Nexenta (thanks to Tim Spriggs for
  the suggestion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
 
5
%% 
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%% 
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%% This file is generated DO NOT EDIT
 
19
 
 
20
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html">wxImage</a>.
 
21
%%
 
22
%% All (default) image handlers are initialized.
 
23
 
 
24
%%
 
25
%% @type wxImage().  An object reference, The representation is internal
 
26
%% and can be changed without notice. It can't be used for comparsion
 
27
%% stored on disc or distributed for use on other nodes.
 
28
 
 
29
-module(wxImage).
 
30
-include("wxe.hrl").
 
31
-export(['Destroy'/1,blur/2,blurHorizontal/2,blurVertical/2,convertAlphaToMask/1,
 
32
  convertAlphaToMask/2,convertToGreyscale/1,convertToGreyscale/2,convertToMono/4,
 
33
  copy/1,create/3,create/4,create/5,create/6,destroy/1,findFirstUnusedColour/1,
 
34
  findFirstUnusedColour/2,getAlpha/1,getAlpha/3,getBlue/3,getData/1,
 
35
  getGreen/3,getHeight/1,getImageCount/1,getImageCount/2,getImageExtWildcard/0,
 
36
  getMaskBlue/1,getMaskGreen/1,getMaskRed/1,getOption/2,getOptionInt/2,
 
37
  getOrFindMaskColour/1,getPalette/1,getRed/3,getSubImage/2,getWidth/1,
 
38
  hasAlpha/1,hasMask/1,hasOption/2,initAlpha/1,initStandardHandlers/0,
 
39
  isTransparent/3,isTransparent/4,loadFile/2,loadFile/3,loadFile/4,mirror/1,
 
40
  mirror/2,new/0,new/1,new/2,new/3,new/4,new/5,ok/1,removeHandler/1,replace/7,
 
41
  rescale/3,rescale/4,resize/3,resize/4,rotate/3,rotate/4,rotate90/1,rotate90/2,
 
42
  rotateHue/2,saveFile/2,saveFile/3,scale/3,scale/4,setAlpha/2,setAlpha/3,
 
43
  setAlpha/4,setData/2,setData/3,setData/4,setData/5,setMask/1,setMask/2,
 
44
  setMaskColour/4,setMaskFromImage/5,setOption/3,setPalette/2,setRGB/5,
 
45
  setRGB/6,size/3,size/4]).
 
46
 
 
47
%% inherited exports
 
48
-export([parent_class/1]).
 
49
 
 
50
%% @hidden
 
51
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
 
52
 
 
53
%% @spec () -> wxImage()
 
54
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
 
55
new() ->
 
56
  wxe_util:construct(?wxImage_new_0,
 
57
  <<>>).
 
58
 
 
59
%% @spec (Name::string()) -> wxImage()
 
60
%% @equiv new(Name, [])
 
61
new(Name)
 
62
 when is_list(Name) ->
 
63
  new(Name, []).
 
64
 
 
65
%% @spec (X::integer()|string(),X::integer()|term()) -> wxImage()
 
66
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
 
67
%% <br /> Alternatives: 
 
68
%% <p><c>
 
69
%% new(Width::integer(), Height::integer()) -> new(Width,Height, []) </c></p>
 
70
%% <p><c>
 
71
%% new(Name::string(), [Option]) -> wxImage() </c>
 
72
%%<br /> Option = {type, integer()} | {index, integer()}
 
73
%% </p>
 
74
 
 
75
new(Width,Height)
 
76
 when is_integer(Width),is_integer(Height) ->
 
77
  new(Width,Height, []);
 
78
new(Name, Options)
 
79
 when is_list(Name),is_list(Options) ->
 
80
  Name_UC = unicode:characters_to_binary([Name,0]),
 
81
  MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc];
 
82
          ({index, Index}, Acc) -> [<<2:32/?UI,Index:32/?UI>>|Acc];
 
83
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
84
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
85
  wxe_util:construct(?wxImage_new_2,
 
86
  <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
 
87
 
 
88
%% @spec (X::integer()|string(),X::integer()|string(),X::binary()|term()) -> wxImage()
 
89
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
 
90
%% <br /> Alternatives: 
 
91
%% <p><c>
 
92
%% new(Width::integer(), Height::integer(), Data::binary()) -> new(Width,Height,Data, []) </c></p>
 
93
%% <p><c>
 
94
%% new(Width::integer(), Height::integer(), [Option]) -> wxImage() </c>
 
95
%%<br /> Option = {clear, bool()}
 
96
%% </p>
 
97
%% <p><c>
 
98
%% new(Name::string(), Mimetype::string(), [Option]) -> wxImage() </c>
 
99
%%<br /> Option = {index, integer()}
 
100
%% </p>
 
101
 
 
102
new(Width,Height,Data)
 
103
 when is_integer(Width),is_integer(Height),is_binary(Data) ->
 
104
  new(Width,Height,Data, []);
 
105
new(Width,Height, Options)
 
106
 when is_integer(Width),is_integer(Height),is_list(Options) ->
 
107
  MOpts = fun({clear, Clear}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Clear)):32/?UI>>|Acc];
 
108
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
109
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
110
  wxe_util:construct(?wxImage_new_3_0,
 
111
  <<Width:32/?UI,Height:32/?UI, BinOpt/binary>>);
 
112
new(Name,Mimetype, Options)
 
113
 when is_list(Name),is_list(Mimetype),is_list(Options) ->
 
114
  Name_UC = unicode:characters_to_binary([Name,0]),
 
115
  Mimetype_UC = unicode:characters_to_binary([Mimetype,0]),
 
116
  MOpts = fun({index, Index}, Acc) -> [<<1:32/?UI,Index:32/?UI>>|Acc];
 
117
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
118
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
119
  wxe_util:construct(?wxImage_new_3_1,
 
120
  <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
 
121
 
 
122
%% @spec (Width::integer(),Height::integer(),Data::binary(),X::binary()|term()) -> wxImage()
 
123
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
 
124
%% <br /> Alternatives: 
 
125
%% <p><c>
 
126
%% new(Width::integer(), Height::integer(), Data::binary(), Alpha::binary()) -> new(Width,Height,Data,Alpha, []) </c></p>
 
127
%% <p><c>
 
128
%% new(Width::integer(), Height::integer(), Data::binary(), [Option]) -> wxImage() </c>
 
129
%%<br /> Option = {static_data, bool()}
 
130
%% </p>
 
131
 
 
132
new(Width,Height,Data,Alpha)
 
133
 when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha) ->
 
134
  new(Width,Height,Data,Alpha, []);
 
135
new(Width,Height,Data, Options)
 
136
 when is_integer(Width),is_integer(Height),is_binary(Data),is_list(Options) ->
 
137
  wxe_util:send_bin(Data),
 
138
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
139
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
140
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
141
  wxe_util:construct(?wxImage_new_4,
 
142
  <<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
 
143
 
 
144
%% @spec (Width::integer(), Height::integer(), Data::binary(), Alpha::binary(), [Option]) -> wxImage()
 
145
%% Option = {static_data, bool()}
 
146
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
 
147
new(Width,Height,Data,Alpha, Options)
 
148
 when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha),is_list(Options) ->
 
149
  wxe_util:send_bin(Data),
 
150
  wxe_util:send_bin(Alpha),
 
151
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
152
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
153
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
154
  wxe_util:construct(?wxImage_new_5,
 
155
  <<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
 
156
 
 
157
%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
 
158
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblur">external documentation</a>.
 
159
blur(#wx_ref{type=ThisT,ref=ThisRef},Radius)
 
160
 when is_integer(Radius) ->
 
161
  ?CLASS(ThisT,wxImage),
 
162
  wxe_util:call(?wxImage_Blur,
 
163
  <<ThisRef:32/?UI,Radius:32/?UI>>).
 
164
 
 
165
%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
 
166
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblurhorizontal">external documentation</a>.
 
167
blurHorizontal(#wx_ref{type=ThisT,ref=ThisRef},Radius)
 
168
 when is_integer(Radius) ->
 
169
  ?CLASS(ThisT,wxImage),
 
170
  wxe_util:call(?wxImage_BlurHorizontal,
 
171
  <<ThisRef:32/?UI,Radius:32/?UI>>).
 
172
 
 
173
%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
 
174
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblurvertical">external documentation</a>.
 
175
blurVertical(#wx_ref{type=ThisT,ref=ThisRef},Radius)
 
176
 when is_integer(Radius) ->
 
177
  ?CLASS(ThisT,wxImage),
 
178
  wxe_util:call(?wxImage_BlurVertical,
 
179
  <<ThisRef:32/?UI,Radius:32/?UI>>).
 
180
 
 
181
%% @spec (This::wxImage()) -> bool()
 
182
%% @equiv convertAlphaToMask(This, [])
 
183
convertAlphaToMask(This)
 
184
 when is_record(This, wx_ref) ->
 
185
  convertAlphaToMask(This, []).
 
186
 
 
187
%% @spec (This::wxImage(), [Option]) -> bool()
 
188
%% Option = {threshold, integer()}
 
189
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconvertalphatomask">external documentation</a>.
 
190
convertAlphaToMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
191
 when is_list(Options) ->
 
192
  ?CLASS(ThisT,wxImage),
 
193
  MOpts = fun({threshold, Threshold}, Acc) -> [<<1:32/?UI,Threshold:32/?UI>>|Acc];
 
194
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
195
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
196
  wxe_util:call(?wxImage_ConvertAlphaToMask,
 
197
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
198
 
 
199
%% @spec (This::wxImage()) -> wxImage()
 
200
%% @equiv convertToGreyscale(This, [])
 
201
convertToGreyscale(This)
 
202
 when is_record(This, wx_ref) ->
 
203
  convertToGreyscale(This, []).
 
204
 
 
205
%% @spec (This::wxImage(), [Option]) -> wxImage()
 
206
%% Option = {lr, float()} | {lg, float()} | {lb, float()}
 
207
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconverttogreyscale">external documentation</a>.
 
208
convertToGreyscale(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
209
 when is_list(Options) ->
 
210
  ?CLASS(ThisT,wxImage),
 
211
  MOpts = fun({lr, Lr}, Acc) -> [<<1:32/?UI,0:32,Lr:64/?F>>|Acc];
 
212
          ({lg, Lg}, Acc) -> [<<2:32/?UI,0:32,Lg:64/?F>>|Acc];
 
213
          ({lb, Lb}, Acc) -> [<<3:32/?UI,0:32,Lb:64/?F>>|Acc];
 
214
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
215
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
216
  wxe_util:call(?wxImage_ConvertToGreyscale,
 
217
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
218
 
 
219
%% @spec (This::wxImage(), R::integer(), G::integer(), B::integer()) -> wxImage()
 
220
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconverttomono">external documentation</a>.
 
221
convertToMono(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
 
222
 when is_integer(R),is_integer(G),is_integer(B) ->
 
223
  ?CLASS(ThisT,wxImage),
 
224
  wxe_util:call(?wxImage_ConvertToMono,
 
225
  <<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
 
226
 
 
227
%% @spec (This::wxImage()) -> wxImage()
 
228
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecopy">external documentation</a>.
 
229
copy(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
230
  ?CLASS(ThisT,wxImage),
 
231
  wxe_util:call(?wxImage_Copy,
 
232
  <<ThisRef:32/?UI>>).
 
233
 
 
234
%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> bool()
 
235
%% @equiv create(This,Width,Height, [])
 
236
create(This,Width,Height)
 
237
 when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
 
238
  create(This,Width,Height, []).
 
239
 
 
240
%% @spec (This::wxImage(),Width::integer(),Height::integer(),X::binary()|term()) -> bool()
 
241
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
 
242
%% <br /> Alternatives: 
 
243
%% <p><c>
 
244
%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary()) -> create(This,Width,Height,Data, []) </c></p>
 
245
%% <p><c>
 
246
%% create(This::wxImage(), Width::integer(), Height::integer(), [Option]) -> bool() </c>
 
247
%%<br /> Option = {clear, bool()}
 
248
%% </p>
 
249
 
 
250
create(This,Width,Height,Data)
 
251
 when is_record(This, wx_ref),is_integer(Width),is_integer(Height),is_binary(Data) ->
 
252
  create(This,Width,Height,Data, []);
 
253
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
 
254
 when is_integer(Width),is_integer(Height),is_list(Options) ->
 
255
  ?CLASS(ThisT,wxImage),
 
256
  MOpts = fun({clear, Clear}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Clear)):32/?UI>>|Acc];
 
257
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
258
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
259
  wxe_util:call(?wxImage_Create_3,
 
260
  <<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
 
261
 
 
262
%% @spec (This::wxImage(),Width::integer(),Height::integer(),Data::binary(),X::binary()|term()) -> bool()
 
263
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
 
264
%% <br /> Alternatives: 
 
265
%% <p><c>
 
266
%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary()) -> create(This,Width,Height,Data,Alpha, []) </c></p>
 
267
%% <p><c>
 
268
%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary(), [Option]) -> bool() </c>
 
269
%%<br /> Option = {static_data, bool()}
 
270
%% </p>
 
271
 
 
272
create(This,Width,Height,Data,Alpha)
 
273
 when is_record(This, wx_ref),is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha) ->
 
274
  create(This,Width,Height,Data,Alpha, []);
 
275
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,Data, Options)
 
276
 when is_integer(Width),is_integer(Height),is_binary(Data),is_list(Options) ->
 
277
  ?CLASS(ThisT,wxImage),
 
278
  wxe_util:send_bin(Data),
 
279
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
280
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
281
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
282
  wxe_util:call(?wxImage_Create_4,
 
283
  <<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
 
284
 
 
285
%% @spec (This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary(), [Option]) -> bool()
 
286
%% Option = {static_data, bool()}
 
287
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
 
288
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,Data,Alpha, Options)
 
289
 when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha),is_list(Options) ->
 
290
  ?CLASS(ThisT,wxImage),
 
291
  wxe_util:send_bin(Data),
 
292
  wxe_util:send_bin(Alpha),
 
293
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
294
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
295
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
296
  wxe_util:call(?wxImage_Create_5,
 
297
  <<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
 
298
 
 
299
%% @spec (This::wxImage()) -> ok
 
300
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagedestroy">external documentation</a>.
 
301
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
302
  ?CLASS(ThisT,wxImage),
 
303
  wxe_util:cast(?wxImage_Destroy,
 
304
  <<ThisRef:32/?UI>>).
 
305
 
 
306
%% @spec (This::wxImage()) -> {bool(),R::integer(),G::integer(),B::integer()}
 
307
%% @equiv findFirstUnusedColour(This, [])
 
308
findFirstUnusedColour(This)
 
309
 when is_record(This, wx_ref) ->
 
310
  findFirstUnusedColour(This, []).
 
311
 
 
312
%% @spec (This::wxImage(), [Option]) -> {bool(),R::integer(),G::integer(),B::integer()}
 
313
%% Option = {startR, integer()} | {startG, integer()} | {startB, integer()}
 
314
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagefindfirstunusedcolour">external documentation</a>.
 
315
findFirstUnusedColour(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
316
 when is_list(Options) ->
 
317
  ?CLASS(ThisT,wxImage),
 
318
  MOpts = fun({startR, StartR}, Acc) -> [<<1:32/?UI,StartR:32/?UI>>|Acc];
 
319
          ({startG, StartG}, Acc) -> [<<2:32/?UI,StartG:32/?UI>>|Acc];
 
320
          ({startB, StartB}, Acc) -> [<<3:32/?UI,StartB:32/?UI>>|Acc];
 
321
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
322
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
323
  wxe_util:call(?wxImage_FindFirstUnusedColour,
 
324
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
325
 
 
326
%% @spec () -> string()
 
327
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetimageextwildcard">external documentation</a>.
 
328
getImageExtWildcard() ->
 
329
  wxe_util:call(?wxImage_GetImageExtWildcard,
 
330
  <<>>).
 
331
 
 
332
%% @spec (This::wxImage()) -> binary()
 
333
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetalpha">external documentation</a>.
 
334
getAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
335
  ?CLASS(ThisT,wxImage),
 
336
  wxe_util:call(?wxImage_GetAlpha_0,
 
337
  <<ThisRef:32/?UI>>).
 
338
 
 
339
%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
 
340
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetalpha">external documentation</a>.
 
341
getAlpha(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
 
342
 when is_integer(X),is_integer(Y) ->
 
343
  ?CLASS(ThisT,wxImage),
 
344
  wxe_util:call(?wxImage_GetAlpha_2,
 
345
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
 
346
 
 
347
%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
 
348
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetblue">external documentation</a>.
 
349
getBlue(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
 
350
 when is_integer(X),is_integer(Y) ->
 
351
  ?CLASS(ThisT,wxImage),
 
352
  wxe_util:call(?wxImage_GetBlue,
 
353
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
 
354
 
 
355
%% @spec (This::wxImage()) -> binary()
 
356
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetdata">external documentation</a>.
 
357
getData(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
358
  ?CLASS(ThisT,wxImage),
 
359
  wxe_util:call(?wxImage_GetData,
 
360
  <<ThisRef:32/?UI>>).
 
361
 
 
362
%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
 
363
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetgreen">external documentation</a>.
 
364
getGreen(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
 
365
 when is_integer(X),is_integer(Y) ->
 
366
  ?CLASS(ThisT,wxImage),
 
367
  wxe_util:call(?wxImage_GetGreen,
 
368
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
 
369
 
 
370
%% @spec (Name::string()) -> integer()
 
371
%% @equiv getImageCount(Name, [])
 
372
getImageCount(Name)
 
373
 when is_list(Name) ->
 
374
  getImageCount(Name, []).
 
375
 
 
376
%% @spec (Name::string(), [Option]) -> integer()
 
377
%% Option = {type, integer()}
 
378
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetimagecount">external documentation</a>.
 
379
getImageCount(Name, Options)
 
380
 when is_list(Name),is_list(Options) ->
 
381
  Name_UC = unicode:characters_to_binary([Name,0]),
 
382
  MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc];
 
383
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
384
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
385
  wxe_util:call(?wxImage_GetImageCount,
 
386
  <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
 
387
 
 
388
%% @spec (This::wxImage()) -> integer()
 
389
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetheight">external documentation</a>.
 
390
getHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
391
  ?CLASS(ThisT,wxImage),
 
392
  wxe_util:call(?wxImage_GetHeight,
 
393
  <<ThisRef:32/?UI>>).
 
394
 
 
395
%% @spec (This::wxImage()) -> integer()
 
396
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskblue">external documentation</a>.
 
397
getMaskBlue(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
398
  ?CLASS(ThisT,wxImage),
 
399
  wxe_util:call(?wxImage_GetMaskBlue,
 
400
  <<ThisRef:32/?UI>>).
 
401
 
 
402
%% @spec (This::wxImage()) -> integer()
 
403
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskgreen">external documentation</a>.
 
404
getMaskGreen(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
405
  ?CLASS(ThisT,wxImage),
 
406
  wxe_util:call(?wxImage_GetMaskGreen,
 
407
  <<ThisRef:32/?UI>>).
 
408
 
 
409
%% @spec (This::wxImage()) -> integer()
 
410
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskred">external documentation</a>.
 
411
getMaskRed(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
412
  ?CLASS(ThisT,wxImage),
 
413
  wxe_util:call(?wxImage_GetMaskRed,
 
414
  <<ThisRef:32/?UI>>).
 
415
 
 
416
%% @spec (This::wxImage()) -> {bool(),R::integer(),G::integer(),B::integer()}
 
417
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetorfindmaskcolour">external documentation</a>.
 
418
getOrFindMaskColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
419
  ?CLASS(ThisT,wxImage),
 
420
  wxe_util:call(?wxImage_GetOrFindMaskColour,
 
421
  <<ThisRef:32/?UI>>).
 
422
 
 
423
%% @spec (This::wxImage()) -> wxPalette:wxPalette()
 
424
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetpalette">external documentation</a>.
 
425
getPalette(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
426
  ?CLASS(ThisT,wxImage),
 
427
  wxe_util:call(?wxImage_GetPalette,
 
428
  <<ThisRef:32/?UI>>).
 
429
 
 
430
%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
 
431
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetred">external documentation</a>.
 
432
getRed(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
 
433
 when is_integer(X),is_integer(Y) ->
 
434
  ?CLASS(ThisT,wxImage),
 
435
  wxe_util:call(?wxImage_GetRed,
 
436
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
 
437
 
 
438
%% @spec (This::wxImage(), Rect::{X::integer(),Y::integer(),W::integer(),H::integer()}) -> wxImage()
 
439
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetsubimage">external documentation</a>.
 
440
getSubImage(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
 
441
 when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
 
442
  ?CLASS(ThisT,wxImage),
 
443
  wxe_util:call(?wxImage_GetSubImage,
 
444
  <<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
 
445
 
 
446
%% @spec (This::wxImage()) -> integer()
 
447
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetwidth">external documentation</a>.
 
448
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
449
  ?CLASS(ThisT,wxImage),
 
450
  wxe_util:call(?wxImage_GetWidth,
 
451
  <<ThisRef:32/?UI>>).
 
452
 
 
453
%% @spec (This::wxImage()) -> bool()
 
454
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasalpha">external documentation</a>.
 
455
hasAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
456
  ?CLASS(ThisT,wxImage),
 
457
  wxe_util:call(?wxImage_HasAlpha,
 
458
  <<ThisRef:32/?UI>>).
 
459
 
 
460
%% @spec (This::wxImage()) -> bool()
 
461
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasmask">external documentation</a>.
 
462
hasMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
463
  ?CLASS(ThisT,wxImage),
 
464
  wxe_util:call(?wxImage_HasMask,
 
465
  <<ThisRef:32/?UI>>).
 
466
 
 
467
%% @spec (This::wxImage(), Name::string()) -> string()
 
468
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetoption">external documentation</a>.
 
469
getOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
 
470
 when is_list(Name) ->
 
471
  ?CLASS(ThisT,wxImage),
 
472
  Name_UC = unicode:characters_to_binary([Name,0]),
 
473
  wxe_util:call(?wxImage_GetOption,
 
474
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
 
475
 
 
476
%% @spec (This::wxImage(), Name::string()) -> integer()
 
477
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetoptionint">external documentation</a>.
 
478
getOptionInt(#wx_ref{type=ThisT,ref=ThisRef},Name)
 
479
 when is_list(Name) ->
 
480
  ?CLASS(ThisT,wxImage),
 
481
  Name_UC = unicode:characters_to_binary([Name,0]),
 
482
  wxe_util:call(?wxImage_GetOptionInt,
 
483
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
 
484
 
 
485
%% @spec (This::wxImage(), Name::string()) -> bool()
 
486
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasoption">external documentation</a>.
 
487
hasOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
 
488
 when is_list(Name) ->
 
489
  ?CLASS(ThisT,wxImage),
 
490
  Name_UC = unicode:characters_to_binary([Name,0]),
 
491
  wxe_util:call(?wxImage_HasOption,
 
492
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
 
493
 
 
494
%% @spec (This::wxImage()) -> ok
 
495
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageinitalpha">external documentation</a>.
 
496
initAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
497
  ?CLASS(ThisT,wxImage),
 
498
  wxe_util:cast(?wxImage_InitAlpha,
 
499
  <<ThisRef:32/?UI>>).
 
500
 
 
501
%% @spec () -> ok
 
502
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageinitstandardhandlers">external documentation</a>.
 
503
initStandardHandlers() ->
 
504
  wxe_util:cast(?wxImage_InitStandardHandlers,
 
505
  <<>>).
 
506
 
 
507
%% @spec (This::wxImage(), X::integer(), Y::integer()) -> bool()
 
508
%% @equiv isTransparent(This,X,Y, [])
 
509
isTransparent(This,X,Y)
 
510
 when is_record(This, wx_ref),is_integer(X),is_integer(Y) ->
 
511
  isTransparent(This,X,Y, []).
 
512
 
 
513
%% @spec (This::wxImage(), X::integer(), Y::integer(), [Option]) -> bool()
 
514
%% Option = {threshold, integer()}
 
515
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageistransparent">external documentation</a>.
 
516
isTransparent(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
 
517
 when is_integer(X),is_integer(Y),is_list(Options) ->
 
518
  ?CLASS(ThisT,wxImage),
 
519
  MOpts = fun({threshold, Threshold}, Acc) -> [<<1:32/?UI,Threshold:32/?UI>>|Acc];
 
520
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
521
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
522
  wxe_util:call(?wxImage_IsTransparent,
 
523
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
 
524
 
 
525
%% @spec (This::wxImage(), Name::string()) -> bool()
 
526
%% @equiv loadFile(This,Name, [])
 
527
loadFile(This,Name)
 
528
 when is_record(This, wx_ref),is_list(Name) ->
 
529
  loadFile(This,Name, []).
 
530
 
 
531
%% @spec (This::wxImage(), Name::string(), [Option]) -> bool()
 
532
%% Option = {type, integer()} | {index, integer()}
 
533
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageloadfile">external documentation</a>.
 
534
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options)
 
535
 when is_list(Name),is_list(Options) ->
 
536
  ?CLASS(ThisT,wxImage),
 
537
  Name_UC = unicode:characters_to_binary([Name,0]),
 
538
  MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc];
 
539
          ({index, Index}, Acc) -> [<<2:32/?UI,Index:32/?UI>>|Acc];
 
540
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
541
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
542
  wxe_util:call(?wxImage_LoadFile_2,
 
543
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
 
544
 
 
545
%% @spec (This::wxImage(), Name::string(), Mimetype::string(), [Option]) -> bool()
 
546
%% Option = {index, integer()}
 
547
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageloadfile">external documentation</a>.
 
548
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype, Options)
 
549
 when is_list(Name),is_list(Mimetype),is_list(Options) ->
 
550
  ?CLASS(ThisT,wxImage),
 
551
  Name_UC = unicode:characters_to_binary([Name,0]),
 
552
  Mimetype_UC = unicode:characters_to_binary([Mimetype,0]),
 
553
  MOpts = fun({index, Index}, Acc) -> [<<1:32/?UI,Index:32/?UI>>|Acc];
 
554
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
555
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
556
  wxe_util:call(?wxImage_LoadFile_3,
 
557
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
 
558
 
 
559
%% @spec (This::wxImage()) -> bool()
 
560
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageok">external documentation</a>.
 
561
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
562
  ?CLASS(ThisT,wxImage),
 
563
  wxe_util:call(?wxImage_Ok,
 
564
  <<ThisRef:32/?UI>>).
 
565
 
 
566
%% @spec (Name::string()) -> bool()
 
567
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageremovehandler">external documentation</a>.
 
568
removeHandler(Name)
 
569
 when is_list(Name) ->
 
570
  Name_UC = unicode:characters_to_binary([Name,0]),
 
571
  wxe_util:call(?wxImage_RemoveHandler,
 
572
  <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
 
573
 
 
574
%% @spec (This::wxImage()) -> wxImage()
 
575
%% @equiv mirror(This, [])
 
576
mirror(This)
 
577
 when is_record(This, wx_ref) ->
 
578
  mirror(This, []).
 
579
 
 
580
%% @spec (This::wxImage(), [Option]) -> wxImage()
 
581
%% Option = {horizontally, bool()}
 
582
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagemirror">external documentation</a>.
 
583
mirror(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
584
 when is_list(Options) ->
 
585
  ?CLASS(ThisT,wxImage),
 
586
  MOpts = fun({horizontally, Horizontally}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Horizontally)):32/?UI>>|Acc];
 
587
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
588
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
589
  wxe_util:call(?wxImage_Mirror,
 
590
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
591
 
 
592
%% @spec (This::wxImage(), R1::integer(), G1::integer(), B1::integer(), R2::integer(), G2::integer(), B2::integer()) -> ok
 
593
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagereplace">external documentation</a>.
 
594
replace(#wx_ref{type=ThisT,ref=ThisRef},R1,G1,B1,R2,G2,B2)
 
595
 when is_integer(R1),is_integer(G1),is_integer(B1),is_integer(R2),is_integer(G2),is_integer(B2) ->
 
596
  ?CLASS(ThisT,wxImage),
 
597
  wxe_util:cast(?wxImage_Replace,
 
598
  <<ThisRef:32/?UI,R1:32/?UI,G1:32/?UI,B1:32/?UI,R2:32/?UI,G2:32/?UI,B2:32/?UI>>).
 
599
 
 
600
%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> wxImage()
 
601
%% @equiv rescale(This,Width,Height, [])
 
602
rescale(This,Width,Height)
 
603
 when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
 
604
  rescale(This,Width,Height, []).
 
605
 
 
606
%% @spec (This::wxImage(), Width::integer(), Height::integer(), [Option]) -> wxImage()
 
607
%% Option = {quality, integer()}
 
608
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerescale">external documentation</a>.
 
609
rescale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
 
610
 when is_integer(Width),is_integer(Height),is_list(Options) ->
 
611
  ?CLASS(ThisT,wxImage),
 
612
  MOpts = fun({quality, Quality}, Acc) -> [<<1:32/?UI,Quality:32/?UI>>|Acc];
 
613
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
614
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
615
  wxe_util:call(?wxImage_Rescale,
 
616
  <<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
 
617
 
 
618
%% @spec (This::wxImage(), Size::{W::integer(),H::integer()}, Pos::{X::integer(),Y::integer()}) -> wxImage()
 
619
%% @equiv resize(This,Size,Pos, [])
 
620
resize(This,Size={SizeW,SizeH},Pos={PosX,PosY})
 
621
 when is_record(This, wx_ref),is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY) ->
 
622
  resize(This,Size,Pos, []).
 
623
 
 
624
%% @spec (This::wxImage(), Size::{W::integer(),H::integer()}, Pos::{X::integer(),Y::integer()}, [Option]) -> wxImage()
 
625
%% Option = {r, integer()} | {g, integer()} | {b, integer()}
 
626
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageresize">external documentation</a>.
 
627
resize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
 
628
 when is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY),is_list(Options) ->
 
629
  ?CLASS(ThisT,wxImage),
 
630
  MOpts = fun({r, R}, Acc) -> [<<1:32/?UI,R:32/?UI>>|Acc];
 
631
          ({g, G}, Acc) -> [<<2:32/?UI,G:32/?UI>>|Acc];
 
632
          ({b, B}, Acc) -> [<<3:32/?UI,B:32/?UI>>|Acc];
 
633
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
634
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
635
  wxe_util:call(?wxImage_Resize,
 
636
  <<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI,PosX:32/?UI,PosY:32/?UI, 0:32,BinOpt/binary>>).
 
637
 
 
638
%% @spec (This::wxImage(), Angle::float(), Centre_of_rotation::{X::integer(),Y::integer()}) -> wxImage()
 
639
%% @equiv rotate(This,Angle,Centre_of_rotation, [])
 
640
rotate(This,Angle,Centre_of_rotation={Centre_of_rotationX,Centre_of_rotationY})
 
641
 when is_record(This, wx_ref),is_float(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY) ->
 
642
  rotate(This,Angle,Centre_of_rotation, []).
 
643
 
 
644
%% @spec (This::wxImage(), Angle::float(), Centre_of_rotation::{X::integer(),Y::integer()}, [Option]) -> wxImage()
 
645
%% Option = {interpolating, bool()} | {offset_after_rotation, {X::integer(),Y::integer()}}
 
646
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotate">external documentation</a>.
 
647
rotate(#wx_ref{type=ThisT,ref=ThisRef},Angle,{Centre_of_rotationX,Centre_of_rotationY}, Options)
 
648
 when is_float(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY),is_list(Options) ->
 
649
  ?CLASS(ThisT,wxImage),
 
650
  MOpts = fun({interpolating, Interpolating}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Interpolating)):32/?UI>>|Acc];
 
651
          ({offset_after_rotation, {Offset_after_rotationX,Offset_after_rotationY}}, Acc) -> [<<2:32/?UI,Offset_after_rotationX:32/?UI,Offset_after_rotationY:32/?UI,0:32>>|Acc];
 
652
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
653
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
654
  wxe_util:call(?wxImage_Rotate,
 
655
  <<ThisRef:32/?UI,0:32,Angle:64/?F,Centre_of_rotationX:32/?UI,Centre_of_rotationY:32/?UI, BinOpt/binary>>).
 
656
 
 
657
%% @spec (This::wxImage(), Angle::float()) -> ok
 
658
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotatehue">external documentation</a>.
 
659
rotateHue(#wx_ref{type=ThisT,ref=ThisRef},Angle)
 
660
 when is_float(Angle) ->
 
661
  ?CLASS(ThisT,wxImage),
 
662
  wxe_util:cast(?wxImage_RotateHue,
 
663
  <<ThisRef:32/?UI,0:32,Angle:64/?F>>).
 
664
 
 
665
%% @spec (This::wxImage()) -> wxImage()
 
666
%% @equiv rotate90(This, [])
 
667
rotate90(This)
 
668
 when is_record(This, wx_ref) ->
 
669
  rotate90(This, []).
 
670
 
 
671
%% @spec (This::wxImage(), [Option]) -> wxImage()
 
672
%% Option = {clockwise, bool()}
 
673
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotate90">external documentation</a>.
 
674
rotate90(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
675
 when is_list(Options) ->
 
676
  ?CLASS(ThisT,wxImage),
 
677
  MOpts = fun({clockwise, Clockwise}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Clockwise)):32/?UI>>|Acc];
 
678
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
679
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
680
  wxe_util:call(?wxImage_Rotate90,
 
681
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
682
 
 
683
%% @spec (This::wxImage(), Name::string()) -> bool()
 
684
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesavefile">external documentation</a>.
 
685
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name)
 
686
 when is_list(Name) ->
 
687
  ?CLASS(ThisT,wxImage),
 
688
  Name_UC = unicode:characters_to_binary([Name,0]),
 
689
  wxe_util:call(?wxImage_SaveFile_1,
 
690
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
 
691
 
 
692
%% @spec (This::wxImage(),Name::string(),X::integer()|string()) -> bool()
 
693
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesavefile">external documentation</a>.
 
694
%% <br /> Alternatives: 
 
695
%% <p><c>
 
696
%% saveFile(This::wxImage(), Name::string(), Type::integer()) -> bool() </c>
 
697
%% </p>
 
698
%% <p><c>
 
699
%% saveFile(This::wxImage(), Name::string(), Mimetype::string()) -> bool() </c>
 
700
%% </p>
 
701
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type)
 
702
 when is_list(Name),is_integer(Type) ->
 
703
  ?CLASS(ThisT,wxImage),
 
704
  Name_UC = unicode:characters_to_binary([Name,0]),
 
705
  wxe_util:call(?wxImage_SaveFile_2_0,
 
706
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI>>);
 
707
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype)
 
708
 when is_list(Name),is_list(Mimetype) ->
 
709
  ?CLASS(ThisT,wxImage),
 
710
  Name_UC = unicode:characters_to_binary([Name,0]),
 
711
  Mimetype_UC = unicode:characters_to_binary([Mimetype,0]),
 
712
  wxe_util:call(?wxImage_SaveFile_2_1,
 
713
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8>>).
 
714
 
 
715
%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> wxImage()
 
716
%% @equiv scale(This,Width,Height, [])
 
717
scale(This,Width,Height)
 
718
 when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
 
719
  scale(This,Width,Height, []).
 
720
 
 
721
%% @spec (This::wxImage(), Width::integer(), Height::integer(), [Option]) -> wxImage()
 
722
%% Option = {quality, integer()}
 
723
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagescale">external documentation</a>.
 
724
scale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
 
725
 when is_integer(Width),is_integer(Height),is_list(Options) ->
 
726
  ?CLASS(ThisT,wxImage),
 
727
  MOpts = fun({quality, Quality}, Acc) -> [<<1:32/?UI,Quality:32/?UI>>|Acc];
 
728
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
729
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
730
  wxe_util:call(?wxImage_Scale,
 
731
  <<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
 
732
 
 
733
%% @spec (This::wxImage(), Size::{W::integer(),H::integer()}, Pos::{X::integer(),Y::integer()}) -> wxImage()
 
734
%% @equiv size(This,Size,Pos, [])
 
735
size(This,Size={SizeW,SizeH},Pos={PosX,PosY})
 
736
 when is_record(This, wx_ref),is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY) ->
 
737
  size(This,Size,Pos, []).
 
738
 
 
739
%% @spec (This::wxImage(), Size::{W::integer(),H::integer()}, Pos::{X::integer(),Y::integer()}, [Option]) -> wxImage()
 
740
%% Option = {r, integer()} | {g, integer()} | {b, integer()}
 
741
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesize">external documentation</a>.
 
742
size(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
 
743
 when is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY),is_list(Options) ->
 
744
  ?CLASS(ThisT,wxImage),
 
745
  MOpts = fun({r, R}, Acc) -> [<<1:32/?UI,R:32/?UI>>|Acc];
 
746
          ({g, G}, Acc) -> [<<2:32/?UI,G:32/?UI>>|Acc];
 
747
          ({b, B}, Acc) -> [<<3:32/?UI,B:32/?UI>>|Acc];
 
748
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
749
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
750
  wxe_util:call(?wxImage_Size,
 
751
  <<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI,PosX:32/?UI,PosY:32/?UI, 0:32,BinOpt/binary>>).
 
752
 
 
753
%% @spec (This::wxImage(), Alpha::binary()) -> ok
 
754
%% @equiv setAlpha(This,Alpha, [])
 
755
setAlpha(This,Alpha)
 
756
 when is_record(This, wx_ref),is_binary(Alpha) ->
 
757
  setAlpha(This,Alpha, []).
 
758
 
 
759
%% @spec (This::wxImage(), Alpha::binary(), [Option]) -> ok
 
760
%% Option = {static_data, bool()}
 
761
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetalpha">external documentation</a>.
 
762
setAlpha(#wx_ref{type=ThisT,ref=ThisRef},Alpha, Options)
 
763
 when is_binary(Alpha),is_list(Options) ->
 
764
  ?CLASS(ThisT,wxImage),
 
765
  wxe_util:send_bin(Alpha),
 
766
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
767
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
768
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
769
  wxe_util:cast(?wxImage_SetAlpha_2,
 
770
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
771
 
 
772
%% @spec (This::wxImage(), X::integer(), Y::integer(), Alpha::integer()) -> ok
 
773
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetalpha">external documentation</a>.
 
774
setAlpha(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Alpha)
 
775
 when is_integer(X),is_integer(Y),is_integer(Alpha) ->
 
776
  ?CLASS(ThisT,wxImage),
 
777
  wxe_util:cast(?wxImage_SetAlpha_3,
 
778
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Alpha:32/?UI>>).
 
779
 
 
780
%% @spec (This::wxImage(), Data::binary()) -> ok
 
781
%% @equiv setData(This,Data, [])
 
782
setData(This,Data)
 
783
 when is_record(This, wx_ref),is_binary(Data) ->
 
784
  setData(This,Data, []).
 
785
 
 
786
%% @spec (This::wxImage(), Data::binary(), [Option]) -> ok
 
787
%% Option = {static_data, bool()}
 
788
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetdata">external documentation</a>.
 
789
setData(#wx_ref{type=ThisT,ref=ThisRef},Data, Options)
 
790
 when is_binary(Data),is_list(Options) ->
 
791
  ?CLASS(ThisT,wxImage),
 
792
  wxe_util:send_bin(Data),
 
793
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
794
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
795
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
796
  wxe_util:cast(?wxImage_SetData_2,
 
797
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
798
 
 
799
%% @spec (This::wxImage(), Data::binary(), New_width::integer(), New_height::integer()) -> ok
 
800
%% @equiv setData(This,Data,New_width,New_height, [])
 
801
setData(This,Data,New_width,New_height)
 
802
 when is_record(This, wx_ref),is_binary(Data),is_integer(New_width),is_integer(New_height) ->
 
803
  setData(This,Data,New_width,New_height, []).
 
804
 
 
805
%% @spec (This::wxImage(), Data::binary(), New_width::integer(), New_height::integer(), [Option]) -> ok
 
806
%% Option = {static_data, bool()}
 
807
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetdata">external documentation</a>.
 
808
setData(#wx_ref{type=ThisT,ref=ThisRef},Data,New_width,New_height, Options)
 
809
 when is_binary(Data),is_integer(New_width),is_integer(New_height),is_list(Options) ->
 
810
  ?CLASS(ThisT,wxImage),
 
811
  wxe_util:send_bin(Data),
 
812
  MOpts = fun({static_data, Static_data}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Static_data)):32/?UI>>|Acc];
 
813
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
814
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
815
  wxe_util:cast(?wxImage_SetData_4,
 
816
  <<ThisRef:32/?UI,New_width:32/?UI,New_height:32/?UI, 0:32,BinOpt/binary>>).
 
817
 
 
818
%% @spec (This::wxImage()) -> ok
 
819
%% @equiv setMask(This, [])
 
820
setMask(This)
 
821
 when is_record(This, wx_ref) ->
 
822
  setMask(This, []).
 
823
 
 
824
%% @spec (This::wxImage(), [Option]) -> ok
 
825
%% Option = {mask, bool()}
 
826
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmask">external documentation</a>.
 
827
setMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
828
 when is_list(Options) ->
 
829
  ?CLASS(ThisT,wxImage),
 
830
  MOpts = fun({mask, Mask}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Mask)):32/?UI>>|Acc];
 
831
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
832
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
833
  wxe_util:cast(?wxImage_SetMask,
 
834
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
835
 
 
836
%% @spec (This::wxImage(), R::integer(), G::integer(), B::integer()) -> ok
 
837
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmaskcolour">external documentation</a>.
 
838
setMaskColour(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
 
839
 when is_integer(R),is_integer(G),is_integer(B) ->
 
840
  ?CLASS(ThisT,wxImage),
 
841
  wxe_util:cast(?wxImage_SetMaskColour,
 
842
  <<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
 
843
 
 
844
%% @spec (This::wxImage(), Mask::wxImage(), Mr::integer(), Mg::integer(), Mb::integer()) -> bool()
 
845
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmaskfromimage">external documentation</a>.
 
846
setMaskFromImage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MaskT,ref=MaskRef},Mr,Mg,Mb)
 
847
 when is_integer(Mr),is_integer(Mg),is_integer(Mb) ->
 
848
  ?CLASS(ThisT,wxImage),
 
849
  ?CLASS(MaskT,wxImage),
 
850
  wxe_util:call(?wxImage_SetMaskFromImage,
 
851
  <<ThisRef:32/?UI,MaskRef:32/?UI,Mr:32/?UI,Mg:32/?UI,Mb:32/?UI>>).
 
852
 
 
853
%% @spec (This::wxImage(),Name::string(),X::integer()|string()) -> ok
 
854
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetoption">external documentation</a>.
 
855
%% <br /> Alternatives: 
 
856
%% <p><c>
 
857
%% setOption(This::wxImage(), Name::string(), Value::integer()) -> ok </c>
 
858
%% </p>
 
859
%% <p><c>
 
860
%% setOption(This::wxImage(), Name::string(), Value::string()) -> ok </c>
 
861
%% </p>
 
862
setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value)
 
863
 when is_list(Name),is_integer(Value) ->
 
864
  ?CLASS(ThisT,wxImage),
 
865
  Name_UC = unicode:characters_to_binary([Name,0]),
 
866
  wxe_util:cast(?wxImage_SetOption_2_0,
 
867
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Value:32/?UI>>);
 
868
setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value)
 
869
 when is_list(Name),is_list(Value) ->
 
870
  ?CLASS(ThisT,wxImage),
 
871
  Name_UC = unicode:characters_to_binary([Name,0]),
 
872
  Value_UC = unicode:characters_to_binary([Value,0]),
 
873
  wxe_util:cast(?wxImage_SetOption_2_1,
 
874
  <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((4+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
 
875
 
 
876
%% @spec (This::wxImage(), Palette::wxPalette:wxPalette()) -> ok
 
877
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetpalette">external documentation</a>.
 
878
setPalette(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PaletteT,ref=PaletteRef}) ->
 
879
  ?CLASS(ThisT,wxImage),
 
880
  ?CLASS(PaletteT,wxPalette),
 
881
  wxe_util:cast(?wxImage_SetPalette,
 
882
  <<ThisRef:32/?UI,PaletteRef:32/?UI>>).
 
883
 
 
884
%% @spec (This::wxImage(), Rect::{X::integer(),Y::integer(),W::integer(),H::integer()}, R::integer(), G::integer(), B::integer()) -> ok
 
885
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetrgb">external documentation</a>.
 
886
setRGB(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},R,G,B)
 
887
 when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_integer(R),is_integer(G),is_integer(B) ->
 
888
  ?CLASS(ThisT,wxImage),
 
889
  wxe_util:cast(?wxImage_SetRGB_4,
 
890
  <<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
 
891
 
 
892
%% @spec (This::wxImage(), X::integer(), Y::integer(), R::integer(), G::integer(), B::integer()) -> ok
 
893
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetrgb">external documentation</a>.
 
894
setRGB(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R,G,B)
 
895
 when is_integer(X),is_integer(Y),is_integer(R),is_integer(G),is_integer(B) ->
 
896
  ?CLASS(ThisT,wxImage),
 
897
  wxe_util:cast(?wxImage_SetRGB_5,
 
898
  <<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
 
899
 
 
900
%% @spec (This::wxImage()) -> ok
 
901
%% @doc Destroys this object, do not use object again
 
902
destroy(Obj=#wx_ref{type=Type}) -> 
 
903
  ?CLASS(Type,wxImage),
 
904
  wxe_util:destroy(?DESTROY_OBJECT,Obj),
 
905
  ok.