• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

MIST (Media Integration Standard Toolkit)


Commit MetaInfo

Revision07d97e02cd857cf638d1ffdbc10485a8ba3c8c62 (tree)
Time2008-10-15 20:58:33
AuthorDaisuke Deguchi <ddeguchi@nago...>
CommiterDaisuke Deguchi

Log Message

[1158]の画像トリミング時に入力と同じ画像サイズを指定すると画像が空になるバグ修正をマージ.

Change Summary

Incremental Difference

--- a/mist/mist.h
+++ b/mist/mist.h
@@ -203,6 +203,7 @@ public:
203203 }
204204 else if( num_ == num )
205205 {
206+ out = *this;
206207 return( true );
207208 }
208209
@@ -242,17 +243,29 @@ public:
242243 }
243244 else
244245 {
245- array o( num );
246-
247- if( this->trim( o, index, num ) )
246+ difference_type num_ = size( );
247+ if( num_ <= static_cast< difference_type >( index ) || num_ < static_cast< difference_type >( index + num ) )
248+ {
249+ return( false );
250+ }
251+ else if( num_ == num )
248252 {
249- swap( o );
250-
251253 return( true );
252254 }
253255 else
254256 {
255- return( false );
257+ array o( num );
258+
259+ if( this->trim( o, index, num ) )
260+ {
261+ swap( o );
262+
263+ return( true );
264+ }
265+ else
266+ {
267+ return( false );
268+ }
256269 }
257270 }
258271 }
@@ -1098,6 +1111,7 @@ public:
10981111 }
10991112 else if( w_ == w && h_ == h )
11001113 {
1114+ out = *this;
11011115 return( true );
11021116 }
11031117
@@ -1150,17 +1164,35 @@ public:
11501164 }
11511165 else
11521166 {
1153- array2 o;
1167+ difference_type w_ = this->width( );
1168+ difference_type h_ = this->width( );
11541169
1155- if( this->trim( o, x, y, w, h ) )
1170+ if( w_ <= static_cast< difference_type >( x ) || w_ < static_cast< difference_type >( x + w ) )
1171+ {
1172+ return( false );
1173+ }
1174+ else if( h_ <= static_cast< difference_type >( y ) || h_ < static_cast< difference_type >( y + h ) )
1175+ {
1176+ return( false );
1177+ }
1178+ else if( w_ == w && h_ == h )
11561179 {
1157- swap( o );
1158-
11591180 return( true );
11601181 }
11611182 else
11621183 {
1163- return( false );
1184+ array2 o;
1185+
1186+ if( this->trim( o, x, y, w, h ) )
1187+ {
1188+ swap( o );
1189+
1190+ return( true );
1191+ }
1192+ else
1193+ {
1194+ return( false );
1195+ }
11641196 }
11651197 }
11661198 }
@@ -1705,6 +1737,7 @@ public:
17051737 }
17061738 else if( w_ == w && h_ == h && d_ == d )
17071739 {
1740+ out = *this;
17081741 return( true );
17091742 }
17101743
@@ -1771,17 +1804,39 @@ public:
17711804 }
17721805 else
17731806 {
1774- array3 o;
1775-
1776- if( this->trim( o, x, y, z, w, h, d ) )
1807+ difference_type w_ = this->width( );
1808+ difference_type h_ = this->width( );
1809+ difference_type d_ = this->depth( );
1810+ if( w_ <= static_cast< difference_type >( x ) || w_ < static_cast< difference_type >( x + w ) )
1811+ {
1812+ return( false );
1813+ }
1814+ else if( h_ <= static_cast< difference_type >( y ) || h_ < static_cast< difference_type >( y + h ) )
1815+ {
1816+ return( false );
1817+ }
1818+ else if( d_ <= static_cast< difference_type >( z ) || d_ < static_cast< difference_type >( z + d ) )
1819+ {
1820+ return( false );
1821+ }
1822+ else if( w_ == w && h_ == h && d_ == d )
17771823 {
1778- swap( o );
1779-
17801824 return( true );
17811825 }
17821826 else
17831827 {
1784- return( false );
1828+ array3 o;
1829+
1830+ if( this->trim( o, x, y, z, w, h, d ) )
1831+ {
1832+ swap( o );
1833+
1834+ return( true );
1835+ }
1836+ else
1837+ {
1838+ return( false );
1839+ }
17851840 }
17861841 }
17871842 }