Templates -- Meow  204.13.18
A C++ template contains kinds of interesting classes and functions
meow::Bitmap< Pixel > Class Template Reference

二維點陣資料 More...

#include "Bitmap.h"

Inheritance diagram for meow::Bitmap< Pixel >:
meow::ObjBase

Public Member Functions

 Bitmap ()
 constructor, 產生一個空的Bitmap More...
 
 Bitmap (Bitmap const &b)
 constructor, 複製一個bitmap More...
 
 Bitmap (size_t h, size_t w, Pixel const &p)
 constructor, 指定寬高, 預設Pixel More...
 
 ~Bitmap ()
 destructor More...
 
BitmapcopyFrom (Bitmap const &b)
 複製 More...
 
BitmapreferenceFrom (Bitmap const &b)
 reference More...
 
void reset (size_t h, size_t w, Pixel const &p)
 全部重設 More...
 
void clear ()
 清除資料, 寬高階規零 More...
 
size_t height () const
 回傳高度 More...
 
size_t width () const
 回傳寬度 More...
 
size_t size () const
 回傳高度乘以寬度 More...
 
size_t height (size_t h2, Pixel const &p)
 修改高度 More...
 
size_t width (size_t w2, Pixel const &p)
 修改寬度 More...
 
size_t size (size_t h2, size_t w2, Pixel const &p)
 修改寬高 More...
 
Pixel pixel (size_t y, size_t x) const
 取得 (y, x) 的pixel More...
 
Pixel pixel (size_t y, size_t x, Pixel const &p)
 修改 (y, x) 的pixel More...
 
void pixels (ssize_t yFirst, ssize_t yLast, ssize_t xFirst, ssize_t xLast, Pixel const &p)
 區塊修改 More...
 
Matrix< Pixel > matrix () const
 回傳矩陣形式 More...
 
Matrix< Pixel > & matrixGet ()
 回傳矩陣形式 (non-constant form) More...
 
Matrix< Pixel > matrix (Matrix< Pixel > const &p)
 直接設定 More...
 
Bitmap gaussian (double radiusY, double radiusX) const
 回傳高斯模糊 More...
 
Bitmapgaussianed (double radiusY, double radiusX)
 把自己高斯模糊 More...
 
Bitmap gradianceX (double radiusY, double radiusX) const
 回傳對x偏微分 More...
 
Bitmap< Pixel > & gradiancedX (double radiusY, double radiusX)
 把自己對x偏微分 More...
 
Bitmap< Pixel > gradianceY (double radiusY, double radiusX) const
 回傳對y偏微分 More...
 
Bitmap< Pixel > & gradiancedY (double radiusY, double radiusX)
 把自己對y偏微分 More...
 
Bitmapoperator= (Bitmap const &b)
 same as copyFrom(b) More...
 
Pixel operator() (size_t y, size_t x) const
 same as pixel(y, x) More...
 
Pixel const & operator() (size_t y, size_t x, Pixel const &p) const
 same as pixel(y, x, p) More...
 
bool write (FILE *f, bool bin, unsigned int fg) const
 將資料寫入檔案 More...
 
bool read (FILE *f, bool bin, unsigned int fg)
 將資料讀入 More...
 
ObjBasecreate () const
 new一個自己 More...
 
ObjBasecopyFrom (ObjBase const *b)
 複製資料 More...
 
char const * ctype () const
 回傳class的type More...
 
std::string type () const
 回傳class的type More...
 
- Public Member Functions inherited from meow::ObjBase
virtual ~ObjBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from meow::ObjBase
static char const * ctypeBase ()
 用C-style string回傳base的type name More...
 
static std::string typeBase ()
 用std::string回傳base的type name More...
 
- Protected Member Functions inherited from meow::ObjBase
 ObjBase ()
 Constructor with doing nothing. More...
 

Detailed Description

template<class Pixel>
class meow::Bitmap< Pixel >

二維點陣資料

Author
cat_leopard

Definition at line 25 of file Bitmap.h.

Constructor & Destructor Documentation

template<class Pixel>
meow::Bitmap< Pixel >::Bitmap ( )
inline

constructor, 產生一個空的Bitmap

Definition at line 83 of file Bitmap.h.

template<class Pixel>
meow::Bitmap< Pixel >::Bitmap ( Bitmap< Pixel > const &  b)
inline

