Skip to content

Rethink SizeMultiple #33

Open
Open
@RunDevelopment

Description

@RunDevelopment

I added the SizeMultiple struct, because some formats (e.g. NV12) can only create images where the width and height are even numbers. The idea was to give users an API to see whether a specific size is supported for encoding ahead of time.

Ideas to resolve this:

  1. Remove SizeMultiple and replace it with a EncodingSupport::supports_size(Size) -> bool function. This shrinks the API surface, but it also obscures what the size multiples are.
  2. Remove SizeMultiple and use a tuple instead.
  3. Make the entire size multiple API private. Do users need to know this anyway?
  4. Move this information into PixelInfo. The size multiples derive from subsampling, so we also store whether the size needs to be a multiple of the subsampling.

Some notes:

  • IIRC, there are only a total of 6 formats with such requirements. Each of which rarely used.
  • Size multiples cannot be represented by a single number. IIRC, NV11 requires a width divisible by 4 but works for any height.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions