smdh - SMDH icons

The smdh module enables reading SMDH icons, including converting the graphical icon data to a standard format, reading application titles, and settings.

This module can use Pillow if it is installed, to provide icon data as PIL.Image.Image objects.

SMDH objects

class pyctr.type.smdh.SMDH(names, icon_small_array, icon_large_array, flags, region_lockout)[source]

Bases: object

Class for 3DS SMDH.

https://www.3dbrew.org/wiki/SMDH

Parameters:
  • names (dict[str, AppTitle])

  • icon_small_array (list[list[RGBTuple]])

  • icon_large_array (list[list[RGBTuple]])

  • flags (SMDHFlags)

  • region_lockout (SMDHRegionLockout)

names: Mapping[str, AppTitle]
icon_small_array
icon_large_array
flags
region_lockout
icon_small
icon_large
get_app_title(language=('English', 'Japanese', 'French', 'German', 'Italian', 'Spanish', 'Simplified Chinese', 'Korean', 'Dutch', 'Portuguese', 'Russian', 'Traditional Chinese'))[source]
Parameters:

language (str | tuple[str, ...])

Return type:

AppTitle | None

classmethod load(fp)[source]

Load an SMDH from a file-like object.

Parameters:

fp (BinaryIO)

Return type:

SMDH

classmethod from_file(fn, *, fs=None)[source]
Parameters:
  • fn (FilePath)

  • fs (FS | None)

Return type:

SMDH

Exceptions

exception pyctr.type.smdh.SMDHError[source]

Generic exception for SMDH operations.

exception pyctr.type.smdh.InvalidSMDHError[source]

Invalid SMDH contents.