constructor, 複製一個bitmap

Definition at line 89 of file Bitmap.h.

template<class Pixel>
meow::Bitmap< Pixel >::Bitmap ( size_t  h,
size_t  w,
Pixel const &  p 
)
inline

constructor, 指定寬高, 預設Pixel

Parameters
[in]h
[in]w
[in]p預設pixel

Definition at line 99 of file Bitmap.h.

template<class Pixel>
meow::Bitmap< Pixel >::~Bitmap ( )
inline

destructor

Definition at line 105 of file Bitmap.h.

Member Function Documentation

template<class Pixel>
void meow::Bitmap< Pixel >::clear ( )
inline

清除資料, 寬高階規零

Definition at line 139 of file Bitmap.h.

template<class Pixel>
Bitmap& meow::Bitmap< Pixel >::copyFrom ( Bitmap< Pixel > const &  b)
inline

複製

Definition at line 111 of file Bitmap.h.

template<class Pixel>
ObjBase* meow::Bitmap< Pixel >::copyFrom ( ObjBase const *  b)
inlinevirtual

複製資料

輸入型別是 ObjBase const* 這裡假設實體其實是 Bitmap. 事實上這個method就只是幫忙轉型然後呼叫原本的copyFrom

Parameters
[in]b資料來源
Returns
this

Reimplemented from meow::ObjBase.

Definition at line 406 of file Bitmap.h.

template<class Pixel>
ObjBase* meow::Bitmap< Pixel >::create ( ) const
inlinevirtual

new一個自己

Returns
一個new出來的Bitmap<Pixel>

Reimplemented from meow::ObjBase.

Definition at line 393 of file Bitmap.h.

template<class Pixel>
char const* meow::Bitmap< Pixel >::ctype ( ) const
inlinevirtual

回傳class的type

Returns
char const* 形式的typename

Reimplemented from meow::ObjBase.

Definition at line 414 of file Bitmap.h.

template<class Pixel>
Bitmap meow::Bitmap< Pixel >::gaussian ( double  radiusY,
double  radiusX 
) const
inline

回傳高斯模糊

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
一個Bitmap , 是自己被高斯模糊後的結果

Definition at line 268 of file Bitmap.h.

template<class Pixel>
Bitmap& meow::Bitmap< Pixel >::gaussianed ( double  radiusY,
double  radiusX 
)
inline

把自己高斯模糊

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
*this

Definition at line 280 of file Bitmap.h.

template<class Pixel>
Bitmap<Pixel>& meow::Bitmap< Pixel >::gradiancedX ( double  radiusY,
double  radiusX 
)
inline

把自己對x偏微分

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
*this

Definition at line 303 of file Bitmap.h.

template<class Pixel>
Bitmap<Pixel>& meow::Bitmap< Pixel >::gradiancedY ( double  radiusY,
double  radiusX 
)
inline

把自己對y偏微分

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
*this

Definition at line 326 of file Bitmap.h.

template<class Pixel>
Bitmap meow::Bitmap< Pixel >::gradianceX ( double  radiusY,
double  radiusX 
) const
inline

回傳對x偏微分

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
一個Bitmap , 是自己被偏微分後的結果

Definition at line 291 of file Bitmap.h.

template<class Pixel>
Bitmap<Pixel> meow::Bitmap< Pixel >::gradianceY ( double  radiusY,
double  radiusX 
) const
inline

回傳對y偏微分

Parameters
[in]radiusY高斯模糊的Y軸方向的sigma
[in]radiusX高斯模糊的X軸方向的sigma
Returns
一個Bitmap , 是自己被偏微分後的結果

Definition at line 314 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::height ( ) const
inline

回傳高度

Definition at line 146 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::height ( size_t  h2,
Pixel const &  p 
)
inline

修改高度

Parameters
[in]h2新的高
[in]p如果高有變大, 則新長出來的地方用此 pixel填補
Returns
新的高

Definition at line 171 of file Bitmap.h.

template<class Pixel>
Matrix<Pixel> meow::Bitmap< Pixel >::matrix ( ) const
inline

回傳矩陣形式

Definition at line 242 of file Bitmap.h.

template<class Pixel>
Matrix<Pixel> meow::Bitmap< Pixel >::matrix ( Matrix< Pixel > const &  p)
inline

直接設定

Definition at line 256 of file Bitmap.h.

template<class Pixel>
Matrix<Pixel>& meow::Bitmap< Pixel >::matrixGet ( )
inline

回傳矩陣形式 (non-constant form)

Definition at line 249 of file Bitmap.h.

template<class Pixel>
Pixel meow::Bitmap< Pixel >::operator() ( size_t  y,
size_t  x 
) const
inline

same as pixel(y, x)

Definition at line 340 of file Bitmap.h.

template<class Pixel>
Pixel const& meow::Bitmap< Pixel >::operator() ( size_t  y,
size_t  x,
Pixel const &  p 
) const
inline

same as pixel(y, x, p)

Definition at line 347 of file Bitmap.h.

template<class Pixel>
Bitmap& meow::Bitmap< Pixel >::operator= ( Bitmap< Pixel > const &  b)
inline

same as copyFrom(b)

Definition at line 333 of file Bitmap.h.

template<class Pixel>
Pixel meow::Bitmap< Pixel >::pixel ( size_t  y,
size_t  x 
) const
inline

取得 (y, x) 的pixel

Parameters
[in]y
[in]x
Returns
該pixel 的 constant reference

Definition at line 205 of file Bitmap.h.

template<class Pixel>
Pixel meow::Bitmap< Pixel >::pixel ( size_t  y,
size_t  x,
Pixel const &  p 
)
inline

修改 (y, x) 的pixel

Parameters
[in]y
[in]x
[in]p指定的顏色
Returns
該pixel 的 constant reference

Definition at line 217 of file Bitmap.h.

template<class Pixel>
void meow::Bitmap< Pixel >::pixels ( ssize_t  yFirst,
ssize_t  yLast,
ssize_t  xFirst,
ssize_t  xLast,
Pixel const &  p 
)
inline

區塊修改

一口氣將一個矩形區塊修改成指定的顏色

Parameters
[in]yFirsty軸方向最小值(含)
[in]yLasty軸方向最大值(含)
[in]xFirstx軸方向最小值(含)
[in]xLastx軸方向最大值(含)
[in]p指定的顏色
Returns

Definition at line 233 of file Bitmap.h.

template<class Pixel>
bool meow::Bitmap< Pixel >::read ( FILE *  f,
bool  bin,
unsigned int  fg 
)
inlinevirtual

將資料讀入

Note
未完成, 輸入參數 fg 無用

Reimplemented from meow::ObjBase.

Definition at line 374 of file Bitmap.h.

template<class Pixel>
Bitmap& meow::Bitmap< Pixel >::referenceFrom ( Bitmap< Pixel > const &  b)
inline

reference

Definition at line 119 of file Bitmap.h.

template<class Pixel>
void meow::Bitmap< Pixel >::reset ( size_t  h,
size_t  w,
Pixel const &  p 
)
inline

全部重設

Parameters
[in]h
[in]w
[in]p預設pixel
Returns

Definition at line 132 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::size ( ) const
inline

回傳高度乘以寬度

Definition at line 160 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::size ( size_t  h2,
size_t  w2,
Pixel const &  p 
)
inline

修改寬高

Parameters
[in]h2新的高
[in]w2新的寬
[in]p如果寬or高有變大, 則新長出來的地方用此 pixel填補
Returns
新的size

Definition at line 194 of file Bitmap.h.

template<class Pixel>
std::string meow::Bitmap< Pixel >::type ( ) const
inlinevirtual

回傳class的type

Returns
std::string 形式的typename

Reimplemented from meow::ObjBase.

Definition at line 422 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::width ( ) const
inline

回傳寬度

Definition at line 153 of file Bitmap.h.

template<class Pixel>
size_t meow::Bitmap< Pixel >::width ( size_t  w2,
Pixel const &  p 
)
inline

修改寬度

Parameters
[in]w2新的寬
[in]p如果寬有變大, 則新長出來的地方用此 pixel填補
Returns
新的寬

Definition at line 182 of file Bitmap.h.

template<class Pixel>
bool meow::Bitmap< Pixel >::write ( FILE *  f,
bool  bin,
unsigned int  fg 
) const
inlinevirtual

將資料寫入檔案

Note
未完成, 輸入參數 fg 無用

Reimplemented from meow::ObjBase.

Definition at line 355 of file Bitmap.h.


The documentation for this class was generated from the following file: