|
Home Table of Contents News Dev Blogs Gallery Timeline Legend Tags Sponsors |
|
Join us on... |
|
|
|
Current: Month Day, Year
| name | description |
|---|---|
| glob | reference to global object. |
| textures | Dictionary of textures. |
| systextures | Dictionary of system textures (not to be accidentally deleted. |
| name | parameters | returns | description |
|---|---|---|---|
| getTextures | None | dictionary of textures | Getter of textures. |
| show | None | None | Command can be used for debugging (it is not used in normal mode). |
| add_sys | path texture (list) | None | Adds a system texture defined by list |
| add_user | path texture timestamp mhtex obj | None | Adds a user texture with time stamp and for the object it is used for (if it does not yet exist. |
| exists | path | openGL texture mhtex object |
If texture path exists it returns openGL texture and texture object. Otherwise it returns None |
| inc | path obj | None | Increments usage counter of texture and adds object to list. |
| delete | texture obj | success (bool) | find texture path and check if obj is assigned. If so, delete it and decrement counter. If counter is zero texture is destroyed and elem deleted from self.textures. |
| refresh | None | None | refresh all textures (to load e.g. a skin under construction. No refresh for generated textures. Here the timestamp is checked. |
| cleanup | textype | None | central location to delete textures (systextures only by demand). |
| name | description |
|---|---|
| glob | reference to global object. |
| name | parameters | returns | description |
|---|---|---|---|
| validMask | image mask | True if valid | check if mask is valid (has same size and is not none) |
| modifyToConstantHue | image r g b mask | None | modify an image to a constant hue. The image is transformed to a numpy array.
then the hue is calculated from r, g, b (in degrees). The values are converted to float.
Then if hue is -1 (r, g, b are identical), hue is set to index 0 and p, q, t are identical to value.
Otherwise hue p, q, t are calculated by hue formular in 6 different sections depending on index.
If a mask image is given only white areas are changed, black ones stay identical. |
| noColor | image mask | None | desaturates image by using modifyToConstantHue and values 1.0, 1.0, 1.0, and mask. |
| multColor | image r g b mask | None | multiplies image with a certain color. If a mask image is given only white areas are changed, black ones stay identical. |
| greyToColor | image r g b mask | None | first desaturates image and then multiplies image with a certain color. A mask can be used. |
| name | description |
|---|---|
| glob | reference to global object. |
| obj | the object which uses the texture. |
| repo | reference to global texture repo. |
| textype | the texture type (user or system). |
| image | the image (preset to None). |
| name | the name (preset to None). |
| name | parameters | returns | description |
|---|---|---|---|
| getImage | None | image | getter for image |
| getName | None | name | getter for name |
| getTexture | None | texture | getter for texture |
| create | image | texture | create an QOpenGLTexture with minmage filters and wrapmode, set data and return texture. |
| destroy | None | None | destroy the texture. |
| delete | None | None | delete the texture (only if type is user) by repo.delete function. |
| stdcolor | None | texture object | Creates a texture object of color [0.5, 0.5, 0.5]. |
| unicolor | rgb name | texture object | Creates a texture object of a certain rgb color. It returns an existing object in case it is already there and increases the counter for that texture and adds obj to list. Otherwise a new 1 pixel texture is created (either for system or for user) User texture will contain obj in list. |
| load | path textype modify (bool) | texture object | checks if a certain user texture already exists. If so, it increases the counter and add the object. Otherwise the timestamp of the texture is fetched and a new texture is created and added to the repo as system or user texture. The texture is returned (or None if texture cannot be loaded). |
| save_png | rgb | name | save image changed by coloration color (in exportfolder with name hex-color name prefix) The name created is returned. |
| refresh_image | None | texture | Old image is destroyed and created again. Used when textures are modified. |
| refresh | path | texture | Old image is destroyed and created again with new image path. Texture is returned. |
| name | description |
|---|---|
| maxsize | the maximal size of the thumbnail (preset to 128). |
| img | the image (preset to None). |
| name | parameters | returns | description |
|---|---|---|---|
| rescale | name | None | creates a thumbnail from image with Qt.KeepAspectRatio, Qt.SmoothTransformation and saves the image as name. |