Class: Frusdl::SDL::PixelFormat

Inherits:
Object
  • Object
show all
Extended by:
Low::SDL
Includes:
Low::SDL, Wrap
Defined in:
lib/frusdl/sdl/pixelformat.rb

Constant Summary

Constants included from Low::SDL

Low::SDL::AUDIO_S16, Low::SDL::AUDIO_S16LSB, Low::SDL::AUDIO_S16MSB, Low::SDL::AUDIO_S16SYS, Low::SDL::AUDIO_S8, Low::SDL::AUDIO_U16, Low::SDL::AUDIO_U16LSB, Low::SDL::AUDIO_U16MSB, Low::SDL::AUDIO_U16SYS, Low::SDL::AUDIO_U8, Low::SDL::KMOD_ALT, Low::SDL::KMOD_CAPS, Low::SDL::KMOD_CTRL, Low::SDL::KMOD_LALT, Low::SDL::KMOD_LCTRL, Low::SDL::KMOD_LMETA, Low::SDL::KMOD_LSHIFT, Low::SDL::KMOD_META, Low::SDL::KMOD_MODE, Low::SDL::KMOD_NONE, Low::SDL::KMOD_NUM, Low::SDL::KMOD_RALT, Low::SDL::KMOD_RCTRL, Low::SDL::KMOD_RESERVED, Low::SDL::KMOD_RMETA, Low::SDL::KMOD_RSHIFT, Low::SDL::KMOD_SHIFT, Low::SDL::RW_SEEK_CUR, Low::SDL::RW_SEEK_END, Low::SDL::RW_SEEK_SET, Low::SDL::SDLK_0, Low::SDL::SDLK_1, Low::SDL::SDLK_2, Low::SDL::SDLK_3, Low::SDL::SDLK_4, Low::SDL::SDLK_5, Low::SDL::SDLK_6, Low::SDL::SDLK_7, Low::SDL::SDLK_8, Low::SDL::SDLK_9, Low::SDL::SDLK_AMPERSAND, Low::SDL::SDLK_ASTERISK, Low::SDL::SDLK_AT, Low::SDL::SDLK_BACKQUOTE, Low::SDL::SDLK_BACKSLASH, Low::SDL::SDLK_BACKSPACE, Low::SDL::SDLK_BREAK, Low::SDL::SDLK_CAPSLOCK, Low::SDL::SDLK_CARET, Low::SDL::SDLK_CLEAR, Low::SDL::SDLK_COLON, Low::SDL::SDLK_COMMA, Low::SDL::SDLK_COMPOSE, Low::SDL::SDLK_DELETE, Low::SDL::SDLK_DOLLAR, Low::SDL::SDLK_DOWN, Low::SDL::SDLK_END, Low::SDL::SDLK_EQUALS, Low::SDL::SDLK_ESCAPE, Low::SDL::SDLK_EURO, Low::SDL::SDLK_EXCLAIM, Low::SDL::SDLK_F1, Low::SDL::SDLK_F10, Low::SDL::SDLK_F11, Low::SDL::SDLK_F12, Low::SDL::SDLK_F13, Low::SDL::SDLK_F14, Low::SDL::SDLK_F15, Low::SDL::SDLK_F2, Low::SDL::SDLK_F3, Low::SDL::SDLK_F4, Low::SDL::SDLK_F5, Low::SDL::SDLK_F6, Low::SDL::SDLK_F7, Low::SDL::SDLK_F8, Low::SDL::SDLK_F9, Low::SDL::SDLK_FIRST, Low::SDL::SDLK_GREATER, Low::SDL::SDLK_HASH, Low::SDL::SDLK_HELP, Low::SDL::SDLK_HOME, Low::SDL::SDLK_INSERT, Low::SDL::SDLK_KP0, Low::SDL::SDLK_KP1, Low::SDL::SDLK_KP2, Low::SDL::SDLK_KP3, Low::SDL::SDLK_KP4, Low::SDL::SDLK_KP5, Low::SDL::SDLK_KP6, Low::SDL::SDLK_KP7, Low::SDL::SDLK_KP8, Low::SDL::SDLK_KP9, Low::SDL::SDLK_KP_DIVIDE, Low::SDL::SDLK_KP_ENTER, Low::SDL::SDLK_KP_EQUALS, Low::SDL::SDLK_KP_MINUS, Low::SDL::SDLK_KP_MULTIPLY, Low::SDL::SDLK_KP_PERIOD, Low::SDL::SDLK_KP_PLUS, Low::SDL::SDLK_LALT, Low::SDL::SDLK_LAST, Low::SDL::SDLK_LCTRL, Low::SDL::SDLK_LEFT, Low::SDL::SDLK_LEFTBRACKET, Low::SDL::SDLK_LEFTPAREN, Low::SDL::SDLK_LESS, Low::SDL::SDLK_LMETA, Low::SDL::SDLK_LSHIFT, Low::SDL::SDLK_LSUPER, Low::SDL::SDLK_MENU, Low::SDL::SDLK_MINUS, Low::SDL::SDLK_MODE, Low::SDL::SDLK_NUMLOCK, Low::SDL::SDLK_PAGEDOWN, Low::SDL::SDLK_PAGEUP, Low::SDL::SDLK_PAUSE, Low::SDL::SDLK_PERIOD, Low::SDL::SDLK_PLUS, Low::SDL::SDLK_POWER, Low::SDL::SDLK_PRINT, Low::SDL::SDLK_QUESTION, Low::SDL::SDLK_QUOTE, Low::SDL::SDLK_QUOTEDBL, Low::SDL::SDLK_RALT, Low::SDL::SDLK_RCTRL, Low::SDL::SDLK_RETURN, Low::SDL::SDLK_RIGHT, Low::SDL::SDLK_RIGHTBRACKET, Low::SDL::SDLK_RIGHTPAREN, Low::SDL::SDLK_RMETA, Low::SDL::SDLK_RSHIFT, Low::SDL::SDLK_RSUPER, Low::SDL::SDLK_SCROLLOCK, Low::SDL::SDLK_SEMICOLON, Low::SDL::SDLK_SLASH, Low::SDL::SDLK_SPACE, Low::SDL::SDLK_SYSREQ, Low::SDL::SDLK_TAB, Low::SDL::SDLK_UNDERSCORE, Low::SDL::SDLK_UNDO, Low::SDL::SDLK_UNKNOWN, Low::SDL::SDLK_UP, Low::SDL::SDLK_WORLD_0, Low::SDL::SDLK_WORLD_1, Low::SDL::SDLK_WORLD_10, Low::SDL::SDLK_WORLD_11, Low::SDL::SDLK_WORLD_12, Low::SDL::SDLK_WORLD_13, Low::SDL::SDLK_WORLD_14, Low::SDL::SDLK_WORLD_15, Low::SDL::SDLK_WORLD_16, Low::SDL::SDLK_WORLD_17, Low::SDL::SDLK_WORLD_18, Low::SDL::SDLK_WORLD_19, Low::SDL::SDLK_WORLD_2, Low::SDL::SDLK_WORLD_20, Low::SDL::SDLK_WORLD_21, Low::SDL::SDLK_WORLD_22, Low::SDL::SDLK_WORLD_23, Low::SDL::SDLK_WORLD_24, Low::SDL::SDLK_WORLD_25, Low::SDL::SDLK_WORLD_26, Low::SDL::SDLK_WORLD_27, Low::SDL::SDLK_WORLD_28, Low::SDL::SDLK_WORLD_29, Low::SDL::SDLK_WORLD_3, Low::SDL::SDLK_WORLD_30, Low::SDL::SDLK_WORLD_31, Low::SDL::SDLK_WORLD_32, Low::SDL::SDLK_WORLD_33, Low::SDL::SDLK_WORLD_34, Low::SDL::SDLK_WORLD_35, Low::SDL::SDLK_WORLD_36, Low::SDL::SDLK_WORLD_37, Low::SDL::SDLK_WORLD_38, Low::SDL::SDLK_WORLD_39, Low::SDL::SDLK_WORLD_4, Low::SDL::SDLK_WORLD_40, Low::SDL::SDLK_WORLD_41, Low::SDL::SDLK_WORLD_42, Low::SDL::SDLK_WORLD_43, Low::SDL::SDLK_WORLD_44, Low::SDL::SDLK_WORLD_45, Low::SDL::SDLK_WORLD_46, Low::SDL::SDLK_WORLD_47, Low::SDL::SDLK_WORLD_48, Low::SDL::SDLK_WORLD_49, Low::SDL::SDLK_WORLD_5, Low::SDL::SDLK_WORLD_50, Low::SDL::SDLK_WORLD_51, Low::SDL::SDLK_WORLD_52, Low::SDL::SDLK_WORLD_53, Low::SDL::SDLK_WORLD_54, Low::SDL::SDLK_WORLD_55, Low::SDL::SDLK_WORLD_56, Low::SDL::SDLK_WORLD_57, Low::SDL::SDLK_WORLD_58, Low::SDL::SDLK_WORLD_59, Low::SDL::SDLK_WORLD_6, Low::SDL::SDLK_WORLD_60, Low::SDL::SDLK_WORLD_61, Low::SDL::SDLK_WORLD_62, Low::SDL::SDLK_WORLD_63, Low::SDL::SDLK_WORLD_64, Low::SDL::SDLK_WORLD_65, Low::SDL::SDLK_WORLD_66, Low::SDL::SDLK_WORLD_67, Low::SDL::SDLK_WORLD_68, Low::SDL::SDLK_WORLD_69, Low::SDL::SDLK_WORLD_7, Low::SDL::SDLK_WORLD_70, Low::SDL::SDLK_WORLD_71, Low::SDL::SDLK_WORLD_72, Low::SDL::SDLK_WORLD_73, Low::SDL::SDLK_WORLD_74, Low::SDL::SDLK_WORLD_75, Low::SDL::SDLK_WORLD_76, Low::SDL::SDLK_WORLD_77, Low::SDL::SDLK_WORLD_78, Low::SDL::SDLK_WORLD_79, Low::SDL::SDLK_WORLD_8, Low::SDL::SDLK_WORLD_80, Low::SDL::SDLK_WORLD_81, Low::SDL::SDLK_WORLD_82, Low::SDL::SDLK_WORLD_83, Low::SDL::SDLK_WORLD_84, Low::SDL::SDLK_WORLD_85, Low::SDL::SDLK_WORLD_86, Low::SDL::SDLK_WORLD_87, Low::SDL::SDLK_WORLD_88, Low::SDL::SDLK_WORLD_89, Low::SDL::SDLK_WORLD_9, Low::SDL::SDLK_WORLD_90, Low::SDL::SDLK_WORLD_91, Low::SDL::SDLK_WORLD_92, Low::SDL::SDLK_WORLD_93, Low::SDL::SDLK_WORLD_94, Low::SDL::SDLK_WORLD_95, Low::SDL::SDLK_a, Low::SDL::SDLK_b, Low::SDL::SDLK_c, Low::SDL::SDLK_d, Low::SDL::SDLK_e, Low::SDL::SDLK_f, Low::SDL::SDLK_g, Low::SDL::SDLK_h, Low::SDL::SDLK_i, Low::SDL::SDLK_j, Low::SDL::SDLK_k, Low::SDL::SDLK_l, Low::SDL::SDLK_m, Low::SDL::SDLK_n, Low::SDL::SDLK_o, Low::SDL::SDLK_p, Low::SDL::SDLK_q, Low::SDL::SDLK_r, Low::SDL::SDLK_s, Low::SDL::SDLK_t, Low::SDL::SDLK_u, Low::SDL::SDLK_v, Low::SDL::SDLK_w, Low::SDL::SDLK_x, Low::SDL::SDLK_y, Low::SDL::SDLK_z, Low::SDL::SDL_ACTIVEEVENT, Low::SDL::SDL_ADDEVENT, Low::SDL::SDL_ANYFORMAT, Low::SDL::SDL_ASYNCBLIT, Low::SDL::SDL_AUDIO_PAUSED, Low::SDL::SDL_AUDIO_PLAYING, Low::SDL::SDL_AUDIO_STOPPED, Low::SDL::SDL_BUTTON_LEFT, Low::SDL::SDL_BUTTON_MIDDLE, Low::SDL::SDL_BUTTON_RIGHT, Low::SDL::SDL_BUTTON_WHEELDOWN, Low::SDL::SDL_BUTTON_WHEELUP, Low::SDL::SDL_BYTEORDER, Low::SDL::SDL_DEFAULT_REPEAT_DELAY, Low::SDL::SDL_DEFAULT_REPEAT_INTERVAL, Low::SDL::SDL_DISABLE, Low::SDL::SDL_DOUBLEBUF, Low::SDL::SDL_ENABLE, Low::SDL::SDL_EVENT_RESERVED2, Low::SDL::SDL_EVENT_RESERVED3, Low::SDL::SDL_EVENT_RESERVED4, Low::SDL::SDL_EVENT_RESERVED5, Low::SDL::SDL_EVENT_RESERVED6, Low::SDL::SDL_EVENT_RESERVED7, Low::SDL::SDL_EVENT_RESERVEDA, Low::SDL::SDL_EVENT_RESERVEDB, Low::SDL::SDL_FULLSCREEN, Low::SDL::SDL_GETEVENT, Low::SDL::SDL_GRAB_FULLSCREEN, Low::SDL::SDL_GRAB_OFF, Low::SDL::SDL_GRAB_ON, Low::SDL::SDL_GRAB_QUERY, Low::SDL::SDL_HAT_CENTERED, Low::SDL::SDL_HAT_DOWN, Low::SDL::SDL_HAT_LEFT, Low::SDL::SDL_HAT_LEFTDOWN, Low::SDL::SDL_HAT_LEFTUP, Low::SDL::SDL_HAT_RIGHT, Low::SDL::SDL_HAT_RIGHTDOWN, Low::SDL::SDL_HAT_RIGHTUP, Low::SDL::SDL_HAT_UP, Low::SDL::SDL_HWPALETTE, Low::SDL::SDL_HWSURFACE, Low::SDL::SDL_IGNORE, Low::SDL::SDL_INIT_AUDIO, Low::SDL::SDL_INIT_CDROM, Low::SDL::SDL_INIT_EVENTTHREAD, Low::SDL::SDL_INIT_EVERYTHING, Low::SDL::SDL_INIT_JOYSTICK, Low::SDL::SDL_INIT_NOPARACHUTE, Low::SDL::SDL_INIT_TIMER, Low::SDL::SDL_INIT_VIDEO, Low::SDL::SDL_JOYAXISMOTION, Low::SDL::SDL_JOYBALLMOTION, Low::SDL::SDL_JOYBUTTONDOWN, Low::SDL::SDL_JOYBUTTONUP, Low::SDL::SDL_JOYHATMOTION, Low::SDL::SDL_KEYDOWN, Low::SDL::SDL_KEYUP, Low::SDL::SDL_LIL_ENDIAN, Low::SDL::SDL_MIX_MAXVOLUME, Low::SDL::SDL_MOUSEBUTTONDOWN, Low::SDL::SDL_MOUSEBUTTONUP, Low::SDL::SDL_MOUSEMOTION, Low::SDL::SDL_NOEVENT, Low::SDL::SDL_NOFRAME, Low::SDL::SDL_NUMEVENTS, Low::SDL::SDL_OPENGL, Low::SDL::SDL_OPENGLBLIT, Low::SDL::SDL_PEEKEVENT, Low::SDL::SDL_PRESSED, Low::SDL::SDL_QUERY, Low::SDL::SDL_QUIT, Low::SDL::SDL_RELEASED, Low::SDL::SDL_RESIZABLE, Low::SDL::SDL_SWSURFACE, Low::SDL::SDL_SYSWMEVENT, Low::SDL::SDL_TIMESLICE, Low::SDL::SDL_USEREVENT, Low::SDL::SDL_VIDEOEXPOSE, Low::SDL::SDL_VIDEORESIZE, Low::SDL::TIMER_RESOLUTION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Low::SDL

