nuke.Format
- class nuke.Format
Bases:
pybind11_objectA Format.
Construct an empty format. Construct a format with width, height, x, y, r, t and optional pixel aspect ratio.
Methods
self.add(name) -> None
self.fromUV(u, v) -> [x, y]
self.height() -> int
self.name() -> string
self.pixelAspect() -> float
self.r() -> int
scaled(sx, sy, tx, ty) -> Format
self.setHeight(newHeight) -> None
self.setName(name) -> None
self.setPixelAspect(aspectRatio) -> None
self.setR(newR) -> None
self.setT(newT) -> None
self.setWidth(newWidth) -> None
self.setX(newX) -> None
self.setY(newY) -> None
self.t() -> int
self.toUV(x, y) -> (u, v)
self.width() -> int
self.x() -> int
self.y() -> int
- 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.
sy – Scale factor in Y.
tx – Offset factor in X.
ty – Offset factor in Y.
- Returns:
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.