Resource The Resource interface represents digital assets within the Cadastry Chain system. It provides a structure for describing various types of digital resources such as images, videos, 3D models, and more.

Key Properties

PropertyTypeDescription
typestringThe type of resource (e.g., 'image', 'mesh', 'sound', 'video', 'texture')
hashstringHash of the main file that represents this resource

Specialized Resource Types

1. Image

Represents image resources.

PropertyTypeDescription
classstring"resource.image"
typestring"image"
imagedimensions: Dimensions, variants?: [key: string]: ImageFileImage specific properties

ImageFile

PropertyTypeDescription
fileFileFile information for the image
dimensionsDimensionsDimensions of this specific image file
bitsnumberColor depth in bits
colorSpacestringColor space of the image (e.g., 'RGB', 'CMYK')
compressionstringCompression method used

2. Mesh

Represents 3D mesh resources.

PropertyTypeDescription
dimensionsDimensionsDimensions of the mesh
platformstringPlatform or software used to create the mesh
meshFilesMeshFile[]Different versions or LODs of the mesh

MeshFile

PropertyTypeDescription
fileFileFile information for the mesh
dimensionsDimensionsDimensions of this specific mesh file
LODnumberLevel of Detail
polygonsnumberNumber of polygons in the mesh
verticesnumberNumber of vertices in the mesh

3. Sound

Represents audio resources.

PropertyTypeDescription
formatstringAudio format (e.g., 'mp3', 'wav')
lengthnumberDuration of the sound in seconds
filesSoundFile[]Different versions of the sound file

SoundFile

PropertyTypeDescription
fileFileFile information for the sound
formatstringSpecific format of this sound file
lengthnumberDuration of this specific sound file

4. Texture

Represents texture resources for 3D models.

PropertyTypeDescription
typestringType of texture (e.g., 'diffuse', 'normal')
slotstringSlot or channel the texture is used in
mipmapCountnumberNumber of mipmaps
levelsnumberNumber of detail levels
dimensionsDimensionsDimensions of the texture
filterModestringTexture filtering mode
wrapModestringTexture wrapping mode
linearbooleanWhether linear filtering is used
transparentbooleanWhether the texture has transparency
textureFilesTextureFile[]Different versions of the texture

TextureFile

PropertyTypeDescription
fileFileFile information for the texture
dimensionsDimensionsDimensions of this specific texture file
formatstringFormat of the texture file
mipmapCountnumberNumber of mipmaps in this file
levelnumberDetail level of this texture file
transparentBooleanFieldWhether this specific file has transparency

5. Video

Represents video resources.

PropertyTypeDescription
dimensionsDimensionsDimensions of the video
formatstringVideo format (e.g., 'mp4', 'webm')
lengthnumberDuration of the video in seconds
videoFilesVideoFile[]Different versions of the video file

VideoFile

PropertyTypeDescription
fileFileFile information for the video
dimensionsDimensionsDimensions of this specific video file
formatstringSpecific format of this video file
compressionstringCompression method used
lengthnumberDuration of this specific video file

Common Interfaces

File

PropertyTypeDescription
namestringName of the file
hashstringHash of the file content
sizenumberSize of the file in bytes
urlstringURL where the file can be accessed
typestringMIME type of the file
storagestringStorage location or method

Dimensions

PropertyTypeDescription
widthstringWidth of the resource
heightstringHeight of the resource
depthstringDepth (for 3D resources)
unitstringUnit of measurement (e.g., 'px', 'cm')

The Resource interface and its specialized types provide a comprehensive structure for representing various kinds of digital assets within the system, allowing for detailed descriptions and management of these resources.