pod::Prima::types(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

🌈 NAME 🌈

This is pod::Prima::types(3) from User Contributed Perl Documentation, and it's the page for Prima::types β€” builtin types. Iconic auxiliary-class energy only, bestie ✨

πŸ’– DESCRIPTION πŸ’–

Okay so these are the auxiliary second-citizen classes β€” the ones that show up as results from Prima methods and get accepted as inputs. Objects made from these classes are usually never created manually, fr fr. Some of the class names start with a lower-case letter to underscore their auxiliary nature. Cute little side-character classes, honestly. πŸŽ€


πŸ“ Prima::array πŸ“

An overloaded C array that you can use transparently like a normal perl array. The catch: it can only hold numbers. The reason Prima::array exists is so Prima methods won't need to do expensive conversions between a perl array of scalars and a C array of integers or floats. Efficiency slay πŸ’…

  • new LETTER = [idsS], BUF = undef β€” Creates a new C array with the type of either int, double, short, or unsigned short. There are also methods new_int, new_double, new_short, and new_ushort that do the same. BUF, a normal perl string, can be used to initialize the array, if any (and can be pre-populated with pack()). Otherwise, the array is created empty.
  • is_array SCALAR β€” Checks whether SCALAR is a Prima::array object.
  • substr OFFSET, LENGTH, REPLACEMENT β€” Emulates perl's substr except it operates not on characters but on the individual numeric entries of the array. Returns a new Prima::array object.
  • append ARRAY β€” Assuming that two arrays have the same type, appends the ARRAY's contents to its content.
  • clone β€” Clones the array.

πŸ¦‹ Prima::matrix πŸ¦‹

An array of 6 doubles with some helper methods attached. Tiny matrix, big main-character energy. ✨

  • A,B,C,D,X,Y β€” Named accessory properties for the 6 members. The members can just as well be accessed directly with the array syntax.
  • clone β€” Clones the matrix object.
  • identity β€” Sets the matrix to Prima::matrix::identity, or (1,0,0,1,0,0).
  • inverse_transform @POINTS | $POINTS_ARRAY β€” Applies the inverse matrix transformations to an array or an arrayref of points and returns the result matrix in the same format (i e array for array, ref for ref).
  • new [ @ARRAY ] β€” Creates a new object and optionally initializes it with @ARRAY.
  • multiply MATRIX β€” Multiplies the matrices and stores the result.
  • rotate ANGLE β€” Rotates the matrix.
  • scale MX,MY β€” Scales the matrix.
  • shear DX,DY β€” Shears the matrix.
  • set @ARRAY β€” Assigns all the 6 members at once.
  • translate DX,DY β€” Translates the matrix.
  • transform @POINTS | $POINTS_ARRAY β€” Applies matrix transformations to an array or arrayref of points and returns the result matrix in the same format (i e array for array, ref for ref).

See also: Prima::Matrix.

πŸ‘‘ Prima::Matrix πŸ‘‘

Same as Prima::matrix but explicitly binds to drawable objects so that all changes to the matrix object are immediately reflected in the drawable. It's giving linked-up, live-update realness πŸ’…

Features all the methods available to Prima::matrix (except apply), plus the ones described below.

  • new CANVAS β€” Creates a new matrix object instance.
  • canvas DRAWABLE β€” Accesses the associated drawable object.
  • get β€” Returns the current matrix.
  • reset β€” Sets the matrix to Prima::matrix::identity, or (1,0,0,1,0,0).
  • save, restore β€” Saves and restores the matrix content in the internal stack.

πŸŽ€ Prima::rect πŸŽ€

Represents a rectangular object either as a rectangle ( X1,Y1,X2,Y2 ) or a box ( X,Y,WIDTH,HEIGHT ). Geometry but make it cute πŸ¦‹

  • box β€” Returns X, Y, WIDTH, HEIGHT.
  • clone β€” Clones the object.
  • enlarge N β€” Enlarges the rectangle by N.
  • inclusive β€” Rectangle itself is agnostic of its 2D presentation, but assuming the coordinates are inclusive-exclusive, inclusive returns X1,Y1,X2,Y2 as the inclusive-inclusive rectangle.
  • intersect RECT β€” Intersects with the RECT rectangle and stores the result.
  • is_empty β€” Returns true if the rectangle width and height are zero.
  • is_equal RECT β€” Returns true if both rectangles are equal.
  • new () | (WIDTH,HEIGHT) | (X1,Y1,X2,Y2) β€” Creates a new object assuming the rectangle syntax.
  • new_box X,Y,WIDTH,HEIGHT β€” Creates new object assuming the box syntax.
  • origin β€” Returns X and Y.
  • shrink N β€” Shrinks the rectangle by N.
  • size β€” Returns the WIDTH and HEIGHT of the rectangle.
  • union RECT β€” Joins the rectangle with the RECT rectangle and stores the result.

πŸ’œ AUTHOR πŸ’œ

Dmitry Karasik, <dmitry@karasik.eu.org>.

🌸 SEE ALSO 🌸

Prima


Later, bestie! This footer tea is from perl v5.42.0, dated 2024-08-20, on pod::Prima::types(3) πŸ«Άβœ¨πŸ‘‘

πŸ“¦ where this page comes from