Available in Retrobatch Pro 1.1 or later

Asset Methods

Returns a data object with a representation of the image in the passed format.

If you'd like a JPEG, you'd pass 'public.jpeg'. 'public.png' for PNG, 'public.tiff' for TIFF.

Objective-C interface: - (NSData*)imageDataWithFormatOfUTI:(NSString*)uti

Returns a dictionary object, which contains all the metadata keys in the image.

Objective-C interface: - (NSDictionary*)metaData

Get a specific key out of the metadata dictionary. The meta dictionary name is the name of the dictionary you want to pull the values from, such as kCGImagePropertyTIFFDictionary, kCGImagePropertyExifDictionary, or kCGImagePropertyIPTCDictionary. Visit Apple's documentation for more information and the various keys you can use.

Objective-C interface: - (id)metaValueForPropertyName:(NSString*)propName inMetaDictionaryName:(NSString*)dictName

Set a specific value in the metadata dictionary. See metaValueForPropertyName_inMetaDictionaryName for information about the dictionary name.

Objective-C interface: - (void)setMetaValue:(id)value forPropertyName:(NSString*)propName inMetaDictionaryName:(NSString*)dictName

Available in 1.1.1 or later.

Set a temporary value on the asset, which can be used in token fields (such as the watermark token) or later on in another plugin in the graph. The values set are only ever used when running a workflow, and are never saved.

As an example, let's say that you had a script or plugin that set a user value of "bar" on an asset with a key of "foo". You could then use the placeholder text $userValue.foo$ in a watermark node to have the value for "bar" show up in the watermark. The values can be dynamically generated for your own purposes.

Objective-C interface: - (void)setUserValue:(id)value forKey:(NSString*)key


Available in 1.2 or later. Grabs a previously set user value out of an asset.

Objective-C interface: - (FMPLUGIN_API id)userValueForKey:(NSString*)key

Available in 1.2 or later. Return all the user values in an asset as a dictionary.

Objective-C interface: - (NSDictionary*)userDictionary;

- (OTImageAccumulator*)emptyImageAccumulator

Returns an empty accumulator which you can draw CIImages to, or lock focus to for drawing in CoreGraphics or NSGraphics. Its size, color profile, and bit depth are set to match what the image you're calling it from are. See OTImageAccumulator for API calls.

Make an empty accumulator of a specific size.

Objective-C interface: - (OTImageAccumulator*)emptyImageAccumulatorOfSize:(CGSize)s

Returns the width of an asset.

Objective-C interface: - (NSInteger)imageWidth

Returns the height of an asset.

Objective-C interface: - (NSInteger)imageHeight

Returns the megapixels of the image. (asset.imageWidth() * asset.imageHeight()) / 1000000.0;

Objective-C interface: - (CGFloat)imageMegaPixels

bitsPerComponent() Returns the size of each color / channel component in the image in bits.

Objective-C interface: - (size_t)bitsPerComponent

Returns a boolean value on wether or not the image has an alpha channel.

Objective-C interface: - (BOOL)hasAlphaChannel

Returns a string with the color model of the image. For example, "RGB", "CMYK", "Lab", etc.

Objective-C interface: - (NSString*)colorModel

Returns a string representing the file type of the image. For example "JPEG", "PNG", or "TIFF".

Objective-C interface: - (NSString*)imageFileType

Returns a string with the name of the color profile the image uses. For example, "sRGB IEC61966-2.1".

Objective-C interface: - (NSString*)colorProfileName

Returns a string generated from the machine learning Classification node, representing what the model things the image contains.

Objective-C interface: - (NSString*)topClassification

Returns a float between 0.0 and 1.0, giving the confidence from the Model for the top classification assigned.

Objective-C interface: - (float)topClassificationConfidence

The path to the file on disk, returned as a string.

Objective-C interface: - (NSString*)filePath

The path to the file on disk, return as an NSURL object.

Objective-C interface: - (NSURL*)fileURL

Objective-C interface: - (void)setCGImage:(CGImageRef)img

Objective-C interface: - (void)setCIImage:(CIImage*)img


Objective-C interface: - (FMPLUGIN_API void)drawCIImage:(CIImage*)image;

Objective-C interface: - (FMPLUGIN_API void)drawCIImage:(CIImage*)image withCompositeFilterNamed:(NSString*)ciFilterName;

Objective-C interface: - (FMPLUGIN_API void)setImage:(CIImage *)im

Objective-C interface: - (void)setImage:(CIImage *)im dirtyRect:(CGRect)r

Objective-C interface: - (FMPLUGIN_API void)lockFocus
Objective-C interface: - (FMPLUGIN_API void)unlockFocus