20 #include "../color/constants.h"
21 #include "../bitmap/bitmap_access.h"
22 #include "../bitmap/processing.h"
27 using namespace Audio;
50 ptr += ptr.getWidth();
55 ptr += ptr.getWidth();
58 ptr += ptr.getWidth();
62 ptr += ptr.getWidth();
88 int x,
int y,
int y1,
int y2,
int y3,
int y4,
int y5,
96 ptr += ptr.getWidth();
101 ptr += ptr.getWidth();
106 ptr += ptr.getWidth();
109 ptr += ptr.getWidth();
113 ptr += ptr.getWidth();
117 ptr += ptr.getWidth();
122 ptr += ptr.getWidth();
134 length = stopTime - startTime;
154 data.reserve(2 *
width);
165 data.reserve(4 *
width);
166 sample* pMin =
min, *pMax =
max;
168 sample ymm = *pMin++, ymM = ymm, yMm = *pMax++, yMM = yMm;
192 signal(NULL),
bitmap(NULL), outputRect(0,0,100,100), signalWindow(0,-32768,100,32767),
scale(1.0f),
channels(-1)
202 std::vector<int> yyy;
206 auto y = yyy.begin();
210 int y0 = *
y++,
y1 = *
y++;
216 int y0 = *
y++,
y1 = *
y++,
y2 = *
y++, y3 = *
y++;
217 BitmapProcessing::write<Kernels::DrawBars5>(
A very basic class for any image.
static ThreadIndex validThreadCount(int number)
Valid thread count from a given integer value.
TaskDeviceRequirement
Specifies which device (CPU and/or GPU) is used to run the task.
@ CPU_ONLY
this task does not use GPU
virtual ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
IntRectangle signalWindow
struct Beatmup::Audio::SignalPlot::@0 palette
void setSignal(Signal *)
Sets the input signal to plot.
void getPlot(TaskThread &thread, std::vector< int > &data, int &left, int &right)
void setChannels(int channels)
Specifies which channels to plot.
void setPlotArea(IntRectangle)
Specifies a rectangular area in pixels in the output bitmap where the plot will be drawn.
void setPalette(color4i bgColor, color4i color1, color4i color2)
Specifies plot colors.
virtual void beforeProcessing(ThreadIndex, ProcessingTarget target, GraphicPipeline *)
Instruction called before the task is executed.
void setWindow(IntRectangle window, float scale)
Specifies a time range (X coordinate) and a magnitude range (Y coordinate scaled by scale) that will ...
virtual void afterProcessing(ThreadIndex, GraphicPipeline *, bool)
Instruction called after the task is executed.
virtual TaskDeviceRequirement getUsedDevices() const
Communicates devices (CPU and/or GPU) the task is run on.
virtual bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
void setBitmap(AbstractBitmap *)
Sets the output bitmap.
void measure(dtime len, int resolution, sample min[], sample max[])
Measures signal dynamics in a given period of time.
unsigned char getChannelCount() const
void unlock(AbstractBitmap *bitmap)
Drops a lock to the bitmap.
void writeLock(GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
Locks content of a bitmap for writing using a specific processing target device.
void normalize()
Flips corners coordinates guaranteeing that it has a non negative area, i.e.
virtual const int getWidth() const =0
Width of the texture in pixels.
Internal low-level GPU control API.
virtual ThreadIndex numThreads() const =0
virtual void synchronize()=0
Blocks until all the other threads running the same task reach the same point.
ThreadIndex currentThread() const
virtual bool isTaskAborted() const =0
Returns true if the task is asked to stop from outside.
static void process(AbstractBitmap &bitmap, int x, int y, int y1, int y2, int y3, const color4i &color1, const color4i &color2)
Plots three vertical bars.
static void process(AbstractBitmap &bitmap, int x, int y, int y1, int y2, int y3, int y4, int y5, const color4i &color1, const color4i &color2, const color4i &color3)
Plots five vertical bars.
#define BEATMUP_ASSERT_DEBUG(C)
static const color4i DARK_SEA_GREEN2
static const color4i DARK_SEA_GREEN1
static const color4i WHITE
unsigned char ThreadIndex
number of threads / thread index
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
static pixint4 fromColor(const color4i &_)
JNIEnv jlong jint jint color1
JNIEnv jlong jint jint jint jint y2
JNIEnv jlong jint jint jint jint jfloat scale
JNIEnv jobject jint jint jint channels
return signal getChannelCount()
JNIEnv jlong jint jint jint color2
JNIEnv jlong jint jint jint y1
jobject jlong jint jint y
JNIEnv jlong jint jint count
Beatmup::InternalBitmap * bitmap
jlong jlong jint jint jint jint jint left