-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cython smp #1735
base: master
Are you sure you want to change the base?
Cython smp #1735
Conversation
695b2ba
to
b3f3391
Compare
should I add @9a24f0 to .mailmap or copying.md? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made comments to the SMX file only, but they apply to the SMP file in the same way. The graphics seem to convert fine, so there are only structural changes left to do.
} | ||
cdef class SMXMainLayer8to5(SMXLayer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declarations should be separated by at two spaces.
} | |
cdef class SMXMainLayer8to5(SMXLayer): | |
} | |
cdef class SMXMainLayer8to5(SMXLayer): |
# memory pointer | ||
cdef const uint8_t[::1] data_raw | ||
|
||
# current command | ||
cdef int cmd_offset | ||
|
||
# current color | ||
cdef int color_offset | ||
|
||
# current chunk position | ||
cdef int chunk_pos | ||
|
||
# rows | ||
cdef size_t row_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we would want to promote these variables to members instead of keeping them local? All of these members are never accessed again after the layer has been read. Keeping data_raw
around is especially resource-intensive because we would store the whole original graphics file in memory well after it was used.
cdef numpy.ndarray determine_rgba_matrix(vector[vector[pixel]] &image_matrix, | ||
numpy.ndarray[numpy.uint8_t, ndim=2, mode="c"] palette): | ||
cdef numpy.ndarray determine_rgba_matrix(vector[vector[pixel]] & image_matrix, | ||
numpy.ndarray[numpy.uint8_t, ndim= 2, mode = "c"] palette): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are unecessary and might als break Cython syntax.
If you based your changes on their code, then yes, you have to add them to copying.md. |
@heinezen I've restructured the changes, please take a look. passing a variable of type Variant through the base class constructor e.g. |
Closes #1370.