Skip to content

OutputInfo::line_size should be a method #521

Open
@Shnatsel

Description

@Shnatsel

As of v0.17.14, the OutputInfo struct has a pub field line_size that seems to be computed entirely from other fields - namely width, height and bit depth.

Since the field is public, it is possible for the API user to mutate it and put the whole OutputInfo in an inconsistent state where the values of the fields end up conflicting each other.

It would be nice to turn one of these fields into a method that computes data from the other values, so that it's no longer possible to create structs with conflicting values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions