more synonym shoehorning.
[cview.git] / lib / CXGN / Cview / ImageI.pm
blob3f44f9e30a544a77deb1acafe54fe7c629245f0a
2 =head1 NAME
4 CXGN::Cview::ImageI - an interface for top-level Cview images.
6 =head1 DESCRIPTION
8 =head1 AUTHOR(S)
10 Lukas Mueller (lam87@cornell.edu)
12 =head1 FUNCTIONS
15 =cut
17 use strict;
19 package CXGN::Cview::ImageI;
21 use GD;
23 =head2 function new
25 Synopsis:
26 Arguments:
27 Returns:
28 Side effects:
29 Description:
31 =cut
33 sub new {
34 my $class = shift;
35 my $self = bless {}, $class;
37 # set some defaults...
39 $self->set_width(600);
40 $self->set_height(400);
42 return $self;
45 =head2 function render
47 Synopsis:
48 Arguments:
49 Returns:
50 Side effects:
51 Description:
53 =cut
55 sub render {
58 =head2 accessors get_width(), set_width()
60 Synopsis: $width = $ii->get_width()
61 Property: the width, in pixels, of the canvas
62 Side effects:
63 Description:
65 =cut
67 sub get_width {
68 my $self=shift;
69 return $self->{width};
73 sub set_width {
74 my $self=shift;
75 $self->{width}=shift;
78 =head2 accessors get_height(), set_height()
80 Synopsis: my $height = $ii->get_height()
81 Property: the height in pixels of the canvas
82 Side effects:
83 Description:
85 =cut
87 sub get_height {
88 my $self=shift;
89 return $self->{height};
92 sub set_height {
93 my $self=shift;
94 $self->{height}=shift;
97 =head2 accessors get_image(), set_image()
99 Synopsis: my $i = $ii->get_image()
100 Property: the GD::Image used for drawing on this canvas
101 Side effects:
102 Description:
104 =cut
106 sub get_image {
107 my $self=shift;
108 return $self->{image};
111 sub set_image {
112 my $self=shift;
113 $self->{image}=shift;
116 =head2 function add_image_object
118 Synopsis:
119 Arguments:
120 Returns:
121 Side effects:
122 Description:
124 =cut
126 sub add_image_object {
127 my $self = shift;
128 my $object = shift;
129 if (!exists($self->{image_objects})) { $self->{image_objects}= []; }
130 push @{$self->{image_objects}}, $object;
133 =head2 function get_image_objects
135 Synopsis:
136 Arguments:
137 Returns:
138 Side effects:
139 Description:
141 =cut
143 sub get_image_objects {
144 my $self = shift;
145 return @{$self->{image_objects}};
148 =head2 accessors get_name, set_name
150 Usage:
151 Desc:
152 Property
153 Side Effects:
154 Example:
156 =cut
158 sub get_name {
159 my $self = shift;
160 return $self->{name};
163 sub set_name {
164 my $self = shift;
165 $self->{name} = shift;
168 return 1;