-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double allocation without reason #62
Comments
So, it should be just |
Also, to match the Slice API, I'd like to rename the |
Probably it should be |
There's already |
OK |
But would be this |
|
Do we really need Image type? Why? |
As said in the description of the module in docs it is designed mainly to help with image I/O, but also to hold additional image metadata. Since it's data type is defined in runtime, it allows reading of unknown image format. Since Slice format is statically defined, we would have to expect certain image format when reading it, and if read image is not of expected format, we'd have to convert it. Also, Image contains additional metadata, e.g. color format (HSV, YUV, RGB etc.). And, in future Image should hold EXIF metadata. Pipeline in DCV should be:
Long story short, we need image container with runtime defined data type, and additional image related metadata. |
This is scripting language idioms. They are not good for D. If you have processing, then you work with one, two, maximum three formats for processing. The last one issue is reading. Yes, when we read something, the image format is unknown. But, as was said above, only beforehand image types are interesting. So, a user or library should define mapping, for example:
It is not possible to eliminate this mapping. But rather then hiding it in different classes implementations it is better to have an explicit way to do it and library helpers if required. Please avoid any usage of classes (except already existing D libs, which can be replaced in future). Even async I/O can be performed without classes. D users like it because they are familiar with OOP. But this is bad practice for D. Structural programming is proper way to move forward with D. |
I understand everything you're saying, and I have tried to design the API without the Created separate issue about this, see #64 |
Thanks, will do |
as!aType.slice.asImage
allocates without reason, bacause asImage allocates data anyway. asImage is uses data too. In addition, it should be something liketoImage
.The text was updated successfully, but these errors were encountered: