1212 return false; |
1211 return false; |
1213 return d->handler->jumpToImage(imageNumber); |
1212 return d->handler->jumpToImage(imageNumber); |
1214 } |
1213 } |
1215 |
1214 |
1216 /*! |
1215 /*! |
1217 For image formats that support animation, this function returns |
1216 For image formats that support animation, this function returns the number |
1218 the number of times the animation should loop. Otherwise, it |
1217 of times the animation should loop. If this function returns -1, it can |
1219 returns -1. |
1218 either mean the animation should loop forever, or that an error occurred. |
1220 |
1219 If an error occurred, canRead() will return false. |
1221 \sa supportsAnimation(), QImageIOHandler::loopCount() |
1220 |
|
1221 \sa supportsAnimation(), QImageIOHandler::loopCount(), canRead() |
1222 */ |
1222 */ |
1223 int QImageReader::loopCount() const |
1223 int QImageReader::loopCount() const |
1224 { |
1224 { |
1225 if (!d->initHandler()) |
1225 if (!d->initHandler()) |
1226 return -1; |
1226 return -1; |
1227 return d->handler->loopCount(); |
1227 return d->handler->loopCount(); |
1228 } |
1228 } |
1229 |
1229 |
1230 /*! |
1230 /*! |
1231 For image formats that support animation, this function returns |
1231 For image formats that support animation, this function returns the total |
1232 the total number of images in the animation. |
1232 number of images in the animation. If the format does not support |
1233 |
1233 animation, 0 is returned. |
1234 Certain animation formats do not support this feature, in which |
1234 |
1235 case 0 is returned. |
1235 This function returns -1 if an error occurred. |
1236 |
1236 |
1237 \sa supportsAnimation(), QImageIOHandler::imageCount() |
1237 \sa supportsAnimation(), QImageIOHandler::imageCount(), canRead() |
1238 */ |
1238 */ |
1239 int QImageReader::imageCount() const |
1239 int QImageReader::imageCount() const |
1240 { |
1240 { |
1241 if (!d->initHandler()) |
1241 if (!d->initHandler()) |
1242 return -1; |
1242 return -1; |
1243 return d->handler->imageCount(); |
1243 return d->handler->imageCount(); |
1244 } |
1244 } |
1245 |
1245 |
1246 /*! |
1246 /*! |
1247 For image formats that support animation, this function returns |
1247 For image formats that support animation, this function returns the number |
1248 the number of milliseconds to wait until displaying the next frame |
1248 of milliseconds to wait until displaying the next frame in the animation. |
1249 in the animation. Otherwise, 0 is returned. |
1249 If the image format doesn't support animation, 0 is returned. |
1250 |
1250 |
1251 \sa supportsAnimation(), QImageIOHandler::nextImageDelay() |
1251 This function returns -1 if an error occurred. |
|
1252 |
|
1253 \sa supportsAnimation(), QImageIOHandler::nextImageDelay(), canRead() |
1252 */ |
1254 */ |
1253 int QImageReader::nextImageDelay() const |
1255 int QImageReader::nextImageDelay() const |
1254 { |
1256 { |
1255 if (!d->initHandler()) |
1257 if (!d->initHandler()) |
1256 return -1; |
1258 return -1; |
1257 return d->handler->nextImageDelay(); |
1259 return d->handler->nextImageDelay(); |
1258 } |
1260 } |
1259 |
1261 |
1260 /*! |
1262 /*! |
1261 For image formats that support animation, this function returns |
1263 For image formats that support animation, this function returns the |
1262 the sequence number of the current frame. Otherwise, -1 is |
1264 sequence number of the current frame. If the image format doesn't support |
1263 returned. |
1265 animation, 0 is returned. |
1264 |
1266 |
1265 \sa supportsAnimation(), QImageIOHandler::currentImageNumber() |
1267 This function returns -1 if an error occurred. |
|
1268 |
|
1269 \sa supportsAnimation(), QImageIOHandler::currentImageNumber(), canRead() |
1266 */ |
1270 */ |
1267 int QImageReader::currentImageNumber() const |
1271 int QImageReader::currentImageNumber() const |
1268 { |
1272 { |
1269 if (!d->initHandler()) |
1273 if (!d->initHandler()) |
1270 return -1; |
1274 return -1; |