SDL_BlitSurface, SDL_LoadBMP, SDL_LoadWAV, SDL_RWclose, SDL_RWread, SDL_RWseek, SDL_RWtell, SDL_RWwrite, SDL_SaveBMP

Methods included from Wrap

included, #initialize_pointer

Constructor Details

#initialize(ptr) ⇒ PixelFormat

Returns a new instance of PixelFormat.



11
12
13
# File 'lib/frusdl/sdl/pixelformat.rb', line 11

def initialize(ptr)
  initialize_pointer(ptr, Frusdl::Low::SDL::SDL_PixelFormat) 
end

Instance Attribute Details

#pointerObject (readonly)

Returns the value of attribute pointer.



9
10
11
# File 'lib/frusdl/sdl/pixelformat.rb', line 9

def pointer
  @pointer
end

Instance Method Details

#get_rgbObject

Get RGB values from a pixel in the specified pixel format. XXX: not implemented



27
28
29
# File 'lib/frusdl/sdl/pixelformat.rb', line 27

def get_rgb()
  return [-1, -1, -1, -1]
end

#get_rgbaObject

Get RGBA values from a pixel in the specified pixel format. XXX: not implemented



34
35
36
# File 'lib/frusdl/sdl/pixelformat.rb', line 34

def get_rgba()
  return [-1, -1, -1, -1]
end

#map_rgb(r, g, b) ⇒ Object

Map a RGB color value to a pixel format.



16
17
18
# File 'lib/frusdl/sdl/pixelformat.rb', line 16

def map_rgb(r, g, b)
  return SDL_MapRGB(@pointer, r, g, b)
end

#map_rgba(r, g, b, a) ⇒ Object

Map a RGBA color value to a pixel format.



21
22
23
# File 'lib/frusdl/sdl/pixelformat.rb', line 21

def map_rgba(r, g, b, a)
  return SDL_MapRGBA(@pointer, r, g, b, a)
end