public void Clear()
        {
            size_of_obj = (uint)Marshal.SizeOf <crn_comp_params>();

            file_type = crn_file_type.FileTypeCRN;
            faces     = 1;
            width     = 0;
            height    = 0;
            levels    = 1;
            format    = crn_format.DXT1;
            flags     = crn_comp_flags.Perceptual | crn_comp_flags.UseBothBlockTypes;

            images = new IntPtr[Constants.MAX_FACES, Constants.MAX_LEVELS];

            target_bitrate       = 0f;
            quality_level        = Constants.MAX_QUALITY_LEVEL;
            dxt1_alpha_threshold = 128;
            dxt_quality          = crn_dxt_quality.QualityUber;
            dxt_compressor_type  = crn_dxt_compressor_type.CompressorCRN;
            alpha_component      = 3;

            crn_adaptive_tile_color_psnr_derating = 2;
            crn_adaptive_tile_alpha_psnr_derating = 2;
            crn_color_endpoint_palette_size       = 0;
            crn_color_selector_palette_size       = 0;
            crn_alpha_endpoint_palette_size       = 0;
            crn_alpha_selector_palette_size       = 0;

            num_helper_threads = 0;
            userdata0          = 0;
            userdata1          = 0;

            progress_func      = IntPtr.Zero;
            progress_func_data = IntPtr.Zero;
        }
示例#2
0
        public static unsafe byte[] Compress(int width, int height, List <List <Memory <byte> > > data,
                                             crn_format format,
                                             crn_mipmap_params mipmaps = null, int maxThreads = -1)
        {
            var comp_params = new crn_comp_params();

            comp_params.width  = (uint)width;
            comp_params.height = (uint)height;
            comp_params.format = format;

            return(Compress(data, comp_params, mipmaps));
        }