Questions tagged [stride]

The stride of an array is the number of locations in memory between beginnings of successive array elements, measured in bytes or in units of the size of the array's elements. Arrays may have a stride larger than their elements' width in bytes, which are called a non-unit stride. One particular use of non-unit stride is for images, when creating subimages without copying the pixel data.

The stride of an array is the number of locations in memory between beginnings of successive array elements, measured in bytes or in units of the size of the array's elements. Arrays may have a stride larger than their elements' width in bytes, which are called a non-unit stride. One particular use of non-unit stride is for images, when creating subimages without copying the pixel data.

157 questions
-1
votes
1 answer

Yet another issue with stride

According to the documentation stride for bitmap creating from a byteArray needs to be: The stride is the width of a single row of pixels (a scan line), rounded up to a four-byte boundary. If the stride is positive, the bitmap is top-down. If the…
Eric Snyder
  • 1,816
  • 3
  • 22
  • 46
-1
votes
1 answer

Is the stride of a char[] guaranteed to be 1 if the char[] is inside a struct __attribute__((aligned))?

So let's say I have a struct that looks like this (pretty common in the real world, it turns out): struct foo { char[24] bar; uint32_t fnord; uint32_t quux; }__attribute__((aligned(4)); What is the stride of bar, that is, what is…
-1
votes
2 answers

Extract every n-th element from TCL list

we can extract every n-th element of a TCL list by foreach loop. But is there a single line generic TCL cmd that will do the trick? Something like lindex with a '-stride' option.
Gert Gottschalk
  • 1,658
  • 3
  • 25
  • 37
-1
votes
1 answer

Divide array in chunks with different sizes

I'm getting an array of data from HTML Scraping similar to this: var resultArray = ["Maths", 2, 7, 8, "Grammar", 1, "Science", 7, 8] What I want to do is do divide it when it finds a "String" value. The result should look like this: var new_arr1 =…
Albifer
  • 167
  • 2
  • 10
-1
votes
1 answer

Swift stride function, cannot modify end value

In Swift, the c-style for-loop is deprecated, so I am switching to the stride function. In the first function, I use a c-style for-loop. In the second function, I used the stride function. createNumbers output is [8, 7, 6, 5, 4, 3, 2] createNumbers2…
-3
votes
1 answer

do cuda kernel sets stride for matrix automatically even if stride not initialized in host code?

i am studying cuda c and the source i am using use cuda sample programs specifically matrix multiply at runtime. i am following the code line by line and try to predict the next step to be sure i understand the code. during this i found the struct…
ahmed allam
  • 377
  • 2
  • 15
-3
votes
1 answer

Scale filter crashes with error when used from transcoding example

I've modified a bit (just to compile in c++) this code example: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/transcoding.c. What works: as is (null filter), a number of other filters like framerate, drawtext, ... What doesn't work:…
Vali
  • 11
  • 5
1 2 3
10
11