Templates -- Meow  1.1.2
不能,也不應該先編譯成obj-file的templates
meow::Photo< Pixel > Class Template Reference

底片 More...

#include "Photo.h"

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

Public Member Functions

 Photo ()
 constructor More...
 
 Photo (Photo const &b)
 constructor More...
 
 Photo (Bitmap< Pixel > const &bmp)
 constructor More...
 
 Photo (Bitmap< Pixel > const &bmp, double f)
 constructor More...
 
 Photo (Bitmap< Pixel > const &bmp, double f, Vector2D< double > const &c)
 constructor More...
 
 ~Photo ()
 destructor More...
 
PhotocopyFrom (Photo const &b)
 複製資料 More...
 
PhotoreferneceFrom (Photo const &b)
 參照 More...
 
void reset (Bitmap< Pixel > const &bmp)
 重設bitmap, focal 用猜的 More...
 
void reset (Bitmap< Pixel > const &bmp, double f)
 重設bitmap, focal More...
 
void reset (Bitmap< Pixel > const &bmp, double f, Vector2D< double > const &c)
 重設bitmap, focal, center More...
 
Bitmap< Pixel > const & bitmap () const
 回傳bitmap More...
 
Bitmap< Pixel > & bitmapGet ()
 回傳bitmap 的參照(非constant) More...
 
Bitmap< Pixel > const & bitmap (Bitmap< Pixel > const &bmp)
 設定bitmap More...
 
double focal () const
 回傳focal length More...
 
double focal (double f)
 設定 focal length More...
 
Vector2D< double > const & center () const
 取得照片中心點底片座標 More...
 
Vector2D< double > & centerGet ()
 取得照片中心點底片座標 (non-constant reference) More...
 
Vector2D< double > const & center (Vector2D< double > const &c)
 設定照片中心點底片座標 More...
 
size_t width () const
 回傳bitmap寬 More...
 
size_t height () const
 回傳bitmap高 More...
 
Pixel pixel (size_t y, size_t x) const
 回傳bitmap的某pixel More...
 
Pixel pixel (size_t y, size_t x, Pixel const &p)
 設定某pixel More...
 
bool inside (Vector2D< double > const &yx) const
 檢查某點是否在底片範圍內 More...
 
bool inside (Vector3D< double > const &p) const
 檢查某點是否在底片範圍內 More...
 
Pixel color (Vector2D< double > const &yx) const
 取得給照片座標中某點的色彩 More...
 
Pixel color (Vector3D< double > const &p) const
 取得給照片座標中某點的色彩 More...
 
Photooperator= (Photo const &b)
 same as .copyFrom(b) 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 ()
 

Detailed Description

template<class Pixel>
class meow::Photo< Pixel >

底片

基本上就是一個 Photo 加上 focal

Author
cat_leopard

Constructor & Destructor Documentation

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

constructor

focal 預設為 1

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

constructor

複製資料

Parameters
[in]b資料來源
template<class Pixel>
meow::Photo< Pixel >::Photo ( Bitmap< Pixel > const &  bmp)
inline

constructor

直接給定圖片, 焦距用猜的

Parameters
[in]bmp給定的圖片
template<class Pixel>
meow::Photo< Pixel >::Photo ( Bitmap< Pixel > const &  bmp,
double  f 
)
inline

constructor

直接給定圖片與焦距

Parameters
[in]bmp給定的圖片
[in]f給定的焦距
template<class Pixel>
meow::Photo< Pixel >::Photo ( Bitmap< Pixel > const &  bmp,
double  f,
Vector2D< double > const &  c 
)
inline

constructor

直接給定圖片, 焦距與中心點位置

Parameters
[in]bmp給定的圖片
[in]f給定的焦距
[in]c中心點作標
template<class Pixel>
meow::Photo< Pixel >::~Photo ( )
inline

destructor

Member Function Documentation

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

回傳bitmap

template<class Pixel>
Bitmap<Pixel> const& meow::Photo< Pixel >::bitmap ( Bitmap< Pixel > const &  bmp)
inline

設定bitmap

Parameters
[in]bmp新的 bitmap
Returns
新的 bitmap
template<class Pixel>
Bitmap<Pixel>& meow::Photo< Pixel >::bitmapGet ( )
inline

