nuke.Format

class nuke.Format

Bases: object

A format.

Methods

add

Add this instance to a list of "named" formats.

fromUV

Transform a UV coordinate in the range 0-1 into the format's XY range.

height

Return the height of image file in pixels.

name

Returns the user-visible name of the format.

pixelAspect

Returns the pixel aspect ratio (pixel width divided by pixel height) for this format.

r

Return the right edge of image file in pixels.

scaled

Scale and translate this format by sx, sy, tx and ty.

setHeight

Set the height of image file in pixels.

setName

Set name of this format.

setPixelAspect

Set a new pixel aspect ratio for this format.

setR

Set the right edge of image file in pixels.

setT

Set the top edge of image file in pixels.

setWidth

Set the width of image file in pixels.newWidth is the new width for the image; it should be a positive integer.

setX

Set the left edge of image file in pixels.

setY

Set the bottom edge of image file in pixels.

t

Return the top edge of image file in pixels.

toUV

Back-transform an XY coordinate in the format's space into UV space.

width

Return the width of image file in pixels.

x

Return the left edge of image file in pixels.

y

Return the bottom edge of image file in pixels.

add(name) None

Add this instance to a list of “named” formats. The name parameter is the name of the list to add the format to.

fromUV(u, v) [x, y]

Transform a UV coordinate in the range 0-1 into the format’s XY range. Returns a list containing the x and y coordinates.

Parameters
  • u – The U coordinate.

  • v – The V coordinate.

Returns

[x, y]

height() int

Return the height of image file in pixels.

name() string

Returns the user-visible name of the format.

pixelAspect() float

Returns the pixel aspect ratio (pixel width divided by pixel height) for this format.

r() int

Return the right edge of image file in pixels.

scaled(sx, sy, tx, ty) Format

Scale and translate this format by sx, sy, tx and ty.

Parameters

sx – Scale factor in X.:param sy: Scale factor in Y.:param tx: Offset factor in X.:param ty: Offset factor in Y.:return: Format.

setHeight(newHeight) None

Set the height of image file in pixels. newHeight is the new height for the image; it should be a positive integer.

setName(name) None

Set name of this format. The name parameter is the new name for the format.

setPixelAspect(aspectRatio) None

Set a new pixel aspect ratio for this format. The aspectRatio parameter is the new ratio, found by dividing the desired pixel width by the desired pixel height.

setR(newR) None

Set the right edge of image file in pixels. newR is the new right edge for the image; it should be a positive integer.

setT(newT) None

Set the top edge of image file in pixels. newY is the new top edge for the image; it should be a positive integer.

setWidth(newWidth) None

Set the width of image file in pixels.newWidth is the new width for the image; it should be a positive integer.

setX(newX) None

Set the left edge of image file in pixels. newX is the new left edge for the image; it should be a positive integer.

setY(newY) None

Set the bottom edge of image file in pixels. newY is the new bottom edge for the image; it should be a positive integer.

t() int

Return the top edge of image file in pixels.

toUV(x, y)

Back-transform an XY coordinate in the format’s space into UV space.

Parameters
  • x – The X coordinate.

  • y – The Y coordinate.

Returns

[u, v].

width() int

Return the width of image file in pixels.

x() int

Return the left edge of image file in pixels.

y() int

Return the bottom edge of image file in pixels.