-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaxColorIndexTest.c
More file actions
52 lines (38 loc) · 1.29 KB
/
Copy pathmaxColorIndexTest.c
File metadata and controls
52 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "main.h"
#include "array.h"
#include "GIFColorTable.h"
#include "GIFInterface.h"
#include "GIFTransformations.h"
STATUS_CODE gif_createMaxColorIndexTest() {
STATUS_CODE status;
// Create canvas
GIFCanvas *canvas = gif_canvasCreate(255, 1);
CANVAS_NULL_CHECK(canvas);
status = gif_canvasSetFileName(canvas, "testGIF_MaxColorIndex.gif");
CHECKSTATUS(status);
status = gif_canvasCreateGlobalColorTable(canvas);
CHECKSTATUS(status);
for (int i = 0; i < 255; i++) {
status = gif_canvasAddColorToColorTable(canvas, 0, i, i);
CHECKSTATUS(status);
}
u8 tempIndexStream[255];
for (int i = 0; i < 255; i++) {
tempIndexStream[i] = i;
}
{
GIFFrame *frameOne = gif_frameCreate(255, 1, 0, 0);
FRAME_NULL_CHECK(frameOne);
status = gif_frameAddIndexStreamFromArray(frameOne, tempIndexStream, sizeof(tempIndexStream));
CHECKSTATUS(status);
status = gif_canvasAddFrame(canvas, frameOne);
CHECKSTATUS(status);
}
u32 widthMuliplier = 12; u32 heightMuliplier = 1000;
status = gif_expandCanvas(canvas, widthMuliplier, heightMuliplier);
gif_createGIF(canvas, true, true);
return OPERATION_SUCCESS;
}