| 1625 | } |
| 1626 | |
| 1627 | void _OutputArray::release() const |
| 1628 | { |
| 1629 | CV_Assert(!fixedSize()); |
| 1630 | |
| 1631 | int k = kind(); |
| 1632 | |
| 1633 | if( k == MAT ) |
| 1634 | { |
| 1635 | ((Mat*)obj)->release(); |
| 1636 | return; |
| 1637 | } |
| 1638 | |
| 1639 | if( k == GPU_MAT ) |
| 1640 | { |
| 1641 | ((gpu::GpuMat*)obj)->release(); |
| 1642 | return; |
| 1643 | } |
| 1644 | |
| 1645 | if( k == OPENGL_BUFFER ) |
| 1646 | { |
| 1647 | ((ogl::Buffer*)obj)->release(); |
| 1648 | return; |
| 1649 | } |
| 1650 | |
| 1651 | if( k == OPENGL_TEXTURE ) |
| 1652 | { |
| 1653 | ((ogl::Texture2D*)obj)->release(); |
| 1654 | return; |
| 1655 | } |
| 1656 | |
| 1657 | if( k == NONE ) |
| 1658 | return; |
| 1659 | |
| 1660 | if( k == STD_VECTOR ) |
| 1661 | { |
| 1662 | create(Size(), CV_MAT_TYPE(flags)); |
| 1663 | return; |
| 1664 | } |
| 1665 | |
| 1666 | if( k == STD_VECTOR_VECTOR ) |
| 1667 | { |
| 1668 | ((vector<vector<uchar> >*)obj)->clear(); |
| 1669 | return; |
| 1670 | } |
| 1671 | |
| 1672 | if( k == OCL_MAT ) |
| 1673 | { |
| 1674 | CV_Error(CV_StsNotImplemented, "This method is not implemented for oclMat yet"); |
| 1675 | } |
| 1676 | |
| 1677 | CV_Assert( k == STD_VECTOR_MAT ); |
| 1678 | //if( k == STD_VECTOR_MAT ) |
| 1679 | { |
| 1680 | ((vector<Mat>*)obj)->clear(); |
| 1681 | } |
| 1682 | } |
| 1683 | |
| 1684 | void _OutputArray::clear() const |