g4tools  5.4.0
Public Member Functions | Static Public Member Functions | List of all members
tools::sg::sf_img< T > Class Template Reference
Inheritance diagram for tools::sg::sf_img< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::sf_img< T >:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const
 
virtual bool write (io::iwbuf &a_buffer)
 
virtual bool read (io::irbuf &a_buffer)
 
virtual bool dump (std::ostream &)
 
virtual bool s_value (std::string &a_s) const
 
virtual bool s2value (const std::string &)
 
 sf_img ()
 
 sf_img (const img< T > &a_value)
 
virtual ~sf_img ()
 
 sf_img (const sf_img &a_from)
 
sf_imgoperator= (const sf_img &a_from)
 
sf_imgoperator= (const img< T > &a_value)
 
- Public Member Functions inherited from tools::sg::bsf< img< T > >
virtual const std::string & s_cls () const
 
 bsf (const img< T > &a_value)
 
 bsf (const bsf &a_from)
 
virtual ~bsf ()
 
bsfoperator= (const bsf &a_from)
 
bsfoperator= (const img< T > &a_value)
 
bool operator== (const bsf &a_from) const
 
bool operator== (const img< T > &a_value) const
 
bool operator!= (const bsf &a_from) const
 
bool operator!= (const img< T > &a_value) const
 
 operator const img< T > & () const
 
 operator img< T > ()
 
img< T > & value ()
 
const img< T > & value () const
 
void value (const img< T > &a_value)
 
void value_no_cmp (const img< T > &a_value)
 
void setValue (const img< T > &a_value)
 
const img< T > & getValue () const
 
- Public Member Functions inherited from tools::sg::field
virtual ~field ()
 
void touch ()
 
bool touched () const
 
void reset_touched ()
 

Static Public Member Functions

static const std::string & s_class ()
 
- Static Public Member Functions inherited from tools::sg::bsf< img< T > >
static const std::string & s_class ()
 

Additional Inherited Members

- Protected Member Functions inherited from tools::sg::bsf< img< T > >
 bsf ()
 
- Protected Member Functions inherited from tools::sg::field
 field ()
 
 field (const field &)
 
fieldoperator= (const field &)
 
- Protected Attributes inherited from tools::sg::bsf< img< T > >
img< T > m_value
 
- Protected Attributes inherited from tools::sg::field
bool m_touched
 

Detailed Description

template<class T>
class tools::sg::sf_img< T >

Definition at line 15 of file sf_img.

Constructor & Destructor Documentation

◆ sf_img() [1/3]

template<class T >
tools::sg::sf_img< T >::sf_img ( )
inline

Definition at line 51 of file sf_img.

51 :parent(){}

◆ sf_img() [2/3]

template<class T >
tools::sg::sf_img< T >::sf_img ( const img< T > &  a_value)
inline

Definition at line 52 of file sf_img.

52 :parent(a_value){}

◆ ~sf_img()

template<class T >
virtual tools::sg::sf_img< T >::~sf_img ( )
inlinevirtual

Definition at line 53 of file sf_img.

53 {}

◆ sf_img() [3/3]

template<class T >
tools::sg::sf_img< T >::sf_img ( const sf_img< T > &  a_from)
inline

Definition at line 55 of file sf_img.

55 :parent(a_from){}

Member Function Documentation

◆ cast()

template<class T >
virtual void* tools::sg::sf_img< T >::cast ( const std::string &  a_class) const
inlinevirtual

Reimplemented from tools::sg::bsf< img< T > >.

Definition at line 22 of file sf_img.

22  {
23  if(void* p = cmp_cast< sf_img<T> >(this,a_class)) {return p;}
24  return parent::cast(a_class);
25  }

◆ dump()

template<class T >
virtual bool tools::sg::sf_img< T >::dump ( std::ostream &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 44 of file sf_img.

44  {
45  //a_out << parent::m_value << std::endl;
46  return true;
47  }

◆ operator=() [1/2]

template<class T >
sf_img& tools::sg::sf_img< T >::operator= ( const img< T > &  a_value)
inline

Definition at line 61 of file sf_img.

61  {
62  parent::operator=(a_value);
63  return *this;
64  }

◆ operator=() [2/2]

template<class T >
sf_img& tools::sg::sf_img< T >::operator= ( const sf_img< T > &  a_from)
inline

Definition at line 56 of file sf_img.

56  {
57  parent::operator=(a_from);
58  return *this;
59  }

◆ read()

template<class T >
virtual bool tools::sg::sf_img< T >::read ( io::irbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 32 of file sf_img.

32  {
33  uint32 w,h,n;uchar* b;
34  if(!a_buffer.read_img(w,h,n,b)) return false;
35  img<T>& im = parent::m_value;
36  if(w && h && n && b) {
37  im.set(w,h,n,b,true);
38 #ifdef TOOLS_MEM
39  mem::decrement(s_new().c_str());
40 #endif
41  }
42  return true;
43  }

◆ s2value()

template<class T >
virtual bool tools::sg::sf_img< T >::s2value ( const std::string &  )
inlinevirtual

Implements tools::sg::field.

Definition at line 49 of file sf_img.

49 {return false;}

◆ s_class()

template<class T >
static const std::string& tools::sg::sf_img< T >::s_class ( )
inlinestatic

Definition at line 18 of file sf_img.

18  {
19  static const std::string s_v("tools::sg::sf_img<"+stype(T())+">");
20  return s_v;
21  }

◆ s_cls()

template<class T >
virtual const std::string& tools::sg::sf_img< T >::s_cls ( ) const
inlinevirtual

Implements tools::sg::field.

Definition at line 26 of file sf_img.

26 {return s_class();}

◆ s_value()

template<class T >
virtual bool tools::sg::sf_img< T >::s_value ( std::string &  a_s) const
inlinevirtual

Implements tools::sg::field.

Definition at line 48 of file sf_img.

48 {a_s.clear();return false;}

◆ write()

template<class T >
virtual bool tools::sg::sf_img< T >::write ( io::iwbuf a_buffer)
inlinevirtual

Implements tools::sg::field.

Definition at line 28 of file sf_img.

28  {
29  const img<T>& im = parent::m_value;
30  return a_buffer.write_img(im.width(),im.height(),im.bpp(),im.buffer());
31  }

The documentation for this class was generated from the following file:
tools::sg::bsf< img< T > >::m_value
img< T > m_value
Definition: bsf:120
tools::sg::bsf< img< T > >::cast
virtual void * cast(const std::string &a_class) const
Definition: bsf:27
tools::uchar
unsigned char uchar
Definition: typedefs:99
tools::sg::sf_img::s_class
static const std::string & s_class()
Definition: sf_img:18
tools::cmp_cast
void * cmp_cast(const TO *a_this, const std::string &a_class)
Definition: scast:15
tools::sg::bsf< img< T > >::operator=
bsf & operator=(const bsf &a_from)
Definition: bsf:49
tools::stype
const std::string & stype(const mat4f &)
Definition: mat4f:73
tools::uint32
unsigned int uint32
Definition: typedefs:71