This topic describes the ST_AsRaw function. This function converts an object in an external store to a RAW object in an internal store.

Syntax

sfmesh ST_AsRaw(sfmesh sfmeshObject, 
                boolean rawGeometry default true, 
                boolean rawMesh default true,
                boolean rawMaterialdefault true, 
                boolean rawTexture default true );
meshgeom ST_AsRaw(meshgeom meshgeom);
texture ST_AsRaw(texture texture);
material ST_AsRaw(material material);

Parameters

ParameterDescription
materialThe material object.
textureThe texture object.
sfmeshObjectThe sfmesh object.
meshgeomThe meshgeom object.
rawGeometrySpecifies whether to convert the referenced geometry to a RAW object.
rawMeshSpecifies whether to convert the referenced sfmesh to a RAW object.
rawMaterialSpecifies whether to convert the referenced material to a RAW object.
rawTextureSpecifies whether to convert the referenced texture to a RAW object.

Description

This function converts an object in an external store to a RAW object in an internal store.

Examples

  • Example 1:
    -- texture
    SELECT ST_AsText(ST_AsRaw(ST_MakeTexture(225,225,'/home/example.jpeg'::cstring, false)));
    
    ------------------------------------------------------------------------------
     {"compressionType" : "None", "format" : "JPEG", "wrap" : "Wrap", "type" : "Raw", "depth" : 3, "width" : 225, "height" : 225, "size" : 7921, "data" : "FFD8FFE0001...."}
  • Example 2:
    -- Material
    SELECT ST_AsText(ST_AsRaw(ST_MakeMaterial('t_material'::text,
        'the_material'::text,                                                           'num=1'::text)));
    
    -----------------------------------------------------------------
     {"type":"raw", "attributes":  "ambient":"#FFDDEEAA", "diffuse" :"#FFDDEEAA","specular":"#FFDDEEAA","shininess":30,"transparency":70,"texture":2}}