回傳bitmap 的參照(非constant)

template<class Pixel>
Vector2D<double> const& meow::Photo< Pixel >::center ( ) const
inline

取得照片中心點底片座標

Returns
一個二維vector
template<class Pixel>
Vector2D<double> const& meow::Photo< Pixel >::center ( Vector2D< double > const &  c)
inline

設定照片中心點底片座標

Parameters
[in]c新的座標
Returns
新的座標
template<class Pixel>
Vector2D<double>& meow::Photo< Pixel >::centerGet ( )
inline

取得照片中心點底片座標 (non-constant reference)

Returns
一個二維vector
template<class Pixel>
Pixel meow::Photo< Pixel >::color ( Vector2D< double > const &  yx) const
inline

取得給照片座標中某點的色彩

用浮點數vector傳入, 所以色彩是經過渲染過的

Parameters
[in]yx底片座標(原點為center)
Returns
pixel
template<class Pixel>
Pixel meow::Photo< Pixel >::color ( Vector3D< double > const &  p) const
inline

取得給照片座標中某點的色彩

這次是輸入大地座標

Parameters
[in]p大地座標p
Returns
pixel
template<class Pixel>
Photo& meow::Photo< Pixel >::copyFrom ( Photo< Pixel > const &  b)
inline

複製資料

Parameters
[in]b資料來源
template<class Pixel>
ObjBase* meow::Photo< Pixel >::copyFrom ( ObjBase const *  b)
inlinevirtual

複製資料

輸入型別是 \c ObjBase \c const*
這裡假設實體其實是 \c Bitmap.
事實上這個method就只是幫忙轉型然後呼叫原本的\c copyFrom
Parameters
[in]b資料來源
Returns
this

Reimplemented from meow::ObjBase.

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

new一個自己

Returns
一個new出來的Bitmap<Pixel>

Reimplemented from meow::ObjBase.

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

回傳class的type

Returns
char const* 形式的typename

Reimplemented from meow::ObjBase.

template<class Pixel>
double meow::Photo< Pixel >::focal ( ) const
inline

回傳focal length

template<class Pixel>
double meow::Photo< Pixel >::focal ( double  f)
inline

設定 focal length

Parameters
[in]f新的 focal length
Returns
新的 focal length
template<class Pixel>
size_t meow::Photo< Pixel >::height ( ) const
inline

回傳bitmap高

template<class Pixel>
bool meow::Photo< Pixel >::inside ( Vector2D< double > const &  yx) const
inline

檢查某點是否在底片範圍內

Parameters
[in]yx底片座標
Returns
true/false
template<class Pixel>
bool meow::Photo< Pixel >::inside ( Vector3D< double > const &  p) const
inline

檢查某點是否在底片範圍內

Parameters
[in]p大地座標
Returns
true/false
template<class Pixel>
Photo& meow::Photo< Pixel >::operator= ( Photo< Pixel > const &  b)
inline

same as .copyFrom(b)

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

回傳bitmap的某pixel

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

設定某pixel

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

將資料讀入

Note
未完成

Reimplemented from meow::ObjBase.

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

參照

Parameters
[in]b參照來源
template<class Pixel>
void meow::Photo< Pixel >::reset ( Bitmap< Pixel > const &  bmp)
inline

重設bitmap, focal 用猜的

focal直接代對角線, center代bitmap中心點

Parameters
[in]bmp新的 bitmap
template<class Pixel>
void meow::Photo< Pixel >::reset ( Bitmap< Pixel > const &  bmp,
double  f 
)
inline

重設bitmap, focal

center代bitmap中心點

Parameters
[in]bmp新的 bitmap
[in]f新的 focal
template<class Pixel>
void meow::Photo< Pixel >::reset ( Bitmap< Pixel > const &  bmp,
double  f,
Vector2D< double > const &  c 
)
inline

重設bitmap, focal, center

Parameters
[in]bmp新的 bitmap
[in]f新的 focal
[in]c新的中心點作標
template<class Pixel>
std::string meow::Photo< Pixel >::type ( ) const
inlinevirtual

回傳class的type

Returns
std::string 形式的typename

Reimplemented from meow::ObjBase.

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

回傳bitmap寬

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

將資料寫入檔案

Note
未完成

Reimplemented from meow::ObjBase.


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