2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
21 #include "..\StdAfx.h"
\r
22 #include "BitmapFrame.h"
\r
23 #include "BitmapFrameManager.h"
\r
27 BitmapFrame::BitmapFrame(BitmapHolderPtr pBitmap, const utils::ID& factoryID)
\r
28 : pBitmap_(pBitmap), factoryID_(factoryID)
\r
32 BitmapFrame::BitmapFrame(const utils::ID& factoryID, HWND hWnd, size_t height, size_t width, void* memory)
\r
33 : pBitmap_(new BitmapHolder(hWnd, height, width, memory)), factoryID_(factoryID)
\r
37 BitmapFrame::~BitmapFrame()
\r
41 unsigned int BitmapFrame::GetDataSize() const
\r
43 return pBitmap_->Size();
\r
46 unsigned char* BitmapFrame::GetDataPtr() const
\r
51 return pBitmap_->GetPtr();
\r
56 BitmapHolderPtr BitmapFrame::GetBitmap() const
\r
61 bool BitmapFrame::HasValidDataPtr() const
\r
63 return (pBitmap_ != 0 && pBitmap_->GetPtr() != 0);
\r
66 FrameMetadata BitmapFrame::GetMetadata() const
\r
68 return (pBitmap_ != 0) ? reinterpret_cast<FrameMetadata>(pBitmap_->GetDC()) : 0;
\r
71 const utils::ID& BitmapFrame::FactoryID() const
\r
76 HDC BitmapFrame::GetDC() const
\r
78 return pBitmap_->GetDC();
\r