Click here to support Nimbus development and make a donation at www.pledgie.com !
An iOS framework whose growth is bounded by O(documentation).
NINetworkImageRequest Class Reference

Overview

A threaded network request for an image that chops up and resizes the image before returning to the UI thread.

Definition at line 30 of file NINetworkImageRequest.h.

Inheritance diagram for NINetworkImageRequest:
NINetworkRequestOperation <NINetworkImageOperation> NIOperation

Methods

Configurable Properties
CGRect imageCropRect property
CGSize imageDisplaySize property
NINetworkImageViewScaleOptions scaleOptions property
CGInterpolationQuality interpolationQuality property
UIViewContentMode imageContentMode property
Results
UIImage * imageCroppedAndSizedForDisplay property
Image Modifications
(UIImage *) + imageFromSource:withContentMode:cropRect:displaySize:scaleOptions:interpolationQuality:
Configuring the Operation
NSURL * url property
NSTimeInterval timeout property
NSURLRequestCachePolicy cachePolicy property
Operation Results
NSDatadata property
id processedObject property
Creating an Operation
(id) - initWithURL:
Delegation
id< NIOperationDelegatedelegate property
Post-Operation Properties
NSError * lastError property
Identification
NSInteger tag property
Blocks
NIBasicBlock didStartBlock property
NIBasicBlock didFinishBlock property
NIErrorBlock didFailWithErrorBlock property
NIBasicBlock willFinishBlock property
Subclassing

The following methods are provided to aid in subclassing and are not meant to be used externally.

(void) - didStart
(void) - didFinish
(void) - willFinish

Method Documentation

- NINetworkImageRequest: [read, write, assign]

x/y, width/height are in percent coordinates.

Valid range is [0..1] for all values.

Examples:

CGRectZero - Do not crop this image. CGRect(0, 0, 1, 1) - Do not crop this image.

The default value is CGRectZero.

Reimplemented from <NINetworkImageOperation>.

Definition at line 45 of file NINetworkImageRequest.h.

- NINetworkImageRequest: [read, write, assign]

The size of the image to be displayed on the screen.

This is the final size that imageCroppedAndSizedForDisplay will be, unless cropImageForDisplay is NO.

If this is CGSizeZero, the image will not be resized. It will bereturned at its original size.

The default value is CGSizeZero.

Reimplemented from <NINetworkImageOperation>.

Definition at line 46 of file NINetworkImageRequest.h.

- NINetworkImageRequest: [read, write, assign]

Options for modifying the way images are cropped when scaling.

The default value is NINetworkImageViewScaleToFitLeavesExcessAndScaleToFillCropsExcess.

See also:
NINetworkImageViewScaleOptions

Reimplemented from <NINetworkImageOperation>.

Definition at line 47 of file NINetworkImageRequest.h.

- NINetworkImageRequest: [read, write, assign]

The interpolation quality to use when resizing the image.

The default value is kCGInterpolationDefault.

Reimplemented from <NINetworkImageOperation>.

Definition at line 48 of file NINetworkImageRequest.h.

- NINetworkImageRequest: [read, write, assign]

Determines how to resize and crop the image.

Supported content modes:

  • UIViewContentModeScaleToFill
  • UIViewContentModeScaleAspectFill

The default value is UIViewContentModeScaleToFill.

Reimplemented from <NINetworkImageOperation>.

Definition at line 49 of file NINetworkImageRequest.h.

- NINetworkImageRequest: [read, write, retain]

Upon completion of the request, this is the chopped and sized result image that should be used for display.

Reimplemented from <NINetworkImageOperation>.

Definition at line 53 of file NINetworkImageRequest.h.

+ (UIImage *) imageFromSource: (UIImage *)  src
withContentMode: (UIViewContentMode)  contentMode
cropRect: (CGRect)  cropRect
displaySize: (CGSize)  displaySize
scaleOptions: (NINetworkImageViewScaleOptions scaleOptions
interpolationQuality: (CGInterpolationQuality)  interpolationQuality 

Take a source image and resize and crop it according to a set of display properties.

On devices with retina displays, the resulting image will be returned at the correct resolution for the device.

This method is exposed to allow other image operations to generate cropped and resized images as well.

Parameters:
srcThe source image.
contentModeThe content mode to use when cropping and resizing the image.
cropRectAn initial crop rect to apply to the src image.
displaySizeThe requested display size for the image. The resulting image may or may not match these dimensions depending on the scale options being used.
scaleOptionsSee the NINetworkImageViewScaleOptions documentation for more details.
interpolationQualityThe interpolation quality to use when resizing the image.
Returns:
The resized and cropped image.
- NINetworkRequestOperation: [read, write, copy, inherited]

The url that will be loaded in the network operation.

Definition at line 82 of file NIOperations.h.

- NINetworkRequestOperation: [read, write, assign, inherited]

The number of seconds that may pass before a request gives up and fails.

Definition at line 83 of file NIOperations.h.

- NINetworkRequestOperation: [read, write, assign, inherited]

The request cache policy to use.

Definition at line 84 of file NIOperations.h.

- NINetworkRequestOperation: [read, retain, inherited]

The data received from the request.

Will be nil if the request failed.

See also:
NIOperation::lastError

Definition at line 85 of file NIOperations.h.

- NINetworkRequestOperation: [read, write, retain, inherited]

An object created from the data that was fetched.

Will be nil if the request failed.

See also:
NIOperation::lastError

Definition at line 86 of file NIOperations.h.

- (id) initWithURL: (NSURL *)  url

Initializes a newly allocated network operation with a given url.

Definition at line 189 of file NIOperations.m.

- NIOperation: [read, write, assign, inherited]

The delegate through which changes are notified for this operation.

All delegate methods are performed on the main thread.

Definition at line 48 of file NIOperations.h.

- NIOperation: [read, retain, inherited]

The error last passed to the didFailWithError notification.

Definition at line 49 of file NIOperations.h.

- NIOperation: [read, write, assign, inherited]

A simple tagging mechanism for identifying operations.

Definition at line 50 of file NIOperations.h.

- NIOperation: [read, write, copy, inherited]

The operation has started executing.

Performed on the main thread.

Definition at line 54 of file NIOperations.h.

- NIOperation: [read, write, copy, inherited]

The operation has completed successfully.

This will not be called if the operation fails.

Performed on the main thread.

Definition at line 55 of file NIOperations.h.

- NIOperation: [read, write, copy, inherited]

The operation failed in some way and has completed.

didFinishBlock will not be executed.

Performed on the main thread.

Definition at line 56 of file NIOperations.h.

- NIOperation: [read, write, copy, inherited]

The operation is about to complete successfully.

This will not be called if the operation fails.

Performed in the operation's thread.

Definition at line 57 of file NIOperations.h.

- (void) didStart

On the main thread, notify the delegate that the operation has begun.

Definition at line 67 of file NIOperations.m.

- (void) didFinish

On the main thread, notify the delegate that the operation has finished.

Definition at line 75 of file NIOperations.m.

- (void) willFinish

In the operation's thread, notify the delegate that the operation will finish successfully.

Definition at line 93 of file NIOperations.m.

Generated for Nimbus by doxygen 1.7.4-20110629