[API CHANGE SUGGESION] Make `TextureOpt::missingcolor` a `cspan`

Ouverte
#4,483 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
cpp

Piste de recherche

Commencez par la déclaration de TextureOpt et ses points d’entrée d’API missingcolor, conservative_filter, firstchannel, subimage et subimagename. Examinez les appelants et les tests existants avant de définir le comportement de rupture de cspan et la portée du nommage ; la finalisation requiert une conception d’API approuvée et la couverture correspondante.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

I heard most pointers + length would be replaced with spans of some sort going forward.

In that spirit I would like to suggest a (breaking) change to TextureOpt. The title kinda sums it up already. 😁

The change would be that the length of the missingcolor does not have to match nchannels any more.
It would simply be using the last channel value as fill if the cspan is shorter than nchannels or ignore channels at the end, if it is longer.

On that note: the OIIO API has quite afew naming inconistencies with its use of underscores. For example, the set prefix in some some methods is sometimes postfixed with an underscore and sometimes not.

In TextureOpt itself the obvious example is conservative_filter (uses an underscore) vs missingcolor, firstchannel, subimage, subimagename, etc. (don't).
It should be conservative_filter, missing_color, first_channel, sub_image, sub_image_name, etc.
Or neither should have an underscore.

While this is more changes than just removing the underscore from conservative_filter: as a non-native speaker I very much prefer the underscore version.
One of the reasons people struggle with German is that we string arbitray number of nouns together to create new ones. 😁
When you read these it is very difficult for non-native speakers to understand where one noun ends and the next one starts. So if you think this is a silly request, ask someone in your circle of friends who know German as a second language how they feel about that. They can probably reason about it better than I. 😉

TLDR; if the missingcolor as cspan change happens that may be an opportunity to clean up naming in this struct too.

In the Rust version I btw. also postfixed any s & t settings, i.e. s_blur etc.

Langage dominant
C++
Étoiles
2.4k
Forks
727
Merge moyen
4 j 8 h
PR mergées (30 j)
67

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de AcademySoftwareFoundation/OpenImageIO

Toutes les issues de AcademySoftwareFoundation/OpenImageIO

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.