encode_backward_references_ZopfliCostModel

encode_backward_references_ZopfliCostModel

Overview

encode_backward_references_ZopfliCostModel is a class in Aspose.Font FOSS for Python.

This class provides 7 methods for working with encode_backward_references_ZopfliCostModel objects in Python programs. Available methods include: GetCommandCost, GetLiteralCosts, GetMinCostCmd, Set, SetFromCommands, SetFromLiteralCosts, __init__. All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package. Properties: cost_cmd_, cost_dist_, literal_costs_, min_cost_cmd_.

Properties

NameTypeAccessDescription
min_cost_cmd_``ReadGets the min cost cmd .
literal_costs_``ReadGets the literal costs .
cost_dist_``ReadGets the cost dist .
cost_cmd_``ReadGets the cost cmd .

Methods

SignatureDescription
__init__()Calls init on this encode_backward_references_ZopfliCostModel instance.
SetFromCommands(num_bytes, position, ringbuffer, ringbuffer_mask, commands, num_commands, last_insert_len)Initializes the Zopfli cost model using the provided command list, ring buffer, and position information, preparing it for optimal backward‑reference selection
SetFromLiteralCosts(num_bytes, position, literal_cost, literal_cost_mask)Initializes the model using a literal cost array
GetCommandCost(dist_code, length_code, insert_length)Returns the cost for a command given distance, length and insert codes
GetLiteralCosts(_hx_from, to)Retrieves literal costs for indices from _hx_from up to to
GetMinCostCmd()Returns the command with the minimal stored cost
Set(histogram, cost)Assigns a histogram and its associated cost to the model

See Also