claw
1.9.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xbm.cpp
Go to the documentation of this file.
1
/*
2
CLAW - a C++ Library Absolutely Wonderful
3
4
CLAW is a free library without any particular aim but being useful to
5
anyone.
6
7
Copyright (C) 2005-2011 Julien Jorge
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
23
contact: julien.jorge@stuff-o-matic.com
24
*/
30
#include <
claw/graphic/xbm.hpp
>
31
38
claw::graphic::xbm::xbm
(
unsigned
int
w,
unsigned
int
h)
39
:
image
(w, h)
40
, m_hot(NULL)
41
{}
42
47
claw::graphic::xbm::xbm
(
const
image
& that)
48
:
image
(that)
49
, m_hot(NULL)
50
{}
51
56
claw::graphic::xbm::xbm
(std::istream& f)
57
: m_hot(NULL)
58
{
59
reader
(*
this
, f);
60
}
61
65
claw::graphic::xbm::~xbm
()
66
{
67
if
(m_hot != NULL)
68
delete
m_hot;
69
}
70
75
void
claw::graphic::xbm::save
(std::ostream& f)
const
76
{
77
writer
(*
this
, f,
writer::options
(m_name, m_hot));
78
}
79
84
void
claw::graphic::xbm::set_name
(
const
std::string& name)
85
{
86
m_name = name;
87
}
88
93
void
claw::graphic::xbm::set_hot
(
const
claw::math::coordinate_2d<int>
& hot)
94
{
95
if
(m_hot != NULL)
96
delete
m_hot;
97
98
m_hot =
new
claw::math::coordinate_2d<int>
(hot);
99
}
claw::graphic::image::image
image()
Constructor. Creates an image without datas.
Definition
image.cpp:95
claw::graphic::xbm::reader
This class read data from a xbm file and store it in an image.
Definition
xbm.hpp:54
claw::graphic::xbm::writer
This class write an image in a xbm file.
Definition
xbm.hpp:93
claw::graphic::xbm::save
void save(std::ostream &os) const
Save the image.
Definition
xbm.cpp:75
claw::graphic::xbm::xbm
xbm(unsigned int w, unsigned int h)
Constructor. Creates an empty image.
Definition
xbm.cpp:38
claw::graphic::xbm::~xbm
~xbm()
Destructor.
Definition
xbm.cpp:65
claw::graphic::xbm::set_hot
void set_hot(const claw::math::coordinate_2d< int > &hot)
Set the hot spot of the image.
Definition
xbm.cpp:93
claw::graphic::xbm::set_name
void set_name(const std::string &name)
Set the name of the image.
Definition
xbm.cpp:84
claw::math::coordinate_2d
Coordinates in a two dimensional space.
Definition
coordinate_2d.hpp:43
claw::graphic::xbm::writer::options
Parameters of the writing algorithm.
Definition
xbm.hpp:99
xbm.hpp
A class for xbm pictures.
lib
graphic
src
claw
graphic
xbm.cpp
Generated by
1.17.0