imgcrush.png.PNGProcessor Class Reference
List of all members.
Detailed Description
Handles PNG file generation and it's settings.
Definition at line 49 of file png.py.
Member Function Documentation
def imgcrush.png.PNGProcessor.__init__ |
( |
|
self, |
|
|
|
numproc = 1 | |
|
) |
| | |
Constructor.
Data members:
MinLevel : Minimum compression level to use. Can be int 0-9.
Filters : PNG filters to use. String of numbers representing
filters, for instance "125" for filters 1, 2 and 5.
Available filters:
0 : none
1 : sub
2 : up
3 : average
4 : Paeth
5 : Adaptive when not palleted and level more than 5
6 : Adaptive
MinPalDepth : Minimum bit depth to use for paletted images.
e.g. bit depth 4 means there is maximum of 16 colors
in the palette. Can be 0, 1, 2, 4 or 8. 0 means
paletted images are not generated.
MinGrayDepth : Minimum bit depth to use for grayscale images.
e.g. bit depth 4 means there is maximum of 16 levels of
gray. Can be 0, 2, 3, 4 or 8. 0 means grayscale images
are not generated.
Interlace : Generate interlaced images?
Optimizations : Level of optimization to use:
0 - none
1 - lossless optimizations (same results as with none)
2 - some optimizations
3 - more optimizations
OptUseGray : Optimization - dictionary of bools specifying whether
or not to generate indexed files with bitdepth equal
to dict key. Reset to None with each processes file,
which triggers a test that sets it to True or False.
OptUseGray : Optimization - dictionary of bools specifying whether
or not to generate grayscale files with bitdepth equal
to dict key. Reset to None with each processes file,
which triggers a test that sets it to True or False.
OptMaxFilesDec : Number which is substracted from expected number of
generated files in get_max_files() to remove
difference caused by optimizations.
ProcList : List containing data specific to each process that
uses this PNGProcessor.
Definition at line 53 of file png.py.
def imgcrush.png.PNGProcessor.generate_image |
( |
|
self, |
|
|
|
fnoext, |
|
|
|
reffile, |
|
|
|
lv, |
|
|
|
f, |
|
|
|
m, |
|
|
|
d, |
|
|
|
i, |
|
|
|
p, |
|
|
|
advpng = False | |
|
) |
| | |
Generates image with given settings.
Definition at line 336 of file png.py.
def imgcrush.png.PNGProcessor.get_bitdepth_vals |
( |
|
self |
) |
|
Parses stored bitdepth data, returns list of used bitdepth values.
Definition at line 250 of file png.py.
def imgcrush.png.PNGProcessor.get_filter_vals |
( |
|
self |
) |
|
Parses stored filter settings, returns list of used filter values.
Definition at line 233 of file png.py.
def imgcrush.png.PNGProcessor.get_interlace_vals |
( |
|
self |
) |
|
Parses stored interlace data, returns list of used interlace values.
Definition at line 265 of file png.py.
def imgcrush.png.PNGProcessor.get_level_vals |
( |
|
self |
) |
|
Parses stored PNG level settings, returns list of used level values.
Definition at line 216 of file png.py.
def imgcrush.png.PNGProcessor.get_max_files |
( |
|
self, |
|
|
|
proc = 0 | |
|
) |
| | |
Returns maximum number of files generated in optimization.
Used for % feedback.
Definition at line 289 of file png.py.
def imgcrush.png.PNGProcessor.get_mode_vals |
( |
|
self |
) |
|
Parses stored color storage mode data, returns possible values.
Definition at line 238 of file png.py.
def imgcrush.png.PNGProcessor.get_vals_str |
( |
|
self, |
|
|
|
str | |
|
) |
| | |
Returns all possible values of setting requested by input string.
Definition at line 273 of file png.py.
def imgcrush.png.PNGProcessor.helper |
( |
|
self, |
|
|
|
level, |
|
|
|
filter, |
|
|
|
ilace, |
|
|
|
reffile, |
|
|
|
fnoext, |
|
|
|
proc = 0 | |
|
) |
| | |
Inner part of PNG generation.
Taken out of inner loop of process_png.
This generates PNG files using specified settings in all allowed
modes, e.g. truecolor, paletted, grayscale, bitmap.
Definition at line 350 of file png.py.
def imgcrush.png.PNGProcessor.process |
( |
|
self, |
|
|
|
reffile, |
|
|
|
fnoext, |
|
|
|
queue = None , |
|
|
|
proc = 0 | |
|
) |
| | |
Generates temporary png files and returns a list of them.
Definition at line 428 of file png.py.
def imgcrush.png.PNGProcessor.reset |
( |
|
self, |
|
|
|
proc = 0 | |
|
) |
| | |
Resets variables that are set separately for each file .
Definition at line 322 of file png.py.
def imgcrush.png.PNGProcessor.set_all |
( |
|
self, |
|
|
|
all | |
|
) |
| | |
Sets all PNG settings according to given mode.
fastest means all optimizations and least generated files
extreme means no optimizations and all generated files
heavy means lossless optimizations only - i.e. same result as extreme
Definition at line 102 of file png.py.
def imgcrush.png.PNGProcessor.set_filters |
( |
|
self, |
|
|
|
filters | |
|
) |
| | |
def imgcrush.png.PNGProcessor.set_interlace |
( |
|
self |
) |
|
Turns generation of interlaced images on.
Definition at line 206 of file png.py.
def imgcrush.png.PNGProcessor.set_min_gray_depth |
( |
|
self, |
|
|
|
d | |
|
) |
| | |
Sets the minimum bit depth to use with grayscale images.
Definition at line 195 of file png.py.
def imgcrush.png.PNGProcessor.set_min_level |
( |
|
self, |
|
|
|
l | |
|
) |
| | |
Sets minimum compression level to use.
Definition at line 165 of file png.py.
def imgcrush.png.PNGProcessor.set_min_pal_depth |
( |
|
self, |
|
|
|
d | |
|
) |
| | |
Sets minimum bit depth to use with paletted images.
Definition at line 182 of file png.py.
def imgcrush.png.PNGProcessor.set_optimizations |
( |
|
self, |
|
|
|
opt | |
|
) |
| | |
Set optimization level to use.
Definition at line 157 of file png.py.
def imgcrush.png.PNGProcessor.set_proc_count |
( |
|
self, |
|
|
|
numproc | |
|
) |
| | |
Set the number of processes that will use PNGProcessor.
Used to allocate process specific data.
Definition at line 147 of file png.py.
def imgcrush.png.PNGProcessor.set_truecolor |
( |
|
self, |
|
|
|
t | |
|
) |
| | |
Turns generation of truecolor images on or off.
Definition at line 211 of file png.py.
The documentation for this class was generated from the following file: