__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
Buffer = new TBitmap32();
Buffer->StretchFilter = sfDraft;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::Button1Click(TObject *Sender)
{
if (OpenDialog->Execute())
{
FilterGraph->Stop();
FilterGraph->ClearGraph();
FilterGraph->Active = false;
FilterGraph->Active = true;
FilterGraph->RenderFile(OpenDialog->FileName);
IBasicVideo* BV;
FilterGraph->QueryInterface(IID_IBasicVideo, &BV);
long w, h;
BV->get_VideoWidth(&w);
BV->get_VideoHeight(&h);
BV->Release();
Buffer->SetSize(w, h);
Caption = String(w) + " x " + h;
FilterGraph->Play();
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
{
FilterGraph->Stop();
FilterGraph->Active = false;
delete Buffer;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::SampleGrabberBuffer(TObject *sender,
double SampleTime, Pointer pBuffer, int BufferLen)
{
TColor32* src = (TColor32*)pBuffer
+ (Buffer->Height - 1) * Buffer->Width;
TColor32* tgt = Buffer->Bits;
for(int y = 0; y < Buffer->Height; y++)
{
for(int x = 0; x < Buffer->Width; x++) tgt[x] = src[x];
src -= Buffer->Width;
tgt += Buffer->Width;
}
Stage1->Invalidate();
Stage2->Invalidate();
Stage3->Invalidate();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::PaintBuffer(TObject *Sender)
{
if (!Buffer->Width) return;
Types::TRect dstRect;
TPaintBox32* stage = (TPaintBox32*)Sender;
double srcAspectRatio = (double)Buffer->Height / Buffer->Width;
if (srcAspectRatio > (double)stage->Height / stage->Width)
{
int w = stage->Height / srcAspectRatio;
int l = stage->Width - w >> 1;
dstRect = Rect(l, 0, l + w, stage->Height);
}
else
{
int h = stage->Width * srcAspectRatio;
int t = stage->Height - h >> 1;
dstRect = Rect(0, t, stage->Width, t + h);
}
stage->Buffer->Clear(0); // Tuning point
Buffer->DrawTo(stage->Buffer, dstRect);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormResize(TObject *Sender)
{
Panel3->Width = ClientWidth / 2;
Panel2->Height = ClientHeight / 2;
VideoWindow->Height = Panel2->Height / 2;
}
//---------------------------------------------------------------------------
±æ°Ô Â¥´Â°Ç ½È¾îÇÏ´Â NibbleÀÔ´Ï´Ù.
¸î ¸î Decoder ÇÊÅÍ¿¡¼± SampleGrabber ¿¡°Ô rgb32 ÇüÅÂÀÇ »ùÇÃÀ» ÁÖÁö ¾Ê¾Æ ¿¬°áÀÌ ¾ÈµÇ´Â °æ¿ì°¡ ÀÖ°í,
manual ·Î pin connection ÇÏ´Â°Ç ÄÚµù·®ÀÌ ¸¹¾ÆÁ®¼ °£´ÜÈ÷ AVI Splitter¿Í AVI Decompressor¸¦ ¾ñ¾î¹ö·È½À´Ï´Ù.
Graphics32ÀÇ TPaintBox32¸¦ ÀÌ¿ëÇØ ´ÙÁß Ãâ·ÂÀ» ±¸ÇöÇßÀ¸´Ï ¼º´Éµµ ÁÁ°í ¸¶À½²¯ ¼öÁ¤Çϱ⵵ ÁÁÁö¿ä.
* °ÔÀ¸¸¥ ÄÚµå ¶§¹®¿¡ ¸î ¸î ÀÚ¸· ÇÊÅÍ¿Í ¿¬°áÀÌ ¿øÈ°ÇÏÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù.
|
void __fastcall TMainForm::SampleGrabberBuffer(TObject *sender,
double SampleTime, Pointer pBuffer, int BufferLen) ¿©±â±îÁö´Â ÇØº¸¾Ò½À´Ï´Ù.
±×¸®°í TBitmap¿¡ º¹»ç¸¦ ÇØ¼... StretchBlt()·Î ¹Ù´Ú¿¡ »Ñ¸®´Ï... »öµéÀÇ °æ°èÁöÁ¡¿¡ ¾Ë·Ï´Þ·Ï ¼±µéÀÌ ±×¾îÁö°í... ¹®Á¦´Â ¾î´À Á¤µµ ½Ã°£ÀÌ °¡¸é Error°¡ ¹ß»ý... ÀÌ ¹æ¹ýµµ ¾ÈµÇ°Ú±¸³ª Çß´Â µ¥... GR32¿¡¼ Ç¥ÇöÀÌ Àß µÇ´Â °Í °°±º¿ä... ¿ª½Ã ¼Ò¹®´ë·Î GR32°¡ ºü¸¥ ¸ð¾çÀÔ´Ï´Ù. GR32µµ ¿Ø¸¸Çϸé Àß »ç¿ëÇÏÁö ¾Ê´Â ÆíÀ̶ó... À̹ø¿¡µµ ¾Æ¿¹ TEST ´ë»ó¿¡¼ Á¦¿ÜÇߴµ¥..
TFilter AVIDecompressor, AviSplitter À̳ðµé ¿ëµµ´Â ¹ºÁö Àß ¸ð¸£°Ú³×¿ä... ¾ÆÁ÷ DS¿¡ ´ëÇØ ¾Æ´Â °ÍÀÌ ¾ø¾î¼...?
DSPack¿¡ ´ëÇÑ ÀÚ·á°¡ ³Ê¹« ºÎÁ·ÇÑ °Í °°½À´Ï´Ù. Àú°°Àº Ãʺ¸¸¦ À§ÇØ ½Ã°£ ³ª½Ã¸é ¿¬Àç¶óµµ ºÎʵ右´Ï´Ù. °¨»çÇÕ´Ï´Ù ^^