bool StreamFieldOutput::WriteToNextFrame( const Picture& myfield ) { bool ret_val; ret_val=WriteFieldComponent(myfield.Data(Y_COMP) , myfield.GetPparams().PictureNum(), Y_COMP ); ret_val&=WriteFieldComponent(myfield.Data(U_COMP) , myfield.GetPparams().PictureNum(), U_COMP ); ret_val&=WriteFieldComponent(myfield.Data(V_COMP) , myfield.GetPparams().PictureNum(), V_COMP ); return ret_val; }
void PictureBuffer::CopyPicture( const Picture& picture ) { PushPicture(picture.GetPparams()); bool is_present; Picture & p= GetPicture(picture.GetPparams().PictureNum(), is_present); if(is_present) p = picture; }
bool StreamFieldInput::ReadNextPicture(Picture& mypic) { // FIXME: this method is BROKEN! //return value. Failure if one of the components can't be read, //success otherwise/. bool ret_val; bool is_field1 = ((mypic.GetPparams().PictureNum()%2) == 0); ret_val=ReadFieldComponent( is_field1, mypic.Data(Y_COMP), Y_COMP); ret_val&=ReadFieldComponent(is_field1, mypic.Data(U_COMP), U_COMP); ret_val&=ReadFieldComponent(is_field1, mypic.Data(V_COMP), V_COMP); int picture_size = m_sparams.Xl()*m_sparams.Yl() + 2*m_sparams.ChromaWidth()*m_sparams.ChromaHeight(); if (is_field1) { //Seek back to the beginning of frame so that the next field //from the frame can be read m_ip_pic_ptr->seekg (-picture_size, std::ios::cur); } return ret_